Database Reference
In-Depth Information
6 <rdf:Statement>
7 <rdf:subject rdf:resource = “mereaMaps:0012”/>
8 <rdf:predicate rdf:resource = “mereaMaps:has_name”/>
9 <rdf:object rdf:resource = “The Isis Tavern”/>
10 <dc:creator rdf:resource = “ http://mereamaps.gov.me/
codeMonkey1”/ >
11 </rdf:Statement>
12 </rdf:RDF>
RDF/XML is commonly used to publish Linked Data, but its syntax is quite
verbose, making it difficult for people to read and write. It is worth considering an
alternative serialization for managing and curating RDF data, where someone has to
interact with the data, or for presenting it to the end user, where the end user needs
to be able to understand it easily. We talk more in Chapter 7 about how to author
and validate your own RDF data, but for now, let us look at the other RDF formats.
5.5.2 T uRTLe
Turtle is the Terse RDF Triple Language (Beckett and Berners-Lee, 2008), which
is in the process of being standardized by W3C and is widely used for reading and
writing triples by hand as it is shorter and in plaintext. (If you feel a sudden urge to
get out your text editor and start writing RDF, then this is the format to use.) The
RDF query language SPARQL, which is discussed in Chapter 7, borrows a lot of its
syntax from Turtle. An example of Turtle is as follows:
1 @prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >.
2 @prefix mereaMaps: < http://mereamaps.gov.me/topo/ >.
3
4 mereaMaps:0012 mereaMaps:has_name “The Isis Tavern”.
5 mereaMaps:0012 mereaMaps:has_longitude “-1.241712”.
Notice the prefixes, which avoid the need to repeat long namespaces. URIs are
always in angle brackets when written in full, as in lines 1 and 2, and statements end
with a full stop, as in line 4 and 5. Turtle's advantage lies in its shortcuts, making it
quicker to read and write. These include the use of a default namespace, which does
not require an explicit prefix but just uses a colon as follows:
1 @prefix : < http://mereamaps.gov.me/topo/ >.
2 @prefix geonames: < http://sws.geonames.org/ > .
3
4 :0012 a :Pub;
5 :has_name “The Isis Tavern”@en;
6 :has_longitude “-1.241712”^^< http://www.w3.org/2001/
XMLSchema#float > ;
7 :sells [
8 :is_brewed_in geonames:2640726.
9 ].
Search WWH ::




Custom Search