- From: Bijan Parsia <bparsia@cs.man.ac.uk>
- Date: Mon, 23 Apr 2007 16:28:19 +0100
- To: Sandro Hawke <sandro@w3.org>
- Cc: semantic-web@w3.org
On 23 Apr 2007, at 16:00, Sandro Hawke wrote: > [ thanks for all the comments... I want to clarify this point before > replying to some of the others. ] > >>> 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 . >>> >>> I believe the dominant opinion is that one should use Style 1 >>> unless one >>> needs one of the key features of Style 2, which are roughly: >>> a. the values are ordered >>> b. the values are exhaustive >> >> Since it ensures neither, I think style 2 is a huge anti-pattern. I >> recommend it against it always. > > Can you explain this? I have that power. > In what sense are the elements in the list not ordered? They are ordered but that order is neither really "semantic" nor is it intention revealing. For example, the canonical use of rdf:List is in OWL syntax where it represents an unordered collection (at some level). For example, I can add, without difficulty, the following statement to your turtle: p:Charles f:children ( p:Harry p:William ). But more to the point, even if they *are* ordered, and you exploit that order, it's not a good way to achieve the *modeling* of the ordering in question. Usually there are many orderings (age, grades, number of hair follicles, height). The *significance* of the ordering above is pretty clearly age, but then why not model that? In both cases, *recognizing* the order comes from outside. This is an old point from relational database design. > By "exhaustive", just to be clear, I mean that using Style 2 one can > define "children" such that when we list Charles' children we are also > saying these are his *only* children. But you aren't saying that. Add: p:Charles f:children ( p:Janice ). Who are p:Charles' children? rdf:Lists are misleading thus, even aside from their lack of decent formal semantics: they are not very intention revealing either. Eschew, eschew! > Is your point that such a > constraint on p:children can't be specified in OWL? No. > Alan points out that one can do that with OWL maxCardinality. To do > that, you'd need to introduce classes like ParentWithTwoKids, > ParentWithThreeKids, Not even a little bit. > etc, and then say: > > p:Charles a f:ParentWithTwoKids; > f:child p:William, p:Harry. > right? Nope. p:Charles a [a Restriction; onProperty f:child; cardinality "2"]; f:child p:William, p:Harry. Cheers, Bijan.
Received on Monday, 23 April 2007 15:27:26 UTC