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.
-
#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.
-
#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.
-
#sources ⇒ Array<Source>
Where the data is sourced from.
-
#supported? ⇒ Boolean
Can metadata be loaded for this Dataset?.
-
#temporal ⇒ Object<Temporal>
The temporal coverage of the dataset.
-
#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
228 229 230 |
# File 'lib/data_kitten/dataset.rb', line 228 def change_history [] end |
#contributor_agreement_url ⇒ String
The URL of the contributor license agreement
205 206 207 |
# File 'lib/data_kitten/dataset.rb', line 205 def contributor_agreement_url nil end |
#contributors ⇒ Array<Agent>
A list of contributors
191 192 193 |
# File 'lib/data_kitten/dataset.rb', line 191 def contributors [] end |
#crowdsourced? ⇒ Boolean
Has the data been crowdsourced?
198 199 200 |
# File 'lib/data_kitten/dataset.rb', line 198 def crowdsourced? false end |
#data_title ⇒ String
The human-readable title of the dataset.
82 83 84 |
# File 'lib/data_kitten/dataset.rb', line 82 def data_title nil end |
#description ⇒ String
A brief description of the dataset
89 90 91 |
# File 'lib/data_kitten/dataset.rb', line 89 def description nil end |
#distributions ⇒ Array<Distribution> Also known as: files, resources
A list of distributions. Has aliases for popular alternative vocabularies.
212 213 214 |
# File 'lib/data_kitten/dataset.rb', line 212 def distributions [] end |
#documentation_url ⇒ String
Human-readable documentation for the dataset.
103 104 105 |
# File 'lib/data_kitten/dataset.rb', line 103 def documentation_url nil end |
#host ⇒ Symbol
Where the dataset is hosted.
75 76 77 |
# File 'lib/data_kitten/dataset.rb', line 75 def host nil end |
#issued ⇒ Date Also known as: release_date
Date the dataset was released
118 119 120 |
# File 'lib/data_kitten/dataset.rb', line 118 def issued nil end |
#keywords ⇒ Array<string>
Keywords for the dataset
96 97 98 |
# File 'lib/data_kitten/dataset.rb', line 96 def keywords [] end |
#licenses ⇒ Array<License>
A list of licenses
177 178 179 |
# File 'lib/data_kitten/dataset.rb', line 177 def licenses [] end |
#maintainers ⇒ Array<Agent>
A list of maintainers
163 164 165 |
# File 'lib/data_kitten/dataset.rb', line 163 def maintainers [] end |
#modified ⇒ Date
Date the dataset was last modified
126 127 128 |
# File 'lib/data_kitten/dataset.rb', line 126 def modified nil end |
#origin ⇒ Symbol
The origin type of the dataset.
66 67 68 |
# File 'lib/data_kitten/dataset.rb', line 66 def origin nil end |
#publishers ⇒ Array<Agent>
A list of publishers
170 171 172 |
# File 'lib/data_kitten/dataset.rb', line 170 def publishers [] end |
#publishing_format ⇒ Symbol
The publishing format for the dataset.
156 157 158 |
# File 'lib/data_kitten/dataset.rb', line 156 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.
111 112 113 |
# File 'lib/data_kitten/dataset.rb', line 111 def release_type false end |
#rights ⇒ Object<Rights>
The rights statment for the data
184 185 186 |
# File 'lib/data_kitten/dataset.rb', line 184 def rights nil end |
#sources ⇒ Array<Source>
Where the data is sourced from
140 141 142 |
# File 'lib/data_kitten/dataset.rb', line 140 def sources [] end |
#supported? ⇒ Boolean
Can metadata be loaded for this Dataset?
57 58 59 |
# File 'lib/data_kitten/dataset.rb', line 57 def supported? !(origin.nil? || publishing_format.nil?) end |
#temporal ⇒ Object<Temporal>
The temporal coverage of the dataset
133 134 135 |
# File 'lib/data_kitten/dataset.rb', line 133 def temporal nil end |
#time_sensitive? ⇒ Boolean
Is the information time-sensitive?
147 148 149 |
# File 'lib/data_kitten/dataset.rb', line 147 def time_sensitive? false end |
#update_frequency ⇒ String
How frequently the data is updated.
221 222 223 |
# File 'lib/data_kitten/dataset.rb', line 221 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 |