W3C home > Mailing lists > Public > www-rdf-interest@w3.org > April 2003

Link paths

From: Peter Minten <peter.minten@wanadoo.nl>
Date: Sat, 19 Apr 2003 13:11:46 +0200
To: www-rdf-interest@w3.org
Message-Id: <03041913114603.01275@alaxia.localdomain>

Hi,

At the moment the most common way to link something in the Semantic Web is by
using absolute references, URI's and literals. For example if my school would 
store my email address it would simple create a literal 
"peter.minten@wanadoo.nl". I would also store my email address in a FOAF file,
say "rdf://foo.bar/PeterMinten" (I tend to prefix RDF uri's with rdf:// for 
clearity). If my email address would change my school would have to adapt it
manually. It would have been much easier though if my school would simply link
to the mailbox part of my FOAF. If everbody did this I would only have to 
adapt my FOAF to have everything updated automatically.

The mechanism that could be used for that is Link Path. A link path is a dot
separated list starting with a resource and continuing with property names. 
For example my mailbox could be refered to as:
'<rdf://foo.bar/PeterMinten>.<http://xmlns.com/foaf/0.1/mbox>'. The <...> 
parts are used to include URI's.

Of course that doesn't look really good, but what if it would be possible to
replace the foaf:mbox part with simply mbox? Then it would look like this:
'<rdf://foo.bar/PeterMinten>.mbox', much nicer. To make this possible the RDF
definition of a triple has to be extended with a fifth element (the fourth is
object type): name. The name of a triple would be unique within the collection
of all triples with the same subject.

Now there is a problem however, what to do with containers? For seq, alt and
collection the answer could be numerical names. For example to refer to the
mailbox of person fred in seq baz with number 3 you could use: 
'seq.3.mailbox'. Besides this being ugly (except in certain situations) it 
also doesn't work with bags.

Once again the name attribute solves things. If every list item would have a
name (that is unique in the list) it would become possible to refer to it by
that name. So if you have a bag of persons, Fred is one of them and the list
item triple that points to Fred is called Fred you could use the following 
setup to get Fred's mailbox: 'persons!Fred!mailbox'. Now that looks a lot 
better, doesn't it?

An argument against this approach would be that it reduces bags to simple
resources. Well, first of all the one that says this has to read up on his 
RDF, bags are simple resources. Second, this does not change the nature of 
bags, it only adds a simple way to use them. GNU.RDF.QL (GNU.RDF query 
language) would still treat the bag like an unordered vector and I expect the 
other query languages do the same.

Now to the way names could be specified in RDF/XML. 

Example 9 of the RDF Primer could be rewritten to:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:sportex="http://www.exampleRatings.com/terms/">

 <rdf:Description 
rdf:about="http://www.example.com/2002/04/products#item10245">
      <sportex:ratingBy rdf:name="ratingBy">Richard Roe</sportex:ratingBy>
      <sportex:numberStars rdf:name="numberStars">5</sportex:numberStars>
 </rdf:Description>
</rdf:RDF>

Note that the default name of a property could be written down in the 
ontology,
avoiding the need of writing it into the RDF/XML if a clever RDF system is 
used
(one that actually looks at the ontology).

Example 13 of the RDF Primer could be rewritten to:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:s="http://example.edu/students/vocab#">

   <rdf:Description rdf:about="http://example.edu/courses/6.001">
      <s:students>
         <rdf:Bag>
            <rdf:li rdf:resource="http://example.edu/students/Amy
                    rdf:name="Amy"/>
            <rdf:li rdf:resource="http://example.edu/students/Tim"
                    rdf:name="Tim"/>
            <rdf:li rdf:resource="http://example.edu/students/John"
                    rdf:name="John"/>
            <rdf:li rdf:resource="http://example.edu/students/Mary"
                    rdf:name="Mary"/>
            <rdf:li rdf:resource="http://example.edu/students/Sue"
                    rdf:name="Sue"/>
         </rdf:Bag>
      </s:students>
   </rdf:Description>
</rdf:RDF>


Example 14 of the RDF Primer could be rewritten to:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:s="http://example.org/packages/vocab#">

   <rdf:Description rdf:about="http://example.org/packages/X11">
      <s:DistributionSite>
         <rdf:Alt>
            <rdf:li rdf:resource="ftp://ftp.example.org" rdf:name="example"/>
            <rdf:li rdf:resource="ftp://ftp.example1.org" 
rdf:name="example1"/>
            <rdf:li rdf:resource="ftp://ftp.example2.org" rdf:name="example2/>
         </rdf:Alt>
      </s:DistributionSite>
   </rdf:Description>
</rdf:RDF>

Note that due to the use of the dot as separator (I've been considering bang 
as separator but was told it's less readable for humans) no dots are allowed 
inside names.

Greetings,

Peter
Received on Saturday, 19 April 2003 07:13:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:58 GMT