Class: RdfContext::NTSerializer
- Inherits:
-
AbstractSerializer
- Object
- AbstractSerializer
- RdfContext::NTSerializer
- Defined in:
- lib/rdf_context/serializer/nt_serializer.rb
Overview
Serialize RDF graphs in NTriples format
Instance Attribute Summary
Attributes inherited from AbstractSerializer
Instance Method Summary collapse
-
#serialize(stream, base = nil)
Serialize the graph.
Methods inherited from AbstractSerializer
Constructor Details
This class inherits a constructor from RdfContext::AbstractSerializer
Instance Method Details
#serialize(stream, base = nil)
This method returns an undefined value.
Serialize the graph
9 10 11 12 13 |
# File 'lib/rdf_context/serializer/nt_serializer.rb', line 9 def serialize(stream, base = nil) @graph.triples.collect do |t| stream.write(t.to_ntriples + "\n") end end |