Re: New tests to cover missing algebraic forms

Chimezie Ogbuji wrote:
> Per my ACTION, I've added 6 new tests to cover *some* common, missing
> algebraic forms.  4 were added to data-r2/optional and 2 were added to
> data-r2/algebra.  Unfortunately (or fortunately, if you consider
> uncovering untested bugs a good thing), RDFLib does *not* pass any of
> these tests.  I've gone over them several times to verify the expected
> results.  At the very least the data, queries, and results are
> well-formed (no parsing compliants).  

Thanks, Chimezie.

I added a trailing period to algebra/join-combo-graph-2.ttl and to 
optional/complex-data-1.ttl and to optional/result-complex*.ttl to get 
the parser I'm using to be happy. I also removed a stray " from a 
namespace declaration in result-opt-complex-2.ttl .

> The new tests are:
> 
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/algebra/manifest#join-combo-1
> Algebra form: Join(LeftJoin(BGP(..),{..}),Join(BGP(..),Union(..,..)))
> Comment: Tests nested combination of Join with a BGP / OPT and a BGP /
> UNION
> 
> PREFIX :    <http://example/>
> 
> SELECT ?a ?y ?d ?z
> { 
>     ?a :p ?c OPTIONAL { ?a :r ?d }. 
>     ?a ?p 1 { ?p a ?y } UNION { ?a ?z ?p } 
> }

The result set here has two bindings for ?y. I'm guessing that one (the 
one bound to a literal) should be ?d but even then I don't think I'd 
agree with the test. Does the test assume RDF entailment (specifically 
knowing that if :a :b :c then :b a rdf:Property)?

> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/algebra/manifest#join-combo-2
> Algebra form: Join(Graph(varOrIRI,{..}),Union(..,..))
> Comment: Tests combination of Join operator with Graph on LHS and Union
> on RHS
> 
> PREFIX :    <http://example/>
> 
> SELECT ?x ?y ?z
> { 
>     GRAPH ?g { ?x ?p 1 } { ?x :p ?y } UNION { ?p a ?z }
> }

Glitter passes this test (I haven't eyeballed it in detail).

> 
> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional/manifest#dawg-optional-complex-1
> Comment: Complex optional:
> LeftJoin(LeftJoin(BGP(..),{..}),Join(BGP(..),Union(..,..)))
> 
> PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
> SELECT ?person ?nick ?page ?img ?name ?firstN
> { 
>     ?person foaf:nick ?nick
>     OPTIONAL { ?person foaf:isPrimaryTopicOf ?page } 
>     OPTIONAL { 
>         ?person foaf:name ?name 
>         { ?person foaf:depiction ?img } UNION 
>         { ?person foaf:firstName ?firstN } 
>     } FILTER ( bound(?page) || bound(?img) || bound(?firstN) ) 
> } 

I don't pass this and will try to look at it later.

> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional/manifest#dawg-optional-complex-2
> Comment: Complex optional:
> LeftJoin(Join(BGP(..),Graph(var,{..})),Union(..,..))
> 
> PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
> PREFIX    ex:   <http://example.org/things#>
> SELECT ?id ?ssn
> WHERE 
> { 
>     ?person 
>         a foaf:Person;
>         foaf:name ?name . 
>     GRAPH ?x { 
>         [] foaf:name ?name;
>            foaf:nick ?nick
>     } 
>     OPTIONAL { 
>         { ?person ex:empId ?id } UNION { ?person ex:ssn ?ssn } 
>     } 
> }

Glitter passes this.

> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional/manifest#dawg-optional-complex-3
> Comment: Complex optional:
> LeftJoin(Join(BGP(..),Graph(var,{..})),LeftJoin(BGP(..),{..}))
> 
> PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
> PREFIX    ex:   <http://example.org/things#>
> SELECT ?name ?nick ?plan ?dept
> WHERE 
> { 
>     ?person 
>         a foaf:Person;
>         foaf:name ?name . 
>     GRAPH ?x { 
>         [] foaf:name ?name;
>            foaf:nick ?nick
>     } 
>     OPTIONAL { 
>         ?person ex:healthplan ?plan 
>         OPTIONAL { ?person ex:department ?dept } 
>     } 
> }

Glitter passes this.

> http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional/manifest#dawg-optional-complex-4
> Comment: Complex optional:
> LeftJoin(Join(BGP(..),Union(..,..)),Join(BGP(..),Graph(varOrIRI,{..})))
> 
> PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
> PREFIX    ex:   <http://example.org/things#>
> SELECT ?name ?plan ?dept ?img 
> WHERE 
> { 
>     ?person foaf:name ?name  
>     { ?person ex:healthplan ?plan } UNION { ?person
> ex:department ?dept } 
>     OPTIONAL { 
>         ?person a foaf:Person
>         GRAPH ?g { 
>             [] foaf:name ?name;
>                foaf:depiction ?img 
>         } 
>     } 
> }

I don't pass this either.

I'll do my best to look at these tests in more detail to see what's up a 
bit later.

Can anyone else report on these tests?

Lee

Received on Monday, 13 August 2007 19:32:48 UTC