Database Reference
In-Depth Information
In line 1, we make http://mereamaps.gov.me/topo the default namespace. Multiple
triples with the same URI subject can be grouped into one statement, delineated by
a semicolon if they have different predicates and objects, as in lines 4, 5, and 6, or
by a comma if they have the same predicate but just different objects. The predicate
a ” is used instead of rdf:type , as in line 4, to show that the Isis Tavern is a Pub.
The @ sign is used to indicate language, as in line 5, which states that “The  Isis
Tavern” is in English, and ^^ is used to indicate a datatype, as in line 6. Square
brackets are used for blank nodes, as in lines 7, 8, and 9. The file extension for turtle
files is.ttl.
5.5.3 N-T RipLes
N-Triples (Grant and Beckett, 2004) is a subset of Turtle (and not to be confused with
the Notation 3 language, which is a superset of Turtle, also incorporating support for
rules (Berners-Lee, 1998a). We have left Notation 3 outside the scope of this topic
as the full language is less widely used or supported than standard RDF). N-Triples
files should use the .nt file extension to distinguish them from Notation 3, which uses
the .n3 suffix. The N-Triples syntax does not allow prefixes or other shortcuts but
requires every triple to be written out in full, as in
1 < http://mereamaps.gov.me/topo/0012 > < http://www.w3.org/1999/
02/22-rdf-syntax-ns#type> < http://mereamaps.gov.me/topo/Pub > .
2 < http://mereamaps.gov.me/topo/0012 > < http://mereamaps.gov.me/ topo/
has_name> “The Isis Tavern”.
3 < http://mereamaps.gov.me/topo/0012 > < http://mereamaps.gov.me/ topo/
has_longitude> “1.241712” ^^< http://www.w3.org/2001/XMLSchema#float >.
4 < http://mereamaps.gov.me/topo/0012 > < http://mereamaps.gov.me/ topo/
sells> _:beer0.
5 _:beer0 < http://mereamaps.gov.me/topo/isbrewed_in >
< http://sws.geonames.org/2640726 >.
which contains the same triples as the last example. This makes an N-Triples file
quite long but means that each line in the file can be parsed separately. This means
that the N-Triples format is particularly good for large data files that cannot be loaded
into memory all at once, for parallel processing of the data or for backing it up.
There are tools on the Web that automatically convert from Turtle and N3 to
RDF/XML format and vice versa, 4 making it easy to write Turtle and yet publish in
RDF/XML. There is also a push from the W3C RDF Working Group to standardize
a JavaScript Object Notation (JSON) serialization for RDF, which would mean that
Web developers programming in JavaScript, Ruby, or PHP (hypertext processor)
could use RDF without needing additional software libraries.
5.5.4 RDF a
As mentioned in Chapter 2, RDF can also be embedded directly in HTML docu-
ments, rather than maintaining a separate file, using RDFa, which is the other W3C
standard format for RDF (Adida and Birbeck, 2008). This format allows existing
Search WWH ::




Custom Search