Module: ROF::Translators::JsonldToRof::StatementHandler
- Defined in:
- lib/rof/translators/jsonld_to_rof/statement_handler.rb
Overview
Responsible for parsing an RDF statement and adding to the accumulator.
Defined Under Namespace
Classes: UnhandledRdfSubjectError
Class Method Summary collapse
-
.call(statement, accumulator) ⇒ ROF::Translators::JsonldToRof::Accumulator
Parse the RDF statement and add it’s contents to the accumulator.
- .new(statement, accumulator) ⇒ Object private
Class Method Details
.call(statement, accumulator) ⇒ ROF::Translators::JsonldToRof::Accumulator
Note:
It is assumed that all blank nodes (e.g. RDF::Node) will be processed before you process any RDF::URI nodes.
Parse the RDF statement and add it’s contents to the accumulator
29 30 31 32 |
# File 'lib/rof/translators/jsonld_to_rof/statement_handler.rb', line 29 def self.call(statement, accumulator) new(statement, accumulator).call accumulator end |
.new(statement, accumulator) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rof/translators/jsonld_to_rof/statement_handler.rb', line 38 def self.new(statement, accumulator) case statement.subject when RDF::URI UriSubjectHandler.new(statement, accumulator) when RDF::Node BlankNodeHandler.new(statement, accumulator) else raise UnhandledRdfSubjectError, "Unable to determine subject handler for #{statement.inspect}" end end |