Module: ROF::Translators::JsonldToRof
- Defined in:
- lib/rof/translators/jsonld_to_rof.rb,
lib/rof/translators/jsonld_to_rof/accumulator.rb,
lib/rof/translators/jsonld_to_rof/predicate_handler.rb,
lib/rof/translators/jsonld_to_rof/statement_handler.rb,
lib/rof/translators/jsonld_to_rof/predicate_object_handler.rb
Overview
Note:
Some predicates require explicit mapping where as others have an assumed mapping. At present all URLs for @context of JSON-LD documents must be registered.
Responsible for converting JSON LD into an ROF Hash through the ‘.call` method (using the URI maps defined by the `.register` method)
Defined Under Namespace
Modules: PredicateHandler, PredicateObjectHandler, StatementHandler Classes: Accumulator
Constant Summary collapse
- REGEXP_FOR_A_CURATE_RDF_SUBJECT =
The $1 will be the PID
%r{\Ahttps?://curate(?:[\w\.]*).nd.edu/show/([[:alnum:]]+)/?}.freeze
Class Method Summary collapse
-
.call(jsonld, config) ⇒ Array<Hash>
Convert’s the given JSON-LD into an ROF document that can be used to batch ingest into Fedora.
Class Method Details
.call(jsonld, config) ⇒ Array<Hash>
Convert’s the given JSON-LD into an ROF document that can be used to batch ingest into Fedora.
96 97 98 99 100 |
# File 'lib/rof/translators/jsonld_to_rof.rb', line 96 def self.call(jsonld, config) Array.wrap(jsonld).map! do |element| Element.new(element).to_rof end end |