- From: Seaborne, Andy <andy.seaborne@hp.com>
- Date: Mon, 27 Sep 2004 16:57:30 +0100
- To: <public-rdf-dawg@w3.org>
To start some test cases for SOURCE, here is one of the simplest I could think of: Andy ----------------------------- ---- Graph <u1> :a :b :c ---- Graph <u2> :a :b :c ----------------------------- ---- Query 1 SELECT * FROM <u1>, <u2> WHERE (?x ?y ?z) I expect one result: ?x = :a , ?y = :b , ?z = :c A direct implementation of quads (where slot 4 is either the statement id or the context) might well yield two results which have the same ?x/?y/?z - I'm assuming that the query is on the RDF merge of the documents identified by <u1> and <u2>. I'm also assuming that the target for the query may be specified by context and not an explicit FROM - actually, I expect this to be quite common. I know some implementations have more results than this because it includes "system" information or other information not part of the original <u1> and <u2>. presumably, these are implementation dependent and outside exhaustive definition by DAWG. ---- Query 2 SELECT * FROM <u1>, <u2> WHERE SOURCE ?src (?x ?y ?z) Here, I'd expect that there are two results: ?src=<u1> , ?x = :a , ?y = :b , ?z = :c ?src=<u2> , ?x = :a , ?y = :b , ?z = :c Adding "SOURCE ?src" increases the number of solutions because the query is now over each of the components. ---- Query 2 SELECT ?x ?y ?z FROM <u1>, <u2> WHERE SOURCE ?src (?x ?y ?z) This is just the projection in the SELECT of query 2. I'd expect that there are two results: ?x = :a , ?y = :b , ?z = :c ?x = :a , ?y = :b , ?z = :c Any interaction with having SELECT DISTINCT or COUNT is a separate matter. ---- ---- For a single source: ---- Graph <v> :a :b :c ---- Query 3 SELECT * FROM <v> WHERE (?x ?y ?z) One result: ?x = :a , ?y = :b , ?z = :c ---- Query 3 SELECT * FROM <v> WHERE SOURCE ?src (?x ?y ?z) One result: ?src = <v> , ?x = :a , ?y = :b , ?z = :c treating a single named component the same. ---- ---- Finally, this brings the case where the external context provides a single, unnamed graph. There is no "FROM" clause. This is Eric's "?src = null" case I think. The test query involves: SOURCE ?src (?x ?y ?z) which could yield: ?x = :a , ?y = :b , ?z = :c that is, ?src is not bound but there is a solution. If ?src is used else, it can bind and that makes this a problem. Not sure the best solution. Other choices include having no solution (argument; there isn't a named component of the overall RDF graph that matches), a special symbol URI http://www.w3.org/2001/sw/DataAccess/Unknown (seems to have special handling) or a bNode (which implies the source *as a document* not a graph is in the set of all individuals - not sure if that's legal or not). Not sure in which graph the bNode exists - it isn't in the original graph supplied and there is no other graph around except some "system graph". Having written that, I'm inclined to keep things simple in the conceptual model - no match here because there is no named source. Hope this helps - Andy
Received on Monday, 27 September 2004 15:58:02 UTC