- From: Steve Harris <steve.harris@garlik.com>
- Date: Tue, 21 Dec 2010 12:51:55 +0000
- To: Andy Seaborne <andy.seaborne@epimorphics.com>
- Cc: Axel Polleres <axel.polleres@deri.org>, SPARQL Working Group <public-rdf-dawg@w3.org>
On 2010-12-21, at 12:39, Andy Seaborne wrote: > >>> >>> One example is: >>> >>> ?x rdf:type/rdfs:subClassOf* ?T >> >> I see, otherwise you'd have to write ?x (rdf:type|rdf:type/rdfs:subClassOf*) ?T, which looks a bit tautological. > > Yes. > >> On the other hand, trying to find just the transitively closed subclass relationships with: >> >> ?C rdfs:subClassOf* ?SC . >> >> you will get many non-sensical results. I think you can write >> >> [] rdfs:subClassOf ?SC . >> ?C rdfs:subClassOf [] . >> ?C rdfs:subClassOf* ?SC . >> >> if you want just the transitively closed classes/superclasses, but that also looks odd. > > Isn't transitive closure "+" > > ?C rdfs:subClassOf+ ?SC . If you have <C> rdfs:subClassOf <D> . then <C> is a subClass of <C>. I don't know a way to write that that's clearer than what I have above. >> I'm also concerned that the relatively innocuous-looking expression like { ?s rdfs:subClassOf* ?o } will have a higher cardinality than { ?s ?p ?o }, but I guess users will learn not to do that after the first few hundred times they try it :) > > ?s rdfs:subClassOf* ?o will have ?s = ?o, not the cross product of the subjects and objects. > > { ?s ?p ?o } could have more cardinality. > > :x :p1 :y . > :x :p2 :y . > :x :p3 :y . > :x :p4 :y . > > { ?s rdfs:subClassOf* ?o } => cardinality 2 > > ?s=:x, ?o=:x > ?s=:y, ?o=:y > > and > > {?s ?p ?o } is 4 rows. > > It can be odd that "?x :p* ?o" does not depend on :p but it's similar to string regex: > > "xyz" is matched by "a*" To be strict, only the substring "" is matched by it. $ echo "xyz" > foo.txt $ egrep -o 'a*' foo.txt $ - Steve -- Steve Harris, CTO, Garlik Limited 1-3 Halford Road, Richmond, TW10 6AW, UK +44 20 8439 8203 http://www.garlik.com/ Registered in England and Wales 535 7233 VAT # 849 0517 11 Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD
Received on Tuesday, 21 December 2010 12:52:29 UTC