Module: ROF::Translators::JsonldToRof::PredicateHandler
- Defined in:
- lib/rof/translators/jsonld_to_rof/predicate_handler.rb
Overview
Responsible for dealing with registered predicates and how those are handled.
Defined Under Namespace
Classes: UnhandledPredicateError
Class Method Summary collapse
-
.call(predicate, object, accumulator, blank_node = false) ⇒ ROF::Translators::JsonldToRof::Accumulator
Parse the RDF predicate and RDF object and add it’s contents to the accumulator.
- .register(url) {|| ... } ⇒ Object
Class Method Details
.call(predicate, object, accumulator, blank_node = false) ⇒ 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 predicate and RDF object and add it’s contents to the accumulator
34 35 36 37 38 |
# File 'lib/rof/translators/jsonld_to_rof/predicate_handler.rb', line 34 def self.call(predicate, object, accumulator, blank_node = false) handler = registry.handler_for(predicate) handler.handle(object, accumulator, blank_node) accumulator end |
.register(url) {|| ... } ⇒ Object
45 46 47 |
# File 'lib/rof/translators/jsonld_to_rof/predicate_handler.rb', line 45 def self.register(url, &block) registry << UrlHandler.new(url, &block) end |