Module: Middleman::Ontologist::SemanticResource
- Defined in:
- lib/ontologist/semantic_resource.rb
Instance Attribute Summary collapse
-
#ontology ⇒ Object
Returns the value of attribute ontology.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
- #body ⇒ Object
-
#objects_through_predicate(predicate) ⇒ Object
return all objects connected to self through this predicate.
- #objects_with_axis(predicate) ⇒ Object
-
#subjects_through_predicate(predicate) ⇒ Object
return all subjects connected to self through this predicate.
- #subjects_with_axis(predicate) ⇒ Object
Instance Attribute Details
#ontology ⇒ Object
Returns the value of attribute ontology.
11 12 13 |
# File 'lib/ontologist/semantic_resource.rb', line 11 def ontology @ontology end |
#uri ⇒ Object
Returns the value of attribute uri.
12 13 14 |
# File 'lib/ontologist/semantic_resource.rb', line 12 def uri @uri end |
Instance Method Details
#body ⇒ Object
34 35 36 |
# File 'lib/ontologist/semantic_resource.rb', line 34 def body render(self, :layout => nil) end |
#objects_through_predicate(predicate) ⇒ Object
return all objects connected to self through this predicate
15 16 17 18 |
# File 'lib/ontologist/semantic_resource.rb', line 15 def objects_through_predicate(predicate) predicate = ontology.convert_predicate(predicate) ontology.store.query [RDF::URI.new(uri), predicate, nil] end |
#objects_with_axis(predicate) ⇒ Object
26 27 28 |
# File 'lib/ontologist/semantic_resource.rb', line 26 def objects_with_axis(predicate) predicate = ontology.convert_predicate(predicate) end |
#subjects_through_predicate(predicate) ⇒ Object
return all subjects connected to self through this predicate
21 22 23 24 |
# File 'lib/ontologist/semantic_resource.rb', line 21 def subjects_through_predicate(predicate) predicate = ontology.convert_predicate(predicate) ontology.store.query [nil, predicate, RDF::URI.new(uri)] end |
#subjects_with_axis(predicate) ⇒ Object
30 31 32 |
# File 'lib/ontologist/semantic_resource.rb', line 30 def subjects_with_axis(predicate) predicate = ontology.convert_predicate(predicate) end |