Module: Middleman::Ontologist::SemanticResource

Defined in:
lib/ontologist/semantic_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ontologyObject

Returns the value of attribute ontology.



11
12
13
# File 'lib/ontologist/semantic_resource.rb', line 11

def ontology
  @ontology
end

#uriObject

Returns the value of attribute uri.



12
13
14
# File 'lib/ontologist/semantic_resource.rb', line 12

def uri
  @uri
end

Instance Method Details

#bodyObject



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