What is difference b/w Turtle, Triples and N-Triples

Hi All,

I have idea regarding Turtle and triple. But finding difficulty in drawing inference. Please guide me what is difference b/w Turtle and Triple.

The Turtle family of languages derives from something called Notation3 that was invented by Tim-Berners Lee. Notation3 provided a compact syntax for writing RDF but also extended RDF by adding features from first-order logic. Thus, Notation3 is a notation for writing "N3 Logic".

N3 Logic turned out to be much slower than RDF, so there hasn't been enduring interest in it.

Turtle is a syntax for RDF that is a subset of Notation3. Turtle has features that enable a concise syntax that is easy to write by hand. You can write something like

  @prefix myns: <http://example.com/mynamespace/>

myns:object1 a myns:type1,myns:type2;
myns:property1 myns:object2 .

note that the "," lets you give multiple objects that apply to the subject-predicate and the ";" lets you specify different predicates that apply to a subject. There are also some shorthands for blank nodes that are convenient for writing RDF collections and OWL schemas.

N-Triples is a simplified version of Turtle that removes most of the shorthand. One line of an N-Triples equals one triple, so you can process N-Triples files with UNIX tools. N-Triples is more verbose than Turtle, but N-Triples is convenient when you need to handle millions of triples -- gzip compression removes most of the fat. The above file would look like this written in N-Triples:

 <http://myexample.com/mynamespace/object1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://myexample.com/mynamespace/type1> .
 <http://myexample.com/mynamespace/object1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://myexample.com/mynamespace/type2> .    
 <http://myexample.com/mynamespace/object1> <http://myexample.com/mynamespace/property1> <http://myexample.com/mynamespace/object2> .

Many of think that Turtle and N-Triples are superior replacements for the obsolete RDF/XML format. Turtle is the preferred format if you want to write a few hundred triples by hand, and N-Triples is used to publish large RDF data sets like DBpedia.

Just an additional info: the W3C RDF Working Group is standardizing Turtle. The latest draft is, of course, on the Web, and should be considered as the most up-to-date version of Turtle. That document (or maybe a separate one, not yet fully decided) will also give a 'standard' for N-triples; finally, and most probably, something like TriG will also be added to the list of official serializations formats (the latter depends on the outcome of the current discussions on named graphs).

Turtle and N-Triples are serialization formats of RDF, like RDF+XML or N3.

You should probably read more about RDF here or here.