Module: ActiveTriples::RDFSource::ClassMethods
- Defined in:
- lib/active_triples/rdf_source.rb
Instance Method Summary collapse
-
#from_uri(uri, vals = nil) ⇒ ActiveTriples::Entity
Adapter for a consistent interface for creating a new Resource from a URI.
-
#id_persisted?(test_id) ⇒ TrueClass, FalseClass
Test if the rdf_subject that would be generated using a specific ID is already in use in the triplestore.
-
#uri_persisted?(test_uri) ⇒ TrueClass, FalseClass
Test if the rdf_subject that would be generated using a specific URI is already in use in the triplestore.
Instance Method Details
#from_uri(uri, vals = nil) ⇒ ActiveTriples::Entity
Adapter for a consistent interface for creating a new Resource from a URI. Similar functionality should exist in all objects which can become a Resource.
545 546 547 |
# File 'lib/active_triples/rdf_source.rb', line 545 def from_uri(uri, vals = nil) new(uri, vals) end |
#id_persisted?(test_id) ⇒ TrueClass, FalseClass
Test if the rdf_subject that would be generated using a specific ID is already in use in the triplestore.
560 561 562 563 |
# File 'lib/active_triples/rdf_source.rb', line 560 def id_persisted?(test_id) rdf_subject = self.new(test_id).rdf_subject ActiveTriples::Repositories.has_subject?(rdf_subject) end |
#uri_persisted?(test_uri) ⇒ TrueClass, FalseClass
Test if the rdf_subject that would be generated using a specific URI is already in use in the triplestore.
576 577 578 579 |
# File 'lib/active_triples/rdf_source.rb', line 576 def uri_persisted?(test_uri) rdf_subject = test_uri.kind_of?(RDF::URI) ? test_uri : RDF::URI(test_uri) ActiveTriples::Repositories.has_subject?(rdf_subject) end |