N-Triples
N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF graphs, and a subset of the Turtle format. N-Triples should not be confused with Notation3 which is a superset of Turtle. N-Triples was primarily developed by Dave Beckett at the University of Bristol and Art Barstow at the World Wide Web Consortium.
N-Triples was designed to be a simpler format than Notation3 and Turtle, and therefore easier for software to parse and generate. However, because it lacks some of the shortcuts provided by other RDF serialisations it can be onerous to type out large amounts of data by hand, and difficult to read.
Usage
There is very little variation in how an RDF graph can be represented in N-Triples. This makes it a very convenient format to provide "model answers" for .Implementations
As N-Triples is a subset of Turtle and Notation3, by definition all tools which support input in either of those formats will support N-Triples. In addition, some tools like Cwm have specific support for N-Triples.File format
Each line of the file has either the form of a comment or of a statement: A statement consists of four parts, separated by whitespace:- the subject,
- the predicate,
- the object,
- a full stop which means the termination of a statement
Example
The N-Triples statements below are equivalent to this RDF/XML:- RDF/XML
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
- N-Triples
_:art
_:art
_:dave
_:dave
N-Quads
The related N-Quads superset extends N-Triples with an optional context value at the fourth position.# or on a line by themselves
_:subject1
_:subject2