Class: PublishMyData::ConceptScheme
- Inherits:
-
Object
- Object
- PublishMyData::ConceptScheme
show all
- Includes:
- AllFeatures, Tripod::Resource
- Defined in:
- app/models/publish_my_data/concept_scheme.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#deprecated?, #download_prefix, #resource_type, #slug
Class Method Details
.uri_from_slug(slug) ⇒ Object
9
10
11
|
# File 'app/models/publish_my_data/concept_scheme.rb', line 9
def self.uri_from_slug(slug)
"http://#{PublishMyData.local_domain}/def/#{slug}"
end
|
Instance Method Details
#concepts ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/models/publish_my_data/concept_scheme.rb', line 13
def concepts
@concepts ||= Concept.find_by_sparql(
"SELECT DISTINCT ?uri ?graph
WHERE {
GRAPH ?graph {
?uri <#{RDF::SKOS.inScheme.to_s}> <#{self.uri}> .
?uri a <#{RDF::SKOS.Concept.to_s}> .
}
}"
)
end
|
#concepts_sorted ⇒ Object
25
26
27
|
# File 'app/models/publish_my_data/concept_scheme.rb', line 25
def concepts_sorted
ConceptScheme.sort_by_label_or_uri(concepts)
end
|
#eager_load! ⇒ Object
33
34
35
36
|
# File 'app/models/publish_my_data/concept_scheme.rb', line 33
def eager_load!
super
self.concepts.each{|c| c.eager_load!}
end
|
#local? ⇒ Boolean
29
30
31
|
# File 'app/models/publish_my_data/concept_scheme.rb', line 29
def local?
true
end
|