Class: DataKitten::Dataset
- Inherits:
-
Object
- Object
- DataKitten::Dataset
- Includes:
- Hosts, Origins, PublishingFormats
- Defined in:
- lib/data_kitten/dataset.rb
Overview
Represents a single dataset from some origin (see dcat:Dataset for relevant vocabulary).
Designed to be created with a URI to the dataset, and then to work out metadata from there.
Currently supports Datasets hosted in Git (and optionally on GitHub), and which use the Datapackage metadata format.
Instance Attribute Summary collapse
-
#access_url ⇒ String
The URL that gives access to the dataset.
Instance Method Summary collapse
-
#change_history ⇒ Array
A history of changes to the Dataset.
-
#contributor_agreement_url ⇒ String
The URL of the contributor license agreement.
-
#contributors ⇒ Array<Agent>
A list of contributors.
-
#crowdsourced? ⇒ Boolean
Has the data been crowdsourced?.
-
#data_title ⇒ String
The human-readable title of the dataset.
-
#description ⇒ String
A brief description of the dataset.
-
#distributions ⇒ Array<Distribution>
(also: #files, #resources)
A list of distributions.
-
#documentation_url ⇒ String
Human-readable documentation for the dataset.
-
#host ⇒ Symbol
Where the dataset is hosted.
-
#identifier ⇒ String
A unique identifier of the dataset.
-
#initialize(options) ⇒ Dataset
constructor
Create a new Dataset object.
-
#issued ⇒ Date
(also: #release_date)
Date the dataset was released.
-
#keywords ⇒ Array<string>
Keywords for the dataset.
-
#landing_page ⇒ String
A web page that can be used to gain access to the dataset, its distributions and/or additional information.
-
#language ⇒ String
The language of the dataset.
-
#licenses ⇒ Array<License>
A list of licenses.
-
#maintainers ⇒ Array<Agent>
A list of maintainers.
-
#modified ⇒ Date
Date the dataset was last modified.
-
#origin ⇒ Symbol
The origin type of the dataset.
-
#publishers ⇒ Array<Agent>
A list of publishers.
-
#publishing_format ⇒ Symbol
The publishing format for the dataset.
-
#release_type ⇒ Symbol
What type of dataset is this? Options are:
:web_servicefor API-accessible data, or:one_offfor downloadable data dumps. -
#rights ⇒ Object<Rights>
The rights statment for the data.
- #source ⇒ Object
-
#sources ⇒ Array<Source>
Where the data is sourced from.
-
#spatial ⇒ GeoJSON Geometry
Spatial coverage of the dataset.
-
#supported? ⇒ Boolean
Can metadata be loaded for this Dataset?.
-
#temporal ⇒ Object<Temporal>
The temporal coverage of the dataset.
-
#theme ⇒ String
The main category the dataset belongs to.
-
#time_sensitive? ⇒ Boolean
Is the information time-sensitive?.
-
#update_frequency ⇒ String
How frequently the data is updated.
- #uri ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(options) ⇒ Dataset
Create a new Dataset object
38 39 40 41 42 43 |
# File 'lib/data_kitten/dataset.rb', line 38 def initialize() @access_url = DataKitten::Fetcher.wrap([:access_url]) detect_origin detect_host detect_publishing_format end |
Instance Attribute Details
#access_url ⇒ String
Returns the URL that gives access to the dataset.
30 31 32 |
# File 'lib/data_kitten/dataset.rb', line 30 def access_url @access_url end |
Instance Method Details
#change_history ⇒ Array
A history of changes to the Dataset
261 262 263 |
# File 'lib/data_kitten/dataset.rb', line 261 def change_history [] end |
#contributor_agreement_url ⇒ String
The URL of the contributor license agreement
238 239 240 |
# File 'lib/data_kitten/dataset.rb', line 238 def contributor_agreement_url nil end |
#contributors ⇒ Array<Agent>
A list of contributors
210 211 212 |
# File 'lib/data_kitten/dataset.rb', line 210 def contributors [] end |
#crowdsourced? ⇒ Boolean
Has the data been crowdsourced?
231 232 233 |
# File 'lib/data_kitten/dataset.rb', line 231 def crowdsourced? false end |
#data_title ⇒ String
The human-readable title of the dataset.
94 95 96 |
# File 'lib/data_kitten/dataset.rb', line 94 def data_title nil end |
#description ⇒ String
A brief description of the dataset
101 102 103 |
# File 'lib/data_kitten/dataset.rb', line 101 def description nil end |
#distributions ⇒ Array<Distribution> Also known as: files, resources
A list of distributions. Has aliases for popular alternative vocabularies.
245 246 247 |
# File 'lib/data_kitten/dataset.rb', line 245 def distributions [] end |
#documentation_url ⇒ String
Human-readable documentation for the dataset.
115 116 117 |
# File 'lib/data_kitten/dataset.rb', line 115 def documentation_url nil end |
#host ⇒ Symbol
Where the dataset is hosted.
79 80 81 |
# File 'lib/data_kitten/dataset.rb', line 79 def host nil end |
#identifier ⇒ String
A unique identifier of the dataset.
87 88 89 |
# File 'lib/data_kitten/dataset.rb', line 87 def identifier nil end |
#issued ⇒ Date Also known as: release_date
Date the dataset was released
130 131 132 |
# File 'lib/data_kitten/dataset.rb', line 130 def issued nil end |
#keywords ⇒ Array<string>
Keywords for the dataset
108 109 110 |
# File 'lib/data_kitten/dataset.rb', line 108 def keywords [] end |
#landing_page ⇒ String
A web page that can be used to gain access to the dataset, its distributions and/or additional information.
145 146 147 |
# File 'lib/data_kitten/dataset.rb', line 145 def landing_page nil end |
#language ⇒ String
The language of the dataset.
217 218 219 |
# File 'lib/data_kitten/dataset.rb', line 217 def language nil end |
#licenses ⇒ Array<License>
A list of licenses
196 197 198 |
# File 'lib/data_kitten/dataset.rb', line 196 def licenses [] end |
#maintainers ⇒ Array<Agent>
A list of maintainers
182 183 184 |
# File 'lib/data_kitten/dataset.rb', line 182 def maintainers [] end |
#modified ⇒ Date
Date the dataset was last modified
138 139 140 |
# File 'lib/data_kitten/dataset.rb', line 138 def modified nil end |
#origin ⇒ Symbol
The origin type of the dataset.
70 71 72 |
# File 'lib/data_kitten/dataset.rb', line 70 def origin nil end |
#publishers ⇒ Array<Agent>
A list of publishers
189 190 191 |
# File 'lib/data_kitten/dataset.rb', line 189 def publishers [] end |
#publishing_format ⇒ Symbol
The publishing format for the dataset.
175 176 177 |
# File 'lib/data_kitten/dataset.rb', line 175 def publishing_format nil end |
#release_type ⇒ Symbol
What type of dataset is this? Options are: :web_service for API-accessible data, or :one_off for downloadable data dumps.
123 124 125 |
# File 'lib/data_kitten/dataset.rb', line 123 def release_type false end |
#rights ⇒ Object<Rights>
The rights statment for the data
203 204 205 |
# File 'lib/data_kitten/dataset.rb', line 203 def rights nil end |
#source ⇒ Object
53 54 55 |
# File 'lib/data_kitten/dataset.rb', line 53 def source @access_url.as_json if @access_url.ok? end |
#sources ⇒ Array<Source>
Where the data is sourced from
159 160 161 |
# File 'lib/data_kitten/dataset.rb', line 159 def sources [] end |
#spatial ⇒ GeoJSON Geometry
Spatial coverage of the dataset
268 269 270 |
# File 'lib/data_kitten/dataset.rb', line 268 def spatial nil end |
#supported? ⇒ Boolean
Can metadata be loaded for this Dataset?
61 62 63 |
# File 'lib/data_kitten/dataset.rb', line 61 def supported? !(origin.nil? || publishing_format.nil?) end |
#temporal ⇒ Object<Temporal>
The temporal coverage of the dataset
152 153 154 |
# File 'lib/data_kitten/dataset.rb', line 152 def temporal nil end |
#theme ⇒ String
The main category the dataset belongs to.
224 225 226 |
# File 'lib/data_kitten/dataset.rb', line 224 def theme nil end |
#time_sensitive? ⇒ Boolean
Is the information time-sensitive?
166 167 168 |
# File 'lib/data_kitten/dataset.rb', line 166 def time_sensitive? false end |
#update_frequency ⇒ String
How frequently the data is updated.
254 255 256 |
# File 'lib/data_kitten/dataset.rb', line 254 def update_frequency nil end |
#uri ⇒ Object
45 46 47 |
# File 'lib/data_kitten/dataset.rb', line 45 def uri URI(@access_url.to_s) end |
#url ⇒ Object
49 50 51 |
# File 'lib/data_kitten/dataset.rb', line 49 def url @access_url.to_s end |