Class: LD4L::WorksRDF::PopulateGraphFromRdfxml

Inherits:
Object
  • Object
show all
Defined in:
lib/ld4l/works_rdf/services/repository_services/populate_graph_from_rdfxml.rb

Class Method Summary collapse

Class Method Details

.call(rdfxml) ⇒ Object

Create an RDF::Graph populated rdfxml triples

Parameters:

  • triples (String)

    represented in rdfxml

Raises:

  • (ArgumentError)


11
12
13
14
15
16
# File 'lib/ld4l/works_rdf/services/repository_services/populate_graph_from_rdfxml.rb', line 11

def self.call( rdfxml )
  raise ArgumentError, 'rdfxml argument must be a non-empty string'  unless
      rdfxml.kind_of?(String) && rdfxml.size > 0

  RDF::Graph.new.from_rdfxml rdfxml
end