@@ -280,19 +280,24 @@ Internally, an `RDF::Statement` is treated as another resource, along with `RDF:
280280
281281** Note: This feature is subject to change or elimination as the standards process progresses.**
282282
283- ### Serializing a Graph containing quoted triples
283+ ### Serializing a Graph containing triple terms
284284
285285 require 'rdf/ntriples'
286286 statement = RDF::Statement(RDF::URI('bob'), RDF::Vocab::FOAF.age, RDF::Literal(23))
287- graph = RDF::Graph.new << [statement, RDF::URI("ex:certainty"), RDF::Literal(0.9)]
287+ reifier = RDF::Node.new
288+ graph = RDF::Graph.new do |g|
289+ g << [reifier, RDF.reifies, statement]
290+ g << [reifier, RDF::URI("ex:certainty"), RDF::Literal(0.9)]
291+ end
288292 graph.dump(:ntriples, validate: false)
289- # => '<<<bob> <http://xmlns.com/foaf/0.1/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer>>> <ex:certainty> "0.9"^^<http://www.w3.org/2001/XMLSchema#double> .'
293+ # ==> '_:bn <http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies> <<(<bob> <http://xmlns.com/foaf/0.1/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer>)>> .
294+ _:bn <ex:certainty> "0.9"^^<http://www.w3.org/2001/XMLSchema#double> .'
290295
291- ### Reading a Graph containing quoted triples
296+ ### Reading a Graph containing triple terms
292297
293298By default, the N-Triples reader will reject a document containing a subject resource.
294299
295- nt = '<<<bob> <http://xmlns.com/foaf/0.1/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer>>> <ex:certainty> "0.9"^^<http://www.w3.org/2001/XMLSchema#double> .'
300+ nt = '<<( <bob> <http://xmlns.com/foaf/0.1/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer>) >> <ex:certainty> "0.9"^^<http://www.w3.org/2001/XMLSchema#double> .'
296301 graph = RDF::Graph.new do |graph|
297302 RDF::NTriples::Reader.new(nt) {|reader| graph << reader}
298303 end
0 commit comments