W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2004

Re: Some tests: optional triples // first pass

From: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
Date: Tue, 13 Jul 2004 16:01:31 +0100
To: public-rdf-dawg@w3.org
Message-ID: <20040713150130.GG31552@login.ecs.soton.ac.uk>

I've just added these to the tescase list:
http://www.ecs.soton.ac.uk/~swh/TestSketchCases/

On Wed, Jul 07, 2004 at 03:03:03PM +0100, Andy Seaborne wrote:
> 
> Snapshot of some tests of optional triples cases.
> 
> Browsable copy:
> http://jena.hpl.hp.com/~afs/DAWG/Tests/
> 
> Manifest file:
> http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-tests.n3
> 
> Zipped checkpoint including everything:
> http://jena.hpl.hp.com/~afs/DAWG/dawg-tests-2004-07-07.zip
> 
> Everything =>
>   manifest, data, queries, results
>             The result sets are encoded into RDF serialized in N3
>             Unset variables are absent from the particualr solution
> 
> Comments, suggestions for new tests, requests for things to make it
> easier to get a quick overview etc., please.
> 
> 	Andy
> 
> 
> Explanation of each test:
> 
> ---------------------------------------------------------
> Test: dawg-test-001
> Data:   http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-data-01.n3
> Query:  http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-query-001
> Result: http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-result-001.n3
> 
> Example of a single triple optional clause.
> This is Simon's example, foaf'ified as the other tests use
> this same data file.
> 
> Query:
> 
> # Get name, and optionally the mbox, of each person
> SELECT ?name ?mbox
> WHERE
>     (?person foaf:name ?name)
> OPTIONAL
>     (?person foaf:mbox	?mbox)
> USING foaf FOR <http://xmlns.com/foaf/0.1/>
> 
> Output:
> ---------------------------------
> | name    | mbox                |
> =================================
> | "Bob"   | <mailto:bob@work>   |
> | "Bob"   | <mailto:bob@home>   |
> | "Eve"   | <<unset>>           |
> | "Alice" | <mailto:alice@work> |
> ---------------------------------
> 
> ---------------------------------------------------------
> Test: dawg-test-002
> Data:   http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-data-01.n3
> Query:  http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-query-002
> Result: http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-result-002.n3
> 
> Example of multi-triple graph pattern in optional part.
> 
> Query:
> # Get names of people, together with the names of people they know.
> SELECT ?name, ?name2
> WHERE
>     (?person foaf:name ?name)
> OPTIONAL
>     (?person foaf:knowns ?p2)
>     (?p2     foaf:name   ?name2)
> USING foaf FOR <http://xmlns.com/foaf/0.1/>
> 
> Output:
> -----------------------
> | name    | name2     |
> =======================
> | "Bob"   | "Alice"   |
> | "Alice" | "Bob"     |
> | "Eve"   | <<unset>> |
> -----------------------
> 
> because Eve does not know anybody with a name (she knows Fred).
> 
> Note:
> This leads to a need for nested optionals: get the name or mbox of 
> any people known by people in the FOAF datafile.
> 
> ---------------------------------------------------------
> Test: dawg-test-003
> Data:   http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-data-01.n3
> Query:  http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-query-003
> Result: http://jena.hpl.hp.com/~afs/DAWG/Tests/dawg-result-003.n3
> 
> Example of multiple, independent optional clauses.
> 
> # Get names and mboxes, each of which may be optional.
> 
> SELECT ?name, ?mbox
> WHERE
>     (?person rdf:type foaf:Person)
> OPTIONAL
>     (?person foaf:name  ?name)
> OPTIONAL
>     (?person foaf:mbox  ?mbox)
> USING foaf FOR <http://xmlns.com/foaf/0.1/>
> # rdf: is built in because its easier that way
> 
> -----------------------------------
> | name      | mbox                |
> ===================================
> | "Bob"     | <mailto:bob@home>   |
> | "Bob"     | <mailto:bob@work>   |
> | <<unset>> | <fred@edu>          |
> | "Eve"     | <<unset>>           |
> | "Alice"   | <mailto:alice@work> |
> -----------------------------------
Received on Tuesday, 13 July 2004 12:39:44 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:20 GMT