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, PhilReceived on Thursday, 19 August 2004 19:14:27 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:52:08 GMT