Re: Corrected sparqlx schema (sent the wrong one previously)

On Wed, Mar 23, 2005 at 03:11:08PM +0000, Seaborne, Andy wrote:
> 
> 
> element query-pattern {
>     (group-pattern
>        | element pattern-group {
>            triple-pattern?            <<---- can be empty
>          }

Do you mean a pattern-group can be empty or a triple-pattern can be
empty? I assume the former, since an empty triple-pattern doesn't make
a lot of sense.

But, then, I can't make sense of serializing an empty pattern-group
either...?

>        | element dataset-constraint {
>            (uri | variable), (group-pattern)
>          }*
>         ^^^^ ????? why *

I assume trang set that cardinality to * because of sparqlx-23.xml in
the zip file, which serializes this query:

PREFIX  data:  <http://example.org/foaf/>
PREFIX  foaf:  <http://xmlns.com/foaf/0.1/>
PREFIX  rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  rdfs:  <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?mbox ?age ?ppd
WHERE
{
  GRAPH data:aliceFoaf {
  ?alice foaf:mbox <mailto:alice@work.example> ;
         foaf:knows ?whom .
  ?whom  foaf:mbox ?mbox ;
         rdfs:seeAlso ?ppd .
  ?ppd  a foaf:PersonalProfileDocument .} .
  GRAPH ?ppd {
  ?w foaf:mbox ?mbox ;
     foaf:age ?age }
  }

Where there are two GRAPH constraints.

Kendall

PS--I include sparqlx-23.xml here for reference.

<?xml version="1.0" encoding="UTF-8"?>

<!--
PREFIX  data:  <http://example.org/foaf/>
PREFIX  foaf:  <http://xmlns.com/foaf/0.1/>
PREFIX  rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX  rdfs:  <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?mbox ?age ?ppd
WHERE
{
  GRAPH data:aliceFoaf {
  ?alice foaf:mbox <mailto:alice@work.example> ;
         foaf:knows ?whom .
  ?whom  foaf:mbox ?mbox ;
         rdfs:seeAlso ?ppd .
  ?ppd  a foaf:PersonalProfileDocument .} .
  GRAPH ?ppd {
  ?w foaf:mbox ?mbox ;
     foaf:age ?age }
  }    
-->
<rdf-query xmlns="http://www.w3.org/2001/sw/DataAccess/sparql-xml-syntax/">
    <select distinct="false" limit="">
        <variable name="age"></variable>
        <variable name="mbox"></variable>
        <variable name="ppd"></variable>
    </select>
    <query-pattern>
        <dataset-constraint>
            <!-- could be a dataset-constraint attr instead? -->
            <uri>http://example.org/foaf/aliceFoaf</uri>
            <group-pattern optional="false">
                <triple-pattern optional="false">
                    <subject>
                        <variable name="alice"></variable>
                    </subject>
                    <predicate>
                        <uri>http://xmlns.com/foaf/0.1/foaf/mbox</uri>
                    </predicate>
                    <object>
                        <uri>mailto:alice@work.example</uri>
                    </object>
                </triple-pattern>
                <triple-pattern>
                    <subject>
                        <variable name="alice"></variable>
                    </subject>
                    <predicate>
                        <uri>http://xmlns.com/foaf/0.1/foaf/knows</uri>
                    </predicate>
                    <object>
                        <variable name="whom"></variable>
                    </object>
                </triple-pattern>
                <triple-pattern>
                    <subject>
                        <variable name="whom"></variable>
                    </subject>
                    <predicate>
                        <uri>http://xmlns.com/foaf/0.1/foaf/mbox</uri>
                    </predicate>
                    <object>
                        <variable name="mbox"></variable>
                    </object>
                </triple-pattern>
                <triple-pattern>
                    <subject>
                        <variable name="whom"></variable>
                    </subject>
                    <predicate>
                        <uri>http://www.w3.org/2000/01/rdf-schema#seeAlso</uri>
                    </predicate>
                    <object>
                        <variable name="ppd"></variable>
                    </object>
                </triple-pattern>
                <triple-pattern>
                    <subject>
                        <variable name="ppd"></variable>
                    </subject>
                    <predicate>
                        <uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri>
                    </predicate>
                    <object>
                        <uri>http://xmlns.com/foaf/0.1/PersonalProfileDocument</uri>
                    </object>
                </triple-pattern>
            </group-pattern>
        </dataset-constraint>
        <dataset-constraint>
            <variable name="ppd"></variable>
            <group-pattern>
                <triple-pattern optional="false">
                    <subject>
                        <variable name="w"></variable>
                    </subject>
                    <predicate>
                        <uri>http://xmlns.com/foaf/0.1/foaf/mbox</uri>
                    </predicate>
                    <object>
                        <variable name="mbox"></variable>
                    </object>
                </triple-pattern>
                <triple-pattern optional="false">
                    <subject>
                        <variable name="w"></variable>
                    </subject>
                    <predicate>
                        <uri>http://xmlns.com/foaf/0.1/foaf/age</uri>
                    </predicate>
                    <object>
                        <variable name="age"></variable>
                    </object>
                </triple-pattern>
            </group-pattern>
        </dataset-constraint>
    </query-pattern>
</rdf-query>

Received on Wednesday, 23 March 2005 15:50:34 UTC