Database Reference
In-Depth Information
TABLE 5.4
RDF Triples Denoting the Information “The Isis Tavern sells beer
that's brewed in Mereashire”
Subject
Predicate
Object
mm:0012
http://mereabeers.co.me/sells
_:beer0
_:beer0
http://mereabeers.co.me/is_brewed_in
http://sws.geonames.org/2640726
This is only one type of n -ary relation; there are others that can only be modeled
in OWL (Web Ontology Language) DL and not in RDF alone. These are discussed
further in Chapter 10. Note a couple of final points about blank nodes before we
move on: First, a blank node is not accessible outside the graph and hence cannot be
considered during data integration. Querying graphs containing a lot of blank nodes
is slower. Second, blank nodes can only be used for subjects or objects; we cannot
have blank properties.
5.5 RDF SERIALIZATION
RDF on its own is a data model , not a data format. Serialization is the process of
putting an RDF graph into a data format to publish it on the Web. That is, you take
the triples and put them in a file, using a particular syntax. This can be done in
advance, off line, if the dataset is static, or it can be done on demand if the data
set is known to change a lot. As usual, there are plenty of different RDF formats.
W3C has standardized two syntaxes (RDF/XML and RDFa [Resource Description
Framework-in-attributes]), and there are other nonstandard serialization formats
that offer advantages in certain circumstances.
5.5.1
RDF/XML
RDF/XML is the “normative” or typical syntax that is used to format RDF (Beckett,
2004). W3C has specified a set of XML tags, or “vocabulary,” that can be used to
describe the elements in an RDF graph, which are denoted by the RDF namespace
http://www.w3.org/1999/02/22-rdf-syntax-ns# . It is not a great idea, although you
can just open up a text editor and start typing in all your data as RDF/XML. It is
verbose and long winded, and you will end up making mistakes. As discussed
further in Chapter 7, there are plenty of RDF editors with graphical user inter-
faces that will output RDF/XML without you having to author it directly, such as
Altova's SemanticWorks, Topbraid Composer, Rej, or Protégé (of which there are
two versions, offering different features), and there are also tools to convert your data
sitting in a GIS (Geographic Information System) or relational database into RDF.
So, the aim of this section is to help you understand the RDF/XML syntax when you
see it, rather than expecting you to jump right in there and author the RDF/XML
directly. Also, here is a word of warning: If you are coming from a background in
XML, you should probably avoid using RDF/XML and choose one of the alternative
 
Search WWH ::




Custom Search