Database Reference
In-Depth Information
as an object. To indicate that the Isis Tavern is next to the River Isis, in RDF/XML
we can say
1 <?xml version = “1.0” encoding = “UTF-8”?>
2 <rdf:RDF
3 xmlns:rdf = “
http://www.w3.org/1999/02/22-rdf-syntax-ns#”
4 xmlns:mereaMaps = “
http://mereamaps.gov.me/topo/”
>
5 <rdf:Description
6 rdf:about = “
http://mereamaps.gov.me/topo/0012”
>
7 <mereaMaps:is_next_to
8 rdf:resource = “
http://sws.geonames.org/2636063”/
>
9 </rdf:Description>
10 </rdf:RDF>
So, lines 7 and 8 use the
rdf:resource
tag with the GeoNames URI for the
River Isis. Next, let us look at how to express the graph from
Figure 5.3
containing
a blank node in RDF/XML syntax, using the RDF tag
rdf:nodeID
, as follows:
1 <?xml version = “1.0” encoding = “UTF-8”?>
2 <rdf:RDF
3 xmlns:rdf = “
http://www.w3.org/1999/02/22-rdf-syntax-ns#”
4 xmlns:mereaMaps = “
http://mereamaps.gov.me/topo/”
>
5 <rdf:Description
6 rdf:about = “
http://mereamaps.gov.me/topo/0012”
>
7 <mereaMaps:sells
8 rdf:nodeID = “beer0”/>
9 </rdf:Description>
10 <rdf:Description rdf:nodeID = “beer0”>
11 <mereaMaps:is_brewed_in
12 rdf:resource = “
http://sws.geonames.org/2640726”/
>
13 </rdf:Description>
14 </rdf:RDF>
On line 8 the
rdf:nodeID
is used to denote the blank node with local name
“beer0.” (The predicate
rdf:nodeID
is used for blank nodes, while
rdf:ID
can
be used for named nodes, where the URI supplied is an absolute one, that is, is not
relative to any initially supplied namespace prefix. rdf:about can be used for naming
nodes with a URI relative to a namespace prefix.) Then, in lines 10 to 13, the blank
node “beer0” gets its own
rdf:Description
in order to state that it is brewed in
the GeoNames resource of Mereashire. Note that this is an example of how you can
include a description of multiple resources in the same RDF/XML document by just
listing their
rdf:Descriptions
one after another.
Other terms in the RDF/XML vocabulary that you may come across include
rdf:datatype
,
rdf:parseType
, and
rdf:value
, which can be used to
encode a literal object that has a particular datatype (such as string, integer, or float-
ing point number). The following is an example of this, to state that the Isis Tavern's