Class: RDF::Raptor::NTriples::Reader

Inherits:
Reader
  • Object
show all
Defined in:
lib/rdf/raptor/ntriples.rb

Overview

N-Triples parser.

Examples:

Obtaining an N-Triples reader class

RDF::Reader.for(:ntriples)       #=> RDF::Raptor::NTriples::Reader
RDF::Reader.for("input.nt")
RDF::Reader.for(file_name:      "input.nt")
RDF::Reader.for(file_extension: "nt")
RDF::Reader.for(content_type:   "text/plain")

Parsing RDF statements from an N-Triples file

RDF::Reader.open("input.nt") do |reader|
  reader.each_statement do |statement|
    puts statement.inspect
  end
end