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

New tests to cover missing algebraic forms

From: Chimezie Ogbuji <ogbujic@ccf.org>
Date: Mon, 13 Aug 2007 13:59:52 -0400
To: "W3C Data Access Working Group" <public-rdf-dawg@w3.org>
Message-ID: <1187027992.7751.15.camel@otherland>

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).  

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 } 
}


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 }
}

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) ) 
} 

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 } 
    } 
}

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 } 
    } 
}

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 
        } 
    } 
}

-- 
Chimezie Ogbuji
Lead Systems Analyst
Thoracic and Cardiovascular Surgery
Cleveland Clinic Foundation
9500 Euclid Avenue/ W26
Cleveland, Ohio 44195
Office: (216)444-8593
ogbujic@ccf.org


===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.
Received on Monday, 13 August 2007 18:00:57 GMT

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