Class: LD4L::WorksRDF::PopulateGraphFromTurtle

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

Class Method Summary collapse

Class Method Details

.call(turtle) ⇒ Object

Create an RDF::Graph populated turtle triples

Parameters:

  • triples (String)

    represented in turtle

Raises:

  • (ArgumentError)


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

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

  RDF::Graph.new.from_ttl turtle
end