Sha256: fba18d39104f71d3d0c940da16e8e1a47965793c03fdc6fd90f38084926569f2
Contents?: true
Size: 546 Bytes
Versions: 5
Compression:
Stored size: 546 Bytes
Contents
require File.join(File.dirname(__FILE__), 'abstract_serializer') module RdfContext # Serialize RDF graphs in NTriples format class NTSerializer < AbstractSerializer # Serialize the graph # # @param [IO, StreamIO] stream Stream in which to place serialized graph # @option options [URIRef, String] :base (nil) Base URI of graph, used to shorting URI references # @return [void] def serialize(stream, base = nil) @graph.triples.collect do |t| stream.write(t.to_ntriples + "\n") end end end end
Version data entries
5 entries across 5 versions & 1 rubygems