module ROF::Translators::JsonldToRof

@api public

Responsible for converting JSON LD into an ROF Hash through the `.call` method (using the URI maps defined by the `.register` method)

@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.

@see ROF::Translators::JsonldToRof.call for details on how the JSON-LD is converted @see ROF::Translators::PredicateHandler.register for details on how Predicate URI's are mapped to nodes in the ROF document. @see ROF::Translators::JsonldToRof::PredicateHandler @see ROF::Translators::JsonldToRof::StatementHandler

Constants

REGEXP_FOR_A_CURATE_RDF_SUBJECT

The $1 will be the PID @see Related specs for expected behavior

Public Class Methods

call(jsonld, config) click to toggle source

@api public

Convert's the given JSON-LD into an ROF document that can be used to batch ingest into Fedora.

@param [Array<Hash>, Hash] jsonld - a Hash of JSON-LD data or an Array of JSON-LD Hashes @param [Hash] config (included to conform to the loose interface of translators) @return [Array<Hash>] An ROF document

# 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