- From: Phil Dawes <pdawes@users.sf.net>
- Date: Tue, 17 Aug 2004 21:24:05 +0000
- To: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
- Cc: www-rdf-interest@w3.org
Hi Steve, Steve Harris writes: > > I think it actually becomes: > > select ?obj, ?objlabel > where (<http://example.com/foo> ?prop ?obj) > OPTIONAL (?obj ?tmp ?objlabel) > (?tmp rdfs:subPropertyOf rdfs:label) > > an optional subgraph, c.f. http://www.w3.org/2001/sw/DataAccess/tests/ > but that still breaks the rule of having variables that can only be bound > in the optional part, but can, I think be expanded to something like: > [using SQL+RDF and a subset of 3stores schema] > > SELECT t1.object, t2.object > FROM triples t1 > LEFT JOIN triples t2 ON > (t2.subject = t1.object) > LEFT JOIN triples t3 ON > (t3.subject = t2.predicate AND > t3.predicate = <rdfs:subPropertyOf> AND > t3.object = <rdfs:label>) > WHERE t1.subject = <http://example.com/foo> > I'm having problems getting this to work. I think the problem is that t2 can match any row as long as t2.subject = t1.object, since the bit that constrains the rest of the pattern is itself a left join. Does that make sense? Many thanks, Phil
Received on Thursday, 19 August 2004 19:14:27 UTC