Module: PublishMyData::DatasetPowers::ClassMethods
- Includes:
- AllFeatures::ClassMethods
- Defined in:
- app/models/concerns/publish_my_data/dataset_powers.rb
Instance Method Summary collapse
-
#data_graph_uri(slug) ⇒ Object
this is the dataset that the actual data will go in.
- #deprecation_last_query_str ⇒ Object
-
#metadata_graph_uri(slug) ⇒ Object
this is the graph that dataset metadata goes in.
-
#ordered_by_title ⇒ Object
Criteria etc.
- #uri_from_data_graph_uri(data_graph_uri) ⇒ Object
- #uri_from_slug(slug) ⇒ Object
Methods included from AllFeatures::ClassMethods
#deprecated_rdf_type, #find_by_slug, #get_deprecated_rdf_type, #slug_from_uri, #sort_by_label_or_uri
Instance Method Details
#data_graph_uri(slug) ⇒ Object
this is the dataset that the actual data will go in
109 110 111 |
# File 'app/models/concerns/publish_my_data/dataset_powers.rb', line 109 def data_graph_uri(slug) "http://#{PublishMyData.local_domain}/graph/#{slug}" end |
#deprecation_last_query_str ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'app/models/concerns/publish_my_data/dataset_powers.rb', line 127 def deprecation_last_query_str " SELECT ?uri where { # this bit is all the non-deprecated ones { SELECT * WHERE { ?uri a <http://publishmydata.com/def/dataset#Dataset> . ?uri <#{RDF::DC.title}> ?title . # select title so we can order MINUS { ?uri a <http://publishmydata.com/def/dataset#DeprecatedDataset> } } ORDER BY ?title } UNION # this bit is all the deprecated ones { SELECT * WHERE { ?uri a <http://publishmydata.com/def/dataset#DeprecatedDataset> . ?uri <#{RDF::DC.title}> ?title . # select title so we can order } ORDER BY ?title } } " end |
#metadata_graph_uri(slug) ⇒ Object
this is the graph that dataset metadata goes in.
104 105 106 |
# File 'app/models/concerns/publish_my_data/dataset_powers.rb', line 104 def (slug) "#{data_graph_uri(slug)}/metadata" end |
#ordered_by_title ⇒ Object
Criteria etc.
123 124 125 |
# File 'app/models/concerns/publish_my_data/dataset_powers.rb', line 123 def ordered_by_title all.where("?uri <#{RDF::DC.title}> ?title").order("?title") end |
#uri_from_data_graph_uri(data_graph_uri) ⇒ Object
113 114 115 |
# File 'app/models/concerns/publish_my_data/dataset_powers.rb', line 113 def uri_from_data_graph_uri(data_graph_uri) data_graph_uri.to_s.sub("/graph/", "/data/") end |
#uri_from_slug(slug) ⇒ Object
117 118 119 |
# File 'app/models/concerns/publish_my_data/dataset_powers.rb', line 117 def uri_from_slug(slug) "http://#{PublishMyData.local_domain}/data/#{slug}" end |