Re: plural vs singular properties (a proposal)

Sandro,

Sandro Hawke wrote:
> I keep running into a problem with modeling in RDFS/OWL where I don't
> know whether to use a multi-valued singular property or a single-valued
> plural (collection) property.

You might want to check out URF ( http://www.urf.name/ ), which solves 
this common RDF problem nicely. In URF, you don't have to make the 
choice between singular or plural values (that is, between a single 
value or a collection). Every URF property can be ordered, while still 
maintaining the normal subject->predicate->object relationship, so 
querying isn't disturbed. Let's take your examples below into URF (using 
TURF) to see the difference:

>   For example:
>
> Style 1 - Singular Property
>
>     Turtle:   p:Charles f:child p:William, p:Harry.
>
>     N-Triples:
>               p:Charles f:child p:William .
>               p:Charles f:child p:Harry .
>
>   

In TURF I would represent the same information this way:

|p|<http://example.com/>,
p.charles:
  p.child=william,
  p.child=harry
;

There is a relationship of p.child between p.charles and p.william, and 
between p.charles and p.harry, as we would expect. But what if we want 
to keep track of the order of the children?


> Style 2 - Plural (Collection) Property
>
>     Turtle:   p:Charles f:children ( p:William p:Harry ).
>
>     N-Triples:
>               p:Charles f:children _:genid2 .
>               _:genid2 rdf:first p:William .
>               _:genid2 rdf:rest _:genid1 .
>               _:genid1 rdf:first p:Harry .
>               _:genid1 rdf:rest rdf:nil .
>
>   

Now we have problems. There is no longer the relationship of p.child 
between p.charles and p.william, and between p.charles and p.harry. 
Instead, we create this fake thing called a list that doesn't 
semantically reflect real life---did p.charles father a list, or did he 
father two children?

In URF we don't have this dilemma. I simply make the properties ordered 
using a TURF "sequence", like this:

|p|<http://example.com/>,
p.charles:
  p.child=\william, harry\
;

But have I created some new entity that p.charles fathered? No, I merely 
assigned "scoped urf.order values" to each property. In fact, it's 
exactly the same thing as doing this:

|urf|<http://urf.name/urf>,
|p|<http://example.com/>,
p.charles:
  p.child=william:
    urf.order~#0
  ;,
  p.child=harry:
    urf.order~#1
  ;
;



Go enter these TURF examples at 
<http://www.guiseframework.com/demo/urfprocess> to verify what I'm saying.

So we've maintained the relationship of p.child between p.charles and 
p.william and between p.charles and p.harry. Any querying that asks, "is 
p.charles the father of p.william?" will return the affirmative. And 
whenever we ask for a list of all property values, we're guaranteed that 
they will be returned in the correct order. (See 
<http://www.guiseframework.com/api/com/garretwilson/urf/URFScope.html#getPropertyValues(java.net.URI)>.). 
We get the best of both worlds.

When discussing the RDF version of VCard on this list, we spent weeks 
arguing about whether the vcard.familyName property should take a single 
value or a list, because value order might be important. With URF, the 
issue is moot. You can order any property, and only use urf.List when 
you're actually talking about a list of things. You can see that this 
problem doesn't come up at all in the URF VCard ontology at 
<http://www.urf.name/vcard.turf>.

Best,

Garret

Received on Thursday, 18 October 2007 14:08:29 UTC