World Library  
Flag as Inappropriate
Email this Article

N-Triples

Article Id: WHEBN0015752256
Reproduction Date:

Title: N-Triples  
Author: World Heritage Encyclopedia
Language: English
Subject: Resource Description Framework, Semantic Web, Blank node, Cwm (software), Bio-zen
Collection: Metadata
Publisher: World Heritage Encyclopedia
Publication
Date:
 

N-Triples

N-Triples
Filename extension .nt
Internet media type application/n-triples
Developed by W3C
Type of format semantic web
Container for RDF data
Extended to Turtle
Standard Specification

N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF (Resource Description Framework) graphs, and a subset of the Turtle (Terse RDF Triple Language) format.[1][2][3] N-Triples should not be confused with Notation 3 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 (W3C).[4]

N-Triples was designed to be a simpler format than Notation 3 and Turtle, and therefore easier for software to parse and generate. However, because it lacks some of the shortcuts provided by other RDF serialisations (such as CURIEs and nested resources, which are provided by both RDF/XML and Turtle) it can be onerous to type out large amounts of data by hand, and difficult to read.

Contents

  • Usage 1
  • Implementations 2
  • File format 3
    • Example 3.1
  • N-Quads 4
  • References 5
  • External links 6

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 RDF test suites.[3]

Implementations

As N-Triples is a subset of Turtle and Notation 3, 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 three parts, separated by whitespace:

  • the subject,
  • the predicate and
  • the object,

and is terminated with a full stop.

Subjects may take the form of a URI or a Blank node; predicates must be a URI; objects may be a URI, blank node or a literal. URIs are delimited with less-than and greater-than signs used as angle brackets. Blank nodes are represented by an alphanumeric string, prefixed with an underscore and colon (_:). Literals are represented as printable ASCII strings (with backslash escapes),[5] delimited with double-quote characters, and optionally suffixed with a language or datatype indicator. Language indicators are an at sign followed by an RFC 3066 language tag; datatype indicators are a double-caret followed by a URI. Comments consist of a line beginning with a hash sign.

Example

The N-Triples statements below are equivalent to this RDF/XML:

  • RDF/XML
 
   
     N-Triples
     
       
         Art Barstow
       
     
     
       
         Dave Beckett
       
     
   
 
  • N-Triples

(The symbol ↵ is used to indicate a place where a line has been wrapped for legibility. N-Triples do not allow lines to be wrapped arbitrarily: the line endings indicate the end of a statement.)

N-Quads

The related N-Quads superset extends N-Triples with an optional context value.[6][7]

References

  1. ^
  2. ^
  3. ^ a b
  4. ^
  5. ^
  6. ^ http://www.w3.org/TR/n-quads/
  7. ^ http://sw.deri.org/2008/07/n-quads/

External links

  • RDF for Intrepid Unix Hackers: Grepping N-Triples
  • RDF for Intrepid Unix Hackers: Transmuting N-Triples
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 



Copyright © World Library Foundation. All rights reserved. eBooks from World eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.