DAWG Testcases - NOT CURRENT
    
      - Document Editor
- Steve Harris – 
      IAM, University of Southampton
- Version:
- $Revision: 1.72 $
Copyright © 2004 W3C® (MIT,
    ERCIM,
    Keio), All Rights Reserved. W3C
    liability,
    
    trademark, and  document
    use rules apply.
    
    Abstract. This document lists a selection of queries that have been used in the discussions of the RDF Data Access Working Group. It is not the most up-to-date test suite produced by the group. An up-to-date test suite can be found here.
    
    Status
    Note: The tests contained on this page are not the
    latest tests approved by the Data Access Working Group. The new tests page collects the updated tests. Please see the README for information on the test reorganization.
    All new tests are in the data-r2/ subdirectory.
    Tests in the data/
    subdirectory should not be considered up-to-date, even if marked as
    approved.
    Source files
    This document is automatically built from the manifest files. Relevant files are:
    
      - Schema and documentation
- 
        
      
- Manifests
- 
        
      
- Source archives
- 
        
      
   Contents
   
    - dawg-triple-pattern-001
- Approved
- Simple triple match 
- dawg-triple-pattern-002
- Approved
- Simple triple match 
- dawg-triple-pattern-003
- Approved
- Simple triple match - repeated variable 
- dawg-triple-pattern-004
- Approved
- Simple triple match - two triples, common variable 
- bgp-bnode-predicate-1
- Blank node in the predicate position 
- dawg-bnode-coreference
- Query results must maintain bnode co-references in the dataset 
- dawg-bound-query-001
- BOUND test case. 
- Function Property - list members
- Function Property - list membership test
- Function Property - list membership test
- Function Property - rdfs member
- Function Property - rdfs membership
- Function Property - sequence
- dawg-construct-identity
- Graph equivalent result graph 
- dawg-construct-subgraph
- Result subgraph of original graph 
- dawg-construct-reification
- Reification of the dataset 
- Distinct-1
- sparql-query-example-a
- Approved
- Example from section 2.1 
- sparql-query-example-b
- Approved
- Example from section 2.3 
- sparql-query-example-c
- Approved
- Example from section 2.4 
- sparql-query-example-d
- Approved
- Example from section 2.5 
- sparql-query-example-e
- Example from section 3 
- sparql-query-example-Testing-Values-0
- Example from section 11 
- sparql-query-example-Testing-Values-1
- 2nd Example from section 11 
- sparql-query-example-Testing-Values-RDFterm-equal
- Example from section 11.2.3.1 
- sparql-query-example-Testing-Values-RDFterm-equal-2
- 2nd Example from section 11.2.3.1 
- sparql-query-example-Testing-Values-bound
- Example from section 11.2.3.2 
- sparql-query-example-Testing-Values-bound-2
- 2nd Example from section 11.2.3.2 
- sparql-query-example-Testing-Values-isURI
- Example from section 11.2.3.3 
- sparql-query-example-Testing-Values-isBlank
- Example from section 11.2.3.4 
- sparql-query-example-Testing-Values-isLiteral
- Example from section 11.2.3.5 
- sparql-query-example-Testing-Values-str
- Example from section 11.2.3.6 
- sparql-query-example-Testing-Values-lang
- Example from section 11.2.3.7 
- OPTIONAL-FILTER
- OPTIONAL - Outer FILTER
- OPTIONAL - Outer FILTER with BOUND
- Test 'boolean effective value' - true
- Test 'boolean effective value' - false
- Test 'boolean effective value' - &&
- Test 'boolean effective value' - ||
- Test 'boolean effective value' - optional
- Test 'boolean effective value' - unknown types
- str-1
- str-2
- str-3
- str-4
- isBlank-1
- datatype-1
- datatype-2 : Literals with a datatype
- datatype-3 : Literals with a datatype of xsd:string
- lang-1 : Literals with a lang tag of some kind
- lang-2 : Literals with a lang tag of ''
- lang-3 : Graph matching with lang tag being a different case
- isURI-1
- isIRI-1
- LangMatches-1
- LangMatches-2
- LangMatches-3
- LangMatches-4
- Equality 1-1
- Equality 1-2
- Equality 1-3
- Equality 1-4
- Equality 1-5
- Equality - 2 var - test equals
- Equality - 2 var - test not equals 
- Equality 1-1 -- graph
- Bad test - assumes value equality in the graph. 
- Equality 1-2 -- graph
- Bad test - assumes value equality in the graph. 
- Equality 1-3 -- graph
- Bad test - assumes value equality in the graph. 
- Equality 1-4 -- graph
- Equality 1-5 -- graph
- spec-2.1
- Extracted: Writing a Simple Query  
- spec-2.1.6
- Extracted: Examples of Query Syntax  
- spec-2.1.6-q1
- Extracted: Examples of Query Syntax  
- spec-2.1.6-q2
- Extracted: Examples of Query Syntax  
- spec-2.1.6-q3
- Extracted: Examples of Query Syntax  
- spec-2.1.7
- Extracted: Data descriptions used in this document  
- spec-2.4
- Extracted: Pattern Solutions  
- spec-2.5.3
- Extracted: Example of Basic Graph Pattern Matching  
- spec-2.6
- Extracted: Multiple Matches  
- spec-2.7
- Extracted: Blank Nodes in Query Results  
- spec-2.7-r1
- Extracted: Blank Nodes in Query Results  
- spec-2.9
- Extracted: Querying Reification Vocabulary  
- spec-2.9-r1
- Extracted: Querying Reification Vocabulary  
- spec-3.1.1
- Extracted: Matching Integers  
- spec-3.1.2
- Extracted: Matching Arbitrary Datatypes  
- spec-3.1.3
- Extracted: Matching Language Tags  
- spec-3.1.3-q1
- Extracted: Matching Language Tags  
- spec-3.2
- Extracted: Value Constraints  
- spec-4.1
- Extracted: Group Graph Patterns  
- spec-4.1-q1
- Extracted: Group Graph Patterns  
- spec-5.1
- Extracted: Optional Pattern Matching  
- spec-5.2
- Extracted: Constraints in Optional Pattern Matching  
- spec-5.3
- Extracted: Multiple Optional Graph Patterns  
- spec-5.5
- Extracted: Nested Optional Graph Patterns  
- spec-6.1
- Extracted: Joining Patterns with UNION  
- spec-6.1-r1
- Extracted: Joining Patterns with UNION  
- spec-6.1-r2
- Extracted: Joining Patterns with UNION  
- spec-7.1-d2
- Extracted: Examples of RDF Datasets  
- spec-7.1-d5
- Extracted: Examples of RDF Datasets  
- spec-8.1
- Extracted: Accessing Graph Names  
- spec-8.2
- Extracted: Restricting by Graph IRI  
- spec-8.3
- Extracted: Restricting by Bound Variables  
- spec-8.4
- Extracted: Named and Default Graphs  
- spec-9.1
- Extracted: Specifying the Default Graph  
- spec-9.2
- Extracted: Specifying Named Graphs  
- spec-9.3
- Extracted: Combining FROM and FROM NAMED  
- spec-10.1.1
- Extracted: Projection  
- spec-10.1.2
- Extracted: DISTINCT  
- spec-10.1.3
- Extracted: ORDER BY  
- spec-10.1.3-q1
- Extracted: ORDER BY  
- spec-10.1.3-q2
- Extracted: ORDER BY  
- spec-10.1.4
- Extracted: LIMIT  
- spec-10.1.5
- Extracted: OFFSET  
- spec-10.2
- Extracted: Selecting Variables  
- spec-10.2-r1
- Extracted: Selecting Variables  
- spec-10.3
- Extracted: Constructing an Output Graph  
- spec-10.3.1
- Extracted: Templates with Blank Nodes  
- spec-10.3.2
- Extracted: Accessing Graphs in the RDF Dataset  
- spec-10.3.2-q1
- Extracted: Accessing Graphs in the RDF Dataset  
- spec-10.3.3
- Extracted: Solution Modifiers and CONSTRUCT  
- spec-10.4.1
- Extracted: Explicit IRIs  
- spec-10.4.2
- Extracted: Identifying Resources  
- spec-10.4.2-q1
- Extracted: Identifying Resources  
- spec-10.4.2-q2
- Extracted: Identifying Resources  
- spec-10.4.3
- Extracted: Descriptions of Resources  
- spec-10.5
- Extracted: Asking 'yes or no' questions  
- spec-10.5-r1
- Extracted: Asking 'yes or no' questions  
- spec-10.5-r2
- Extracted: Asking 'yes or no' questions  
- spec-11
- Extracted: Testing Values  
- spec-11.4.1
- Extracted: bound  
- spec-11.4.1-r1
- Extracted: bound  
- spec-11.4.2
- Extracted: isIRI  
- spec-11.4.3
- Extracted: isBlank  
- spec-11.4.4
- Extracted: isLiteral  
- spec-11.4.5
- Extracted: str  
- spec-11.4.6
- Extracted: lang  
- spec-11.4.7
- Extracted: datatype  
- spec-11.4.10
- Extracted: RDFterm-equal  
- spec-11.4.10-r1
- Extracted: RDFterm-equal  
- spec-11.4.11
- Extracted: langMatches  
- spec-11.4.11-r1
- Extracted: langMatches  
- spec-11.4.12
- Extracted: regex  
- spec-11.6
- Extracted: Extensible Value Testing  
- spec-11.6-q1
- Extracted: Extensible Value Testing  
- dawg-filter-scope-001
- Approved
- FILTER in BGP with matching triple pattern 
- dawg-filter-scope-002
- Approved
- FILTER as a sibling of a group containing BGP with matching triple pattern 
- dawg-filter-scope-003
- FILTER inside a group which is a sibling of a BGP with matching triple pattern 
- dawg-filter-scope-004
- FILTER inside a group which is a sibling of a group containing BGP with matching triple pattern 
- dawg-filter-order-001
- Approved
- FILTER after a matching triple in a BGP 
- dawg-filter-order-002
- FILTER before a matching triple in a BGP 
- kanji-01
- kanji-02
- normalization-01
- normalization-02
- Approved
- Example 1 from http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096 
- normalization-03
- Approved
- Example 2 from http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096 
- open-eq-01
- Approved
- graph match - no lexical form in data (assumes no value matching) 
- open-eq-02
- Approved
- graph match - unknown type 
- open-eq-03
- Approved
- Filter(?v=1) 
- open-eq-04
- Approved
- Filter(?v!=1) 
- open-eq-05
- Approved
- FILTER(?v = unknown type) 
- open-eq-06
- Approved
- FILTER(?v != unknown type) 
- open-eq-07
- Test of '='  
- open-eq-08
- Test of '!=' 
- open-eq-09
- Test of '=' 
- open-eq-10
- Test of '!=' 
- open-eq-11
- test of '=' || '!=' 
- open-eq-12
- find pairs that don't value-compare 
- date-1
- Added type : xsd:date '=' 
- date-2
- Added type : xsd:date '!=' 
- date-3
- Added type : xsd:date '>' 
- date-4
- xsd:date ORDER BY 
- open-cmp-01
- Find things that compare with < or > 
- open-cmp-02
- Find things that compare with <= and > 
- One optional clause
- One optional clause 
- Two optional clauses
- One optional clause 
- Union is not optional
- Union is not optional 
- dawg-opt-query-001
- Optional triples: single optional triple case. 
- dawg-opt-query-002
- Optional triples: multiple triples in one optional clause. Must find a name for each person known. 
- dawg-opt-query-003
- Optional triples: multiple optional clauses. 
- dawg-opt-query-004
- Optional triples: just a single optional clauses. 
- rdfSemantics-001
- Simple entailment 
- rdfSemantics-002
- Simple entailment redundancy 
- rdfSemantics-003
- Simple entailment missing coreference 
- rdfSemantics-004
- Simple entailment bnode in where clause 
- rdfSemantics-var-type-var
- Counting semantics - queried with a variable subject 
- rdfSemantics-bNode-type-var
- Counting semantics - queried with a bNode subject 
- rdfSemantics-bNode-constraint
- are bNode labels allowed in FILTERs? 
- rdfSemantics-bNode-join
- do bNode lables bridge basic graph patterns? 
- regex-query-001
- Simple unanchored match test 
- regex-query-002
- Case insensitive unanchored match test 
- regex-query-003
- Use/mention test 
- regex-query-004
- str()+URI test 
- rf1.example
- rf1 variable binding example (bindings in header order) 
- rf1.example-mixed
- rf1 variable binding example (bindings in arbitrary order) 
- dawg-select-1
- SELECT - one  variable in query, one in SELECT 
- dawg-select-2
- SELECT - one variable in query, two in SELECT 
- dawg-select-3
- SELECT - two variables in query, one in SELECT 
- dawg-triple-pattern-001-oldsyntax
- Simple triple match 
- dawg-triple-pattern-002-oldsyntax
- Simple triple match 
- dawg-triple-pattern-003-oldsyntax
- Simple triple match - repeated variable 
- dawg-triple-pattern-004-oldsyntax
- Simple triple match - two triples, common variable 
- dawg-triple-pattern-005
- Tested suggested by PFPS on C2.38 http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2006Feb/0028 
- No modifiers [numbers]
- Modifer DISTINCT
- Modifier ORDER BY [numbers]
- Modifer DISTINCT and ORDER BY [numbers]
- No modifiers [strings]
- Modifer ORDER BY [strings]
- Modifer OFFSET
- Modifer LIMIT
- Modifer DISTINCT-LIMIT
- Modifer LIMIT-OFFSET
- sorting-one-of-one-column
- NotApproved
- only opaque types with identical lexical and datatypes can be tested for = 
- sort-1
- Approved
- Alphabetic sort (ascending) on untyped literals 
- sort-2
- Alphabetic sort (descending) on untyped literals 
- sort-3
- Sort on (possibly unbound) URIs 
- sort-4
- Sort on datatyped (integer) literals 
- sort-5
- Sort first on untyped literals (ascending), then on datatyped (integer) literals (descending 
- sort-6
- Sort on mixed result of uris and literals. 
- sort-7
- Sort on comparable mixed typed literals (integer and float) 
- sort-8
- Sort on several mixed values (bnode, uri, literal) 
- sort-9
- Alphabetic sort (ascending) on datatyped (string) literals 
- sort-10
- Alphabetic sort (descending) on datatyped (string) literals 
- untrusted-graphs-001
- Untrusted graphs query example 1 
- untrusted-graphs-002
- Untrusted graphs query example 2 
- untrusted-graphs-004
- Untrusted graphs query example 4 
- untrusted-graphs-005
- Untrusted graphs query example 5 
- nested-graph-001
- Nested GRAPH statements use innermost graph 
- source-query-001
- trivial test 
- source-query-002
- 2 file test 
- source-query-003
- selecting 1 file from 2 test 
- source-query-005
- check files cant assert things against models 
- dawg-source-simple-001
- Simple triple match on two graphs 
- dawg-source-simple-002
- Triple match using SOURCE 
- dawg-source-simple-003
- Triple match using SOURCE - SELECTed variables 
- dawg-source-simple-004
- Simple triple match - one named container 
- dawg-source-simple-005
- Simple triple match - no named container 
- survey-1
- Return the names of the authors of publication X 
- survey-2
- Return the name and, if known, the e-mail of the author of publication X 
- survey-3
- Return the labels of all topics and (union) the titles of all publications. 
- survey-8
- Return the person who has classified the publication X. 
- survey-9
- Return the first author of Publication X. 
- survey-10
- Return all resources whose namespace starts with http://example.org/survey-sample/. 
- survey-11
- Return the German label of the topic whose English label is 'Database Management'. 
- survey-12
- Return all publications where the page number is the lexical value '08'. 
- survey-13
- Return all publications where the page number is the integer value 8. 
- syntax-basic-01.rq
- Approved
- syntax-basic-02.rq
- Approved
- syntax-basic-03.rq
- Approved
- syntax-basic-04.rq
- Approved
- syntax-basic-05.rq
- Approved
- syntax-basic-06.rq
- Approved
- syntax-bnodes-01.rq
- Approved
- syntax-bnodes-02.rq
- Approved
- syntax-bnodes-03.rq
- Approved
- syntax-bnodes-04.rq
- Approved
- syntax-bnodes-05.rq
- Approved
- syntax-bnodes-06.rq
- Approved
- syntax-bnodes-07.rq
- Approved
- syntax-expr-01.rq
- Approved
- syntax-expr-02.rq
- Approved
- syntax-expr-03.rq
- Approved
- syntax-expr-04.rq
- Approved
- syntax-expr-05.rq
- Approved
- syntax-expr-06.rq
- Approved
- syntax-forms-01.rq
- Approved
- syntax-forms-02.rq
- Approved
- syntax-limit-offset-07.rq
- Approved
- syntax-limit-offset-08.rq
- Approved
- syntax-limit-offset-09.rq
- Approved
- syntax-lists-01.rq
- Approved
- syntax-lists-02.rq
- Approved
- syntax-lists-03.rq
- Approved
- syntax-lists-04.rq
- Approved
- syntax-lists-05.rq
- Approved
- syntax-lit-01.rq
- Approved
- syntax-lit-02.rq
- Approved
- syntax-lit-03.rq
- Approved
- syntax-lit-04.rq
- Approved
- syntax-lit-05.rq
- Approved
- syntax-lit-06.rq
- Approved
- syntax-lit-07.rq
- Approved
- syntax-lit-08.rq
- Approved
- syntax-lit-09.rq
- Approved
- syntax-lit-10.rq
- Approved
- syntax-lit-11.rq
- Approved
- syntax-lit-12.rq
- Approved
- syntax-lit-13.rq
- Approved
- syntax-lit-14.rq
- Approved
- syntax-lit-15.rq
- syntax-lit-16.rq
- syntax-lit-17.rq
- syntax-lit-18.rq
- syntax-lit-19.rq
- syntax-lit-20.rq
- syntax-order-01.rq
- Approved
- syntax-order-02.rq
- Approved
- syntax-order-03.rq
- Approved
- syntax-order-04.rq
- Approved
- syntax-order-05.rq
- Approved
- syntax-order-06.rq
- Approved
- syntax-pat-01.rq
- Approved
- syntax-pat-02.rq
- Approved
- syntax-pat-03.rq
- Approved
- syntax-pat-04.rq
- Approved
- syntax-qname-07.rq
- Approved
- syntax-qname-08.rq
- Approved
- syntax-qname-09.rq
- Approved
- syntax-qname-10.rq
- Approved
- syntax-qname-11.rq
- Approved
- syntax-qname-12.rq
- Approved
- syntax-qname-13.rq
- Approved
- syntax-qname-14.rq
- Approved
- syntax-struct-01.rq
- Approved
- syntax-struct-02.rq
- Approved
- syntax-struct-03.rq
- Approved
- syntax-struct-04.rq
- Approved
- syntax-struct-05.rq
- Approved
- syntax-struct-06.rq
- Approved
- syntax-struct-07.rq
- Approved
- syntax-struct-08.rq
- Approved
- syntax-struct-09.rq
- Approved
- syntax-struct-10.rq
- Approved
- syntax-union-01.rq
- Approved
- syntax-union-02.rq
- Approved
- keyword FILTER as a namespace prefix
- keyword FILTER as a local name
- keyword UNION as a namespace prefix
- syntax-001
- Syntax: using ? for variables in triple patterns 
- syntax-002
- Syntax: using $ for variables in triple patterns 
- syntax-003
- Syntax: using $ and ? for variables in triple patterns 
- syntax-004
- Syntax: using . in qname of triple pattern 
- tP-double-double
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-double-float
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-double-decimal
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-float-float
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-float-decimal
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-decimal-decimal
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-integer-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-nonPositiveInteger-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-negativeInteger-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-long-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-int-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-byte-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-nonNegativeInteger-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-unsignedLong-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-unsignedInt-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-unsignedShort-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-unsignedByte-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-positiveInteger-short
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-double
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-float
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-decimal
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-short-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-byte-short-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-long-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-int-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-short-byte-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-double-float-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-double-decimal-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- tP-float-decimal-fail
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- dawg-unsaid-001
- Inference test from http://lists.w3.org/Archives/Public/public-rdf-dawg/2004OctDec/0538.html 
- dawg-unsaid-002
- UNSAID test from http://lists.w3.org/Archives/Public/public-rdf-dawg/2004OctDec/0538.html 
- dawg-unsaid-003
- UNSAID test from http://lists.w3.org/Archives/Public/public-rdf-dawg/2004OctDec/0538.html expressed as an ASK 
- extendedType-eq-pass
- Approved
- Only extended types with identical lexical and datatypes can be tested for = . 
- extendedType-ne-fail
- Approved
- Opaque types can not be tested for != . 
- extendedType-literal-eq
- NotApproved
- Test FILTER match on extended type. 
- extendedType-literal-ne
- NotApproved
- Test FILTER negative match on extended type. 
- extendedType-graph
- NotApproved
- Test graph match on extended type. 
- typePromotion-decimal-decimal-pass
- NotApproved
- Positive test: product of type promotion within the xsd:decimal type tree. 
- typePromotion-decimal-decimal-fail [negative]
- NotApproved
- Negative test: product of type promotion within the xsd:decimal type tree. 
- boolean-equiv-FALSE
- Approved
- false^^xsd:boolean = 0^^xsd:boolean . 
- boolean-equiv-TRUE
- Approved
- true^^xsd:boolean = 1^^xsd:boolean . 
- boolean-equiv-xsdType
- Approved
- T=T T=1 1=T 1=1 F=F F=0 0=F 0=0 . 
- boolean-logical-OR
- Approved
- Result of func-logical-or is the same term as xsd:boolean true. 
- boolean-false-canonical
- Approved
- Graph match on the canonical lexical form of FALSE. 
- boolean-true-canonical
- Approved
- Graph match on the canonical lexical form of TRUE. 
- boolean-EBV-canonical
- Approved
- = match on the canonical lexical result of an EBV. 
- xsd-string-lt
- FILTER with < on xsd:string 
- xsd-string-gt
- FILTER with > on xsd:string 
    
    
    Simple triple match
    Data
    
      data/simple/data-01.n3
    
    @prefix : <http://example.org/data/> .
:x :p :v1 .
:x :p :v2 .
    Query
      data/simple/dawg-tp-01.rq
    PREFIX : <http://example.org/data/>
SELECT *
WHERE { :x ?p ?q . }
    Results
    data/simple/result-tp-01.n3
    
      
        | q | p | 
|---|
      | <http://example.org/data/v1> | <http://example.org/data/p> | 
      | <http://example.org/data/v2> | <http://example.org/data/p> | 
      
    
    
    
    Simple triple match
    Data
    
      data/simple/data-01.n3
    
    @prefix : <http://example.org/data/> .
:x :p :v1 .
:x :p :v2 .
    Query
      data/simple/dawg-tp-02.rq
    PREFIX : <http://example.org/data/>
SELECT *
WHERE { ?x :p ?q . }
    Results
    data/simple/result-tp-02.n3
    
      
        | x | q | 
|---|
      | <http://example.org/data/x> | <http://example.org/data/v1> | 
      | <http://example.org/data/x> | <http://example.org/data/v2> | 
      
    
    
    
    Simple triple match - repeated variable
    Data
    
      data/simple/data-02.n3
    
    @prefix : <http://example.org/data/> .
:y :y :x .
:x :y :y .
:y :x :y .
    Query
      data/simple/dawg-tp-03.rq
    SELECT *
WHERE { ?a ?a ?b . }
    Results
    data/simple/result-tp-03.n3
    
      
        | b | a | 
|---|
      | <http://example.org/data/x> | <http://example.org/data/y> | 
      
    
    
    
    Simple triple match - two triples, common variable
    Data
    
      data/simple/dawg-data-01.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <fred@edu> .
    Query
      data/simple/dawg-tp-04.rq
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE {
  ?x rdf:type foaf:Person .
  ?x foaf:name ?name .
}
    Results
    data/simple/result-tp-04.n3
    
    
    Blank node in the predicate position
    Data
    
      data/BasicGraphPatterns/data-2.ttl
    
    @prefix :           <http://example/> .
:x :p 1 .
    Query
      data/BasicGraphPatterns/q-bnode-match-01.rq
    PREFIX :           <http://example/>
SELECT ?v { :x _:a ?v }
    Results
    data/BasicGraphPatterns/r-bnode-match-01.ttl
    
    
    Query results must maintain bnode co-references in the dataset
    Data
    
      data/BNodes/data.ttl
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <fred@edu> .
    Query
      data/BNodes/query.rq
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?x ?y
WHERE {
  ?x foaf:knows ?y .
}
    Results
    data/BNodes/result.ttl
    
      
        | y | x | 
|---|
      | <_:b21.4069c> | <_:b20.4069c> | 
      | <_:b10.4069c> | <_:b1f.4069c> | 
      | <_:b1f.4069c> | <_:b10.4069c> | 
      
    
    
    BOUND test case.
    Data
    
      data/bound/data.n3
    
    @prefix : <http://example.org/ns#> .
:a1 :b :c1 .
:c1 :d :e .
:a2 :b :c2 .
:c2 :b :f .
    Query
      data/bound/bound1.rq
    PREFIX  : <http://example.org/ns#>
SELECT  ?a ?c
WHERE
    { ?a :b ?c .
      OPTIONAL
        { ?c :d ?e } .
      FILTER (! bound(?e))
    }
    Results
    data/bound/bound1-result.n3
    
      
        | c | a | 
|---|
      | <http://example.org/ns#c2> | <http://example.org/ns#a2> | 
      | <http://example.org/ns#f> | <http://example.org/ns#c2> | 
      
    
    
    Data
    
      data/BuiltInProperties/data.ttl
    
    @prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix   :         <http://example.org/> .
:list1 :p (0 1 2 ) .
:list2 :p (2 3) .
:list3 :p () .
:bag1 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:bag2 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:alt1 :alt [ a rdf:Alt ;
          rdf:_1   1 ;
          rdf:_2   22 ;
        ] .
:seq1 :seq [ a rdf:Seq ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_3   3 ;
          rdf:_10   10 ;
        ] .
# Not a container of any kind - no type.
:x8 :bag [ rdf:_1   1 ;
           rdf:_2   9 ;
          ] .
    Query
      data/BuiltInProperties/list-1.rq
    PREFIX  list:  <http://jena.hpl.hp.com/ARQ/list#>
PREFIX  :      <http://example.org/>
SELECT ?x ?member
{ ?x :p ?list .
  ?list list:member ?member .
}
    Results
    data/BuiltInProperties/list-results-1.srx
    
    Data
    
      data/BuiltInProperties/data.ttl
    
    @prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix   :         <http://example.org/> .
:list1 :p (0 1 2 ) .
:list2 :p (2 3) .
:list3 :p () .
:bag1 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:bag2 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:alt1 :alt [ a rdf:Alt ;
          rdf:_1   1 ;
          rdf:_2   22 ;
        ] .
:seq1 :seq [ a rdf:Seq ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_3   3 ;
          rdf:_10   10 ;
        ] .
# Not a container of any kind - no type.
:x8 :bag [ rdf:_1   1 ;
           rdf:_2   9 ;
          ] .
    Query
      data/BuiltInProperties/list-1.rq
    PREFIX  list:  <http://jena.hpl.hp.com/ARQ/list#>
PREFIX  :      <http://example.org/>
SELECT ?x ?member
{ ?x :p ?list .
  ?list list:member ?member .
}
    Results
    data/BuiltInProperties/list-results-1.srx
    
    Data
    
      data/BuiltInProperties/data.ttl
    
    @prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix   :         <http://example.org/> .
:list1 :p (0 1 2 ) .
:list2 :p (2 3) .
:list3 :p () .
:bag1 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:bag2 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:alt1 :alt [ a rdf:Alt ;
          rdf:_1   1 ;
          rdf:_2   22 ;
        ] .
:seq1 :seq [ a rdf:Seq ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_3   3 ;
          rdf:_10   10 ;
        ] .
# Not a container of any kind - no type.
:x8 :bag [ rdf:_1   1 ;
           rdf:_2   9 ;
          ] .
    Query
      data/BuiltInProperties/list-2.rq
    PREFIX  list:  <http://jena.hpl.hp.com/ARQ/list#>
PREFIX  :      <http://example.org/>
SELECT ?x
{ ?x :p ?list .
  ?list list:member 1 .
}
    Results
    data/BuiltInProperties/list-results-2.srx
    
    Data
    
      data/BuiltInProperties/data.ttl
    
    @prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix   :         <http://example.org/> .
:list1 :p (0 1 2 ) .
:list2 :p (2 3) .
:list3 :p () .
:bag1 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:bag2 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:alt1 :alt [ a rdf:Alt ;
          rdf:_1   1 ;
          rdf:_2   22 ;
        ] .
:seq1 :seq [ a rdf:Seq ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_3   3 ;
          rdf:_10   10 ;
        ] .
# Not a container of any kind - no type.
:x8 :bag [ rdf:_1   1 ;
           rdf:_2   9 ;
          ] .
    Query
      data/BuiltInProperties/container-1.rq
    PREFIX  rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  :       <http://example/>
SELECT ?x ?m
{ ?x ?p ?bag .
  ?bag a rdf:Bag .
  ?bag rdfs:member ?m
}
    Results
    data/BuiltInProperties/container-results-1.srx
    
    Data
    
      data/BuiltInProperties/data.ttl
    
    @prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix   :         <http://example.org/> .
:list1 :p (0 1 2 ) .
:list2 :p (2 3) .
:list3 :p () .
:bag1 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:bag2 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:alt1 :alt [ a rdf:Alt ;
          rdf:_1   1 ;
          rdf:_2   22 ;
        ] .
:seq1 :seq [ a rdf:Seq ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_3   3 ;
          rdf:_10   10 ;
        ] .
# Not a container of any kind - no type.
:x8 :bag [ rdf:_1   1 ;
           rdf:_2   9 ;
          ] .
    Query
      data/BuiltInProperties/container-2.rq
    PREFIX  rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  :       <http://example/>
SELECT ?x
{ ?x ?p ?any .
  ?any rdfs:member 2
}
    Results
    data/BuiltInProperties/container-results-2.srx
    
    Data
    
      data/BuiltInProperties/data.ttl
    
    @prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix   :         <http://example.org/> .
:list1 :p (0 1 2 ) .
:list2 :p (2 3) .
:list3 :p () .
:bag1 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:bag2 :bag [ a rdf:Bag ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_5   2 ;
        ] .
:alt1 :alt [ a rdf:Alt ;
          rdf:_1   1 ;
          rdf:_2   22 ;
        ] .
:seq1 :seq [ a rdf:Seq ;
          rdf:_1   1 ;
          rdf:_2   2 ;
          rdf:_3   3 ;
          rdf:_10   10 ;
        ] .
# Not a container of any kind - no type.
:x8 :bag [ rdf:_1   1 ;
           rdf:_2   9 ;
          ] .
    Query
      data/BuiltInProperties/seq-1.rq
    # Sequence in order
PREFIX  rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  :       <http://example.org/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
PREFIX  jfn:    <java:com.hp.hpl.jena.query.function.library.>
SELECT ?p ?member  WHERE
  {
     ?x :seq ?seq .
     ?seq ?p ?member .
     FILTER ( regex (str(?p), "#_\\d+$") )
  }
ORDER BY xsd:integer(
           jfn:substring(
             str(?p),
             jfn:strlen(str(rdf:)) + 1  # The number after "_"
         ))
    Results
    data/BuiltInProperties/seq-results-1.srx
    
    Graph equivalent result graph
    Data
    
      data/Construct/data-ident.ttl
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
    Query
      data/Construct/query-ident.rq
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  foaf:       <http://xmlns.com/foaf/0.1/>
CONSTRUCT { ?s ?p ?o . }
WHERE {
  ?s ?p ?o .
}
    Results
    data/Construct/result-ident.ttl
    
    Result subgraph of original graph
    Data
    
      data/Construct/data-ident.ttl
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
    Query
      data/Construct/query-subgraph.rq
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  foaf:       <http://xmlns.com/foaf/0.1/>
CONSTRUCT { ?s foaf:name ?o . }
WHERE {
  ?s foaf:name ?o .
}
    Results
    data/Construct/result-subgraph.ttl
    
    Reification of the dataset
    Data
    
      data/Construct/data-reif.ttl
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@home> ;
    .
    Query
      data/Construct/query-reif.rq
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  foaf:       <http://xmlns.com/foaf/0.1/>
CONSTRUCT { [ rdf:subject ?s ;
              rdf:predicate ?p ;
              rdf:object ?o ] . }
WHERE {
  ?s ?p ?o .
}
    Results
    data/Construct/result-reif.ttl
    
    Data
    
      data/Distinct/data-1.ttl
    
    @prefix :         <http://example/> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .
:x1 :p1i 1 .
:x2 :p1i +1 .
:x3 :p1i "01"^^xsd:integer .
:y1 :p1d 1.0 .
:y2 :p1d +1.0 .
:y3 :p1d "01.0"^^xsd:decimal .
:z1 :p13 1.3 .
:z2 :p13 1.3e0 .
:z4 :p13 +1.3e0 .
:z5 :p13 "1.3e0"^^xsd:float .
    Query
      data/Distinct/distinct-1.rq
    PREFIX :      <http://example/>
PREFIX xsd:   <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?v
{
    ?x ?p ?v .
}
    Results
    data/Distinct/distinct-1-results.srx
    
    
    Example from section 2.1
    Data
    
      data/examples/ex2-1a.n3
    
    <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> "SPARQL Tutorial" .
    Query
      data/examples/ex2-1a.rq
    SELECT  ?title
WHERE
    { <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title }
    Results
    data/examples/ex2-1a-result.n3
    
    
    
    Example from section 2.3
    Data
    
      data/examples/ex2-2a.n3
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
rdf:type rdf:type rdf:Property .
    Query
      data/examples/ex2-2a.rq
    SELECT  *
WHERE
    { ?x ?x ?v }
    Results
    data/examples/ex2-2a-result.n3
    
      
        | x | v | 
|---|
      | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> | 
      
    
    
    
    Example from section 2.4
    Data
    
      data/examples/ex2-3a.n3
    
    @prefix foaf:    <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name   "Johnny Lee Outlaw" .
_:a  foaf:mbox   <mailto:jlow@example.com> .
    Query
      data/examples/ex2-3a.rq
    PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
SELECT  ?mbox
WHERE
    { ?x foaf:name "Johnny Lee Outlaw" .
      ?x foaf:mbox ?mbox .
    }
    Results
    data/examples/ex2-3a-result.n3
    
      
        | mbox | 
|---|
      | <mailto:jlow@example.com> | 
      
    
    
    
    Example from section 2.5
    Data
    
      data/examples/ex2-4a.n3
    
    @prefix foaf:  <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name   "Johnny Lee Outlaw" .
_:a  foaf:mbox   <mailto:jlow@example.com> .
_:b  foaf:name   "Peter Goodguy" .
_:b  foaf:mbox   <mailto:peter@example.org> .
    Query
      data/examples/ex2-4a.rq
    PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
SELECT  ?name ?mbox
WHERE
    { ?x foaf:name ?name .
      ?x foaf:mbox ?mbox .
    }
    Results
    data/examples/ex2-4a-result.n3
    
      
        | name | mbox | 
|---|
      | "Johnny Lee Outlaw" | <mailto:jlow@example.com> | 
      | "Peter Goodguy" | <mailto:peter@example.org> | 
      
    
    
    Example from section 3
    Data
    
      data/examples/ex3.n3
    
    @prefix dc:   <http://purl.org/dc/elements/1.1/> .
@prefix :     <http://example.org/book/> .
@prefix ns:   <http://example.org/ns#> .
:book1  dc:title  "SPARQL Tutorial" .
:book1  ns:price  42 .
:book2  dc:title  "The Semantic Web" .
:book2  ns:price  23 .
    Query
      data/examples/ex3.rq
    PREFIX  dc: <http://purl.org/dc/elements/1.1/>
PREFIX  ns: <http://example.org/ns#>
SELECT  ?title ?price
WHERE
    { ?x ns:price ?price .
      FILTER ( ?price < 30 ) .
      ?x dc:title ?title .
    }
    Results
    data/examples/ex3-result.n3
    
      
        | price | title | 
|---|
      | "23" | "The Semantic Web" | 
      
    
    
    Example from section 11
    Data
    
      data/examples/ex11_0.n3
    
    @prefix a:          <http://www.w3.org/2000/10/annotation-ns#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
_:a   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:a   dc:created    "2004-12-31T18:00:00-05:00" .
_:b   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:b   dc:created    "2004-12-31T18:01:00-05:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
    Query
      data/examples/ex11_0.rq
    PREFIX a:      <http://www.w3.org/2000/10/annotation-ns#>
PREFIX dc:     <http://purl.org/dc/elements/1.1/>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?annot
WHERE { ?annot  a:annotates  <http://www.w3.org/TR/rdf-sparql-query/> .
        ?annot  dc:created   ?date .
        FILTER ( ?date < xsd:dateTime("2005-01-01T00:00:00Z") ) }
    Results
    data/examples/ex11_0-result.n3
    
    
    2nd Example from section 11
    Data
    
      data/examples/ex11_0.n3
    
    @prefix a:          <http://www.w3.org/2000/10/annotation-ns#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
_:a   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:a   dc:created    "2004-12-31T18:00:00-05:00" .
_:b   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:b   dc:created    "2004-12-31T18:01:00-05:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
    Query
      data/examples/ex11_1.rq
    PREFIX a:      <http://www.w3.org/2000/10/annotation-ns#>
PREFIX dc:     <http://purl.org/dc/elements/1.1/>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?annot
WHERE { ?annot  a:annotates  <http://www.w3.org/TR/rdf-sparql-query/> .
        ?annot  dc:created   ?date .
        FILTER ( xsd:dateTime(?date) < xsd:dateTime("2005-01-01T00:00:00Z") )
      }
    Results
    data/examples/ex11_1-result.n3
    
      
        | annot | 
|---|
      | <_:b.ae12> | 
      | <_:a.ae12> | 
      
    
    
    Example from section 11.2.3.1
    Data
    
      data/examples/ex11.2.3.1_0.n3
    
    @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#> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Ms A.".
_:b  foaf:mbox       <mailto:alice@work.example> .
    Query
      data/examples/ex11.2.3.1_0.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name1 ?name2
 WHERE { ?x foaf:name  ?name1 ;
            foaf:mbox  ?mbox1 .
         ?y foaf:name  ?name2 ;
            foaf:mbox  ?mbox2 .
         FILTER ( ?mbox1 = ?mbox2 && ?name1 != ?name2 )
       }
    Results
    data/examples/ex11.2.3.1_0-result.n3
    
      
        | name1 | name2 | 
|---|
      | "Alice" | "Ms A." | 
      | "Ms A." | "Alice" | 
      
    
    
    2nd Example from section 11.2.3.1
    Data
    
      data/examples/ex11.2.3.1_1.n3
    
    @prefix a:          <http://www.w3.org/2000/10/annotation-ns#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
_:b   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:b   dc:created    "2004-12-31T19:00:00-05:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
    Query
      data/examples/ex11.2.3.1_1.rq
    PREFIX a:      <http://www.w3.org/2000/10/annotation-ns#>
PREFIX dc:     <http://purl.org/dc/elements/1.1/>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?annotates
WHERE { ?annot  a:annotates  ?annotates .
        ?annot  dc:created   ?date .
        FILTER ( ?date = xsd:dateTime("2004-01-01T00:00:00Z") || ?date = xsd:dateTime("2005-01-01T00:00:00Z") ) }
    Results
    data/examples/ex11.2.3.1_1-result.n3
    
      
        | annotates | 
|---|
      | <http://www.w3.org/TR/rdf-sparql-query/> | 
      
    
    
    Example from section 11.2.3.2
    Data
    
      data/examples/ex11.2.3.2_0.n3
    
    @prefix foaf:        <http://xmlns.com/foaf/0.1/> .
@prefix dc:          <http://purl.org/dc/elements/1.1/> .
@prefix xs:          <http://www.w3.org/2001/XMLSchema#> .
_:a  foaf:name       "Alice".
_:b  foaf:givenName  "Bob" .
_:b  dc:created      "2005-04-04T04:04:04Z"^^xs:dateTime .
    Query
      data/examples/ex11.2.3.2_0.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>
SELECT ?name ?givenName
 WHERE { { ?x foaf:name  ?name } UNION { ?x foaf:givenName ?givenName; dc:created ?created } .
         FILTER ( bound(?name) || ?created < "2005-01-01T00:00:00Z" ) }
    Results
    data/examples/ex11.2.3.2_0-result.n3
    
    
    2nd Example from section 11.2.3.2
    Data
    
      data/examples/ex11.2.3.2_0.n3
    
    @prefix foaf:        <http://xmlns.com/foaf/0.1/> .
@prefix dc:          <http://purl.org/dc/elements/1.1/> .
@prefix xs:          <http://www.w3.org/2001/XMLSchema#> .
_:a  foaf:name       "Alice".
_:b  foaf:givenName  "Bob" .
_:b  dc:created      "2005-04-04T04:04:04Z"^^xs:dateTime .
    Query
      data/examples/ex11.2.3.2_1.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>
SELECT ?name
 WHERE { ?x foaf:name  ?name .
         OPTIONAL { ?x dc:created ?created } .
         FILTER ( !bound(?created)) }
    Results
    data/examples/ex11.2.3.2_1-result.n3
    
    
    Example from section 11.2.3.3
    Data
    
      data/examples/ex11.2.3.3_0.n3
    
    @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#> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       "bob@work.example" .
    Query
      data/examples/ex11.2.3.3_0.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
            foaf:mbox  ?mbox .
         FILTER isUri(?mbox) }
    Results
    data/examples/ex11.2.3.3_0-result.n3
    
      
        | name | mbox | 
|---|
      | "Alice" | <mailto:alice@work.example> | 
      
    
    
    Example from section 11.2.3.4
    Data
    
      data/examples/ex11.2.3.4_0.n3
    
    @prefix a:          <http://www.w3.org/2000/10/annotation-ns#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:a   dc:creator    "Alice B. Toeclips" .
_:b   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:b   dc:creator    _:c .
_:c   foaf:given    "Bob".
_:c   foaf:family   "Smith".
    Query
      data/examples/ex11.2.3.4_0.rq
    PREFIX a:      <http://www.w3.org/2000/10/annotation-ns#>
PREFIX dc:     <http://purl.org/dc/elements/1.1/>
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?given ?family
 WHERE { ?annot  a:annotates  <http://www.w3.org/TR/rdf-sparql-query/> .
         ?annot  dc:creator   ?c .
         OPTIONAL { ?c  foaf:given   ?given ; foaf:family  ?family } .
         FILTER isBlank(?c)
       }
    Results
    data/examples/ex11.2.3.4_0-result.n3
    
    
    Example from section 11.2.3.5
    Data
    
      data/examples/ex11.2.3.5_0.n3
    
    @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#> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       "bob@work.example" .
    Query
      data/examples/ex11.2.3.5_0.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
           foaf:mbox  ?mbox .
         FILTER isLiteral(?mbox) }
    Results
    data/examples/ex11.2.3.5_0-result.n3
    
      
        | mbox | name | 
|---|
      | "bob@work.example" | "Bob" | 
      
    
    
    Example from section 11.2.3.6
    Data
    
      data/examples/ex11.2.3.6_0.n3
    
    @prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       <mailto:bob@home.example> .
    Query
      data/examples/ex11.2.3.6_0.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
            foaf:mbox  ?mbox .
         FILTER regex(str(?mbox), "@work.example") }
    Results
    data/examples/ex11.2.3.6_0-result.n3
    
      
        | mbox | name | 
|---|
      | <mailto:alice@work.example> | "Alice" | 
      
    
    
    Example from section 11.2.3.7
    Data
    
      data/examples/ex11.2.3.7_0.n3
    
    @prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
_:a  foaf:name       "Robert"@EN.
_:a  foaf:name       "Roberto"@ES.
_:a  foaf:mbox       <mailto:bob@work.example> .
    Query
      data/examples/ex11.2.3.7_0.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
            foaf:mbox  ?mbox .
         FILTER ( lang(?name) = "ES" ) }
    Results
    data/examples/ex11.2.3.7_0-result.n3
    
      
        | mbox | name | 
|---|
      | <mailto:bob@work.example> | "Roberto" | 
      
    
    
    Data
    
      data/Expr1/data-1.ttl
    
    @prefix x: <http://example.org/ns#> .
@prefix : <http://example.org/books#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
:book1 dc:title "TITLE 1" .
:book1 x:price  10 .
:book2 dc:title "TITLE 2" .
:book2 x:price  20 .
:book3 dc:title "TITLE 3" .
    Query
      data/Expr1/expr-1.rq
    PREFIX  dc: <http://purl.org/dc/elements/1.1/>
PREFIX  x: <http://example.org/ns#>
SELECT  ?title ?price
WHERE
    { ?book dc:title ?title .
      OPTIONAL
        { ?book x:price ?price .
          FILTER (?price < 15) .
        } .
    }
    Results
    data/Expr1/expr-1-result.ttl
    
      
        | price | title | 
|---|
      |  | "TITLE 2" | 
      |  | "TITLE 3" | 
      | "10" | "TITLE 1" | 
      
    
    
    Data
    
      data/Expr1/data-1.ttl
    
    @prefix x: <http://example.org/ns#> .
@prefix : <http://example.org/books#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
:book1 dc:title "TITLE 1" .
:book1 x:price  10 .
:book2 dc:title "TITLE 2" .
:book2 x:price  20 .
:book3 dc:title "TITLE 3" .
    Query
      data/Expr1/expr-2.rq
    PREFIX  dc: <http://purl.org/dc/elements/1.1/>
PREFIX  x: <http://example.org/ns#>
SELECT  ?title ?price
WHERE
    { ?book dc:title ?title .
      OPTIONAL
        { ?book x:price ?price } .
      FILTER (?price < 15)  .
    }
    Results
    data/Expr1/expr-2-result.ttl
    
    
    Data
    
      data/Expr1/data-1.ttl
    
    @prefix x: <http://example.org/ns#> .
@prefix : <http://example.org/books#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
:book1 dc:title "TITLE 1" .
:book1 x:price  10 .
:book2 dc:title "TITLE 2" .
:book2 x:price  20 .
:book3 dc:title "TITLE 3" .
    Query
      data/Expr1/expr-3.rq
    PREFIX  dc: <http://purl.org/dc/elements/1.1/>
PREFIX  x: <http://example.org/ns#>
SELECT  ?title ?price
WHERE
    { ?book dc:title ?title .
      OPTIONAL
        { ?book x:price ?price } .
      FILTER ( ( ! bound(?price) ) || ( ?price < 15 ) ) .
    }
    Results
    data/Expr1/expr-3-result.ttl
    
      
        | price | title | 
|---|
      | "10" | "TITLE 1" | 
      |  | "TITLE 3" | 
      
    
    
    Data
    
      data/Expr2/data-1.ttl
    
    @prefix : <http://example.org/ns#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
# These object values are true by the boolean effective value rule.
:x1 :p    1 .
:x2 :p    "foo" .
:x3 :p    "0.01"^^xsd:double .
:x4 :p    "true"^^xsd:boolean .
# These are false
:y1 :p    0 .
:y2 :p    "0.0"^^xsd:double .
:y3 :p    "" .
:y4 :p    "false"^^xsd:boolean .
    Query
      data/Expr2/query-bev-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/ns#>
SELECT  ?a
WHERE
    { ?a :p ?v .
      FILTER (?v) .
    }
    Results
    data/Expr2/result-bev-1.ttl
    
      
        | a | 
|---|
      | <http://example.org/ns#x2> | 
      | <http://example.org/ns#x3> | 
      | <http://example.org/ns#x1> | 
      | <http://example.org/ns#x4> | 
      
    
    
    Data
    
      data/Expr2/data-1.ttl
    
    @prefix : <http://example.org/ns#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
# These object values are true by the boolean effective value rule.
:x1 :p    1 .
:x2 :p    "foo" .
:x3 :p    "0.01"^^xsd:double .
:x4 :p    "true"^^xsd:boolean .
# These are false
:y1 :p    0 .
:y2 :p    "0.0"^^xsd:double .
:y3 :p    "" .
:y4 :p    "false"^^xsd:boolean .
    Query
      data/Expr2/query-bev-2.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/ns#>
SELECT  ?a
WHERE
    { ?a :p ?v .
      FILTER ( ! ?v ) .
    }
    Results
    data/Expr2/result-bev-2.ttl
    
      
        | a | 
|---|
      | <http://example.org/ns#y1> | 
      | <http://example.org/ns#y3> | 
      | <http://example.org/ns#y4> | 
      | <http://example.org/ns#y2> | 
      
    
    
    Data
    
      data/Expr2/data-1.ttl
    
    @prefix : <http://example.org/ns#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
# These object values are true by the boolean effective value rule.
:x1 :p    1 .
:x2 :p    "foo" .
:x3 :p    "0.01"^^xsd:double .
:x4 :p    "true"^^xsd:boolean .
# These are false
:y1 :p    0 .
:y2 :p    "0.0"^^xsd:double .
:y3 :p    "" .
:y4 :p    "false"^^xsd:boolean .
    Query
      data/Expr2/query-bev-3.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/ns#>
SELECT  ?a
WHERE
    { ?a :p ?v .
      FILTER ("true"^^xsd:boolean && ?v) .
    }
    Results
    data/Expr2/result-bev-3.ttl
    
      
        | a | 
|---|
      | <http://example.org/ns#x2> | 
      | <http://example.org/ns#x3> | 
      | <http://example.org/ns#x1> | 
      | <http://example.org/ns#x4> | 
      
    
    
    Data
    
      data/Expr2/data-1.ttl
    
    @prefix : <http://example.org/ns#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
# These object values are true by the boolean effective value rule.
:x1 :p    1 .
:x2 :p    "foo" .
:x3 :p    "0.01"^^xsd:double .
:x4 :p    "true"^^xsd:boolean .
# These are false
:y1 :p    0 .
:y2 :p    "0.0"^^xsd:double .
:y3 :p    "" .
:y4 :p    "false"^^xsd:boolean .
    Query
      data/Expr2/query-bev-4.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/ns#>
SELECT  ?a
WHERE
    { ?a :p ?v .
      FILTER ("false"^^xsd:boolean || ?v) .
    }
    Results
    data/Expr2/result-bev-4.ttl
    
      
        | a | 
|---|
      | <http://example.org/ns#x3> | 
      | <http://example.org/ns#x4> | 
      | <http://example.org/ns#x2> | 
      | <http://example.org/ns#x1> | 
      
    
    
    Data
    
      data/Expr2/data-2.ttl
    
    @prefix : <http://example.org/ns#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
# These object values are true by the boolean effective value rule.
:x1 :p    1 .
:x2 :p    "foo" .
:x3 :p    "0.01"^^xsd:double .
:x4 :p    "true"^^xsd:boolean .
# These are false
:y1 :p    0 .
:y2 :p    "0.0"^^xsd:double .
:y3 :p    "" .
:y4 :p    "false"^^xsd:boolean .
# Optionals
:x1 :q    "true"^^xsd:boolean .
:x2 :q    "false"^^xsd:boolean .
:x3 :q    "foo"^^:unknown .
    Query
      data/Expr2/query-bev-5.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/ns#>
SELECT  ?a
WHERE
    { ?a :p ?v .
      OPTIONAL
        { ?a :q ?w } .
      FILTER (?w) .
    }
    Results
    data/Expr2/result-bev-5.ttl
    
      
        | a | 
|---|
      | <http://example.org/ns#x1> | 
      
    
    
    Data
    
      data/Expr2/data-2.ttl
    
    @prefix : <http://example.org/ns#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
# These object values are true by the boolean effective value rule.
:x1 :p    1 .
:x2 :p    "foo" .
:x3 :p    "0.01"^^xsd:double .
:x4 :p    "true"^^xsd:boolean .
# These are false
:y1 :p    0 .
:y2 :p    "0.0"^^xsd:double .
:y3 :p    "" .
:y4 :p    "false"^^xsd:boolean .
# Optionals
:x1 :q    "true"^^xsd:boolean .
:x2 :q    "false"^^xsd:boolean .
:x3 :q    "foo"^^:unknown .
    Query
      data/Expr2/query-bev-6.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/ns#>
SELECT  ?a ?w
WHERE
    { ?a :p ?v .
      OPTIONAL
        { ?a :q ?w } .
      FILTER ( ! ?w ) .
    }
    Results
    data/Expr2/result-bev-6.ttl
    
      
        | a | w | 
|---|
      | <http://example.org/ns#x2> | "false" | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-str-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER ( str(?v) = "1" ) .
    }
    Results
    data/ExprBuiltins/result-str-1.ttl
    
      
        | x | v | 
|---|
      | <http://example.org/things#xd3> | "1" | 
      | <http://example.org/things#xp2> | "1" | 
      | <http://example.org/things#xi2> | "1" | 
      | <http://example.org/things#xi1> | "1" | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-str-2.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER ( str(?v) = "01" ) .
    }
    Results
    data/ExprBuiltins/result-str-2.ttl
    
      
        | v | x | 
|---|
      | "1" | <http://example.org/things#xi3> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-str-3.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER ( str(?v) = "zzz" ) .
    }
    Results
    data/ExprBuiltins/result-str-3.ttl
    
      
        | v | x | 
|---|
      | "zzz" | <http://example.org/things#xp1> | 
      | "zzz" | <http://example.org/things#xt1> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-str-4.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER ( str(?v) = ""  ) .
    }
    Results
    data/ExprBuiltins/result-str-4.ttl
    
      
        | v | x | 
|---|
      | "" | <http://example.org/things#xp2> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-blank-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER isBlank(?v) .
    }
    Results
    data/ExprBuiltins/result-blank-1.ttl
    
      
        | v | x | 
|---|
      | <_:genid3.43fdd> | <http://example.org/things#xb> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-datatype-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER ( datatype(?v) = xsd:double ) .
    }
    Results
    data/ExprBuiltins/result-datatype-1.ttl
    
      
        | x | v | 
|---|
      | <http://example.org/things#xd1> | "1.0e0" | 
      | <http://example.org/things#xd3> | "1" | 
      | <http://example.org/things#xd2> | "1.0" | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-2.ttl
    
    @prefix : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p  "string" .
:x2 :p  "string"^^xsd:string .
:x3 :p  "string"@en .
:x4 :p  "lex"^^:unknownType .
:x5 :p  1234 .
:x6 :p  <http://example/iri> .
:x7 :p  _:bNode .
    Query
      data/ExprBuiltins/q-datatype-2.rq
    # Which literals have a datatype and which are errors.
PREFIX : <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x
{ ?x :p ?v .
  FILTER(  datatype(?v) != <http://example/NotADataTypeIRI> )
}
ORDER BY ?x
    Results
    data/ExprBuiltins/result-datatype-2.srx
    
    Data
    
      data/ExprBuiltins/data-builtin-2.ttl
    
    @prefix : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p  "string" .
:x2 :p  "string"^^xsd:string .
:x3 :p  "string"@en .
:x4 :p  "lex"^^:unknownType .
:x5 :p  1234 .
:x6 :p  <http://example/iri> .
:x7 :p  _:bNode .
    Query
      data/ExprBuiltins/q-datatype-3.rq
    # Whichliterals have xsd:string as a datatype
PREFIX : <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x
{ ?x :p ?v .
  FILTER( datatype(?v) = xsd:string )
}
ORDER BY ?x
    Results
    data/ExprBuiltins/result-datatype-3.srx
    
    Data
    
      data/ExprBuiltins/data-builtin-2.ttl
    
    @prefix : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p  "string" .
:x2 :p  "string"^^xsd:string .
:x3 :p  "string"@en .
:x4 :p  "lex"^^:unknownType .
:x5 :p  1234 .
:x6 :p  <http://example/iri> .
:x7 :p  _:bNode .
    Query
      data/ExprBuiltins/q-lang-1.rq
    # Test which things have a lang tag of some form.
PREFIX : <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x
{ ?x :p ?v .
  FILTER ( lang(?v) != '@NotALangTag@' )
}
ORDER BY ?x
    Results
    data/ExprBuiltins/result-lang-1.srx
    
    Data
    
      data/ExprBuiltins/data-builtin-2.ttl
    
    @prefix : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p  "string" .
:x2 :p  "string"^^xsd:string .
:x3 :p  "string"@en .
:x4 :p  "lex"^^:unknownType .
:x5 :p  1234 .
:x6 :p  <http://example/iri> .
:x7 :p  _:bNode .
    Query
      data/ExprBuiltins/q-lang-2.rq
    PREFIX : <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x
{ ?x :p ?v .
  FILTER ( lang(?v) = '' )
}
ORDER BY ?x
    Results
    data/ExprBuiltins/result-lang-2.srx
    
    Data
    
      data/ExprBuiltins/data-builtin-2.ttl
    
    @prefix : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p  "string" .
:x2 :p  "string"^^xsd:string .
:x3 :p  "string"@en .
:x4 :p  "lex"^^:unknownType .
:x5 :p  1234 .
:x6 :p  <http://example/iri> .
:x7 :p  _:bNode .
    Query
      data/ExprBuiltins/q-lang-2.rq
    PREFIX : <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x
{ ?x :p ?v .
  FILTER ( lang(?v) = '' )
}
ORDER BY ?x
    Results
    data/ExprBuiltins/result-lang-2.srx
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-uri-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER isURI(?v) .
    }
    Results
    data/ExprBuiltins/result-uri-1.ttl
    
      
        | x | v | 
|---|
      | <http://example.org/things#xu> | <http://example.org/things#z> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-builtin-1.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  1.0e0 .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xp2 :p  "" .
:xu :p  :z .
:xb :p  _:a .
    Query
      data/ExprBuiltins/q-iri-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x ?v
WHERE
    { ?x :p ?v .
      FILTER isURI(?v) .
    }
    Results
    data/ExprBuiltins/result-iri-1.ttl
    
      
        | v | x | 
|---|
      | <http://example.org/things#z> | <http://example.org/things#xu> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-langMatches.ttl
    
    @prefix : <http://example.org/#> .
:x :p1 "abc" .
:x :p2 <abc> .
:x :p3 "abc"@en .
:x :p4 "abc"@en-gb .
:x :p5 "abc"@fr .
    Query
      data/ExprBuiltins/q-langMatches-1.rq
    PREFIX : <http://example.org/#>
SELECT *
{ :x ?p ?v . FILTER langMatches(lang(?v), "en-GB") . }
    Results
    data/ExprBuiltins/result-langMatches-1.ttl
    
      
        | v | p | 
|---|
      | "abc" | <http://example.org/#p4> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-langMatches.ttl
    
    @prefix : <http://example.org/#> .
:x :p1 "abc" .
:x :p2 <abc> .
:x :p3 "abc"@en .
:x :p4 "abc"@en-gb .
:x :p5 "abc"@fr .
    Query
      data/ExprBuiltins/q-langMatches-2.rq
    PREFIX : <http://example.org/#>
SELECT *
{ :x ?p ?v . FILTER langMatches(lang(?v), "en") . }
    Results
    data/ExprBuiltins/result-langMatches-2.ttl
    
      
        | p | v | 
|---|
      | <http://example.org/#p3> | "abc" | 
      | <http://example.org/#p4> | "abc" | 
      
    
    
    Data
    
      data/ExprBuiltins/data-langMatches.ttl
    
    @prefix : <http://example.org/#> .
:x :p1 "abc" .
:x :p2 <abc> .
:x :p3 "abc"@en .
:x :p4 "abc"@en-gb .
:x :p5 "abc"@fr .
    Query
      data/ExprBuiltins/q-langMatches-3.rq
    PREFIX : <http://example.org/#>
SELECT *
{ :x ?p ?v . FILTER langMatches(lang(?v), "*") . }
    Results
    data/ExprBuiltins/result-langMatches-3.ttl
    
      
        | v | p | 
|---|
      | "abc" | <http://example.org/#p5> | 
      | "abc" | <http://example.org/#p4> | 
      | "abc" | <http://example.org/#p3> | 
      
    
    
    Data
    
      data/ExprBuiltins/data-langMatches.ttl
    
    @prefix : <http://example.org/#> .
:x :p1 "abc" .
:x :p2 <abc> .
:x :p3 "abc"@en .
:x :p4 "abc"@en-gb .
:x :p5 "abc"@fr .
    Query
      data/ExprBuiltins/q-langMatches-4.rq
    PREFIX : <http://example.org/#>
SELECT *
{ :x ?p ?v . FILTER (! langMatches(lang(?v), "*")) . }
    Results
    data/ExprBuiltins/result-langMatches-4.ttl
    
      
        | p | v | 
|---|
      | <http://example.org/#p1> | "abc" | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p ?v .
      FILTER ( ?v = 1 ) .
    }
    Results
    data/ExprEquals/result-eq-1.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xi2> | 
      | <http://example.org/things#xd3> | 
      | <http://example.org/things#xd2> | 
      | <http://example.org/things#xi3> | 
      | <http://example.org/things#xd1> | 
      | <http://example.org/things#xi1> | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-2.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p ?v .
      FILTER ( ?v = 1.0e0 )  .
    }
    Results
    data/ExprEquals/result-eq-2.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xd3> | 
      | <http://example.org/things#xd2> | 
      | <http://example.org/things#xi3> | 
      | <http://example.org/things#xi1> | 
      | <http://example.org/things#xi2> | 
      | <http://example.org/things#xd1> | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-3.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p ?v .
      FILTER ( ?v = "1" ) .
    }
    Results
    data/ExprEquals/result-eq-3.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xp2> | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-4.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p ?v .
      FILTER ( ?v = "zzz" ) .
    }
    Results
    data/ExprEquals/result-eq-4.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xp1> | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-5.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p ?v .
      FILTER ( ?v = :z  ) .
    }
    Results
    data/ExprEquals/result-eq-5.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xu> | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq2-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?v1 ?v2
WHERE
    { ?x1 :p ?v1 .
      ?x2 :p ?v2 .
      FILTER ( ?v1 = ?v2 ) .
    }
    Results
    data/ExprEquals/result-eq2-1.ttl
    
      
        | v2 | v1 | 
|---|
      | "1" | "1" | 
      | "zzz" | "zzz" | 
      | "1.0" | "1.0e0" | 
      | "zzz" | "zzz" | 
      | "1" | "1.0e0" | 
      | "1" | "1.0" | 
      | "1" | "1" | 
      | "1.0" | "1" | 
      | "1" | "1" | 
      | "1" | "1.0" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1.0" | "1.0" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1.0" | "1" | 
      | "1" | "1.0" | 
      | "1.0" | "1" | 
      | "1.0e0" | "1" | 
      | "1" | "1" | 
      | "1.0" | "1" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1.0e0" | "1.0e0" | 
      | "1.0e0" | "1" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1" | "1.0" | 
      | "1.0e0" | "1" | 
      | "1" | "1.0e0" | 
      | "1" | "1" | 
      | "1.0e0" | "1.0" | 
      | <http://example.org/things#z> | <http://example.org/things#z> | 
      | "1.0e0" | "1" | 
      | "1" | "1.0e0" | 
      | "1" | "1.0e0" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1" | "1" | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq2-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?v1 ?v2
WHERE
    { ?x1 :p ?v1 .
      ?x2 :p ?v2 .
      FILTER ( ?v1 = ?v2 ) .
    }
    Results
    data/ExprEquals/result-eq2-1.ttl
    
      
        | v1 | v2 | 
|---|
      | "1" | "1" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1.0e0" | "1" | 
      | "1.0e0" | "1" | 
      | "1" | "1.0e0" | 
      | <http://example.org/things#z> | <http://example.org/things#z> | 
      | "1.0" | "1.0e0" | 
      | "1" | "1" | 
      | "1.0e0" | "1" | 
      | "1" | "1.0e0" | 
      | "1.0" | "1" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1" | "1.0e0" | 
      | "1.0e0" | "1.0e0" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1" | "1.0" | 
      | "1" | "1" | 
      | "1" | "1.0e0" | 
      | "1" | "1.0" | 
      | "1.0" | "1" | 
      | "1" | "1.0" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1.0" | "1.0" | 
      | "1" | "1" | 
      | "1" | "1" | 
      | "1.0" | "1" | 
      | "1" | "1" | 
      | "1" | "1.0" | 
      | "1" | "1" | 
      | "1.0" | "1" | 
      | "1.0e0" | "1" | 
      | "zzz" | "zzz" | 
      | "1.0e0" | "1.0" | 
      | "zzz" | "zzz" | 
      | "1" | "1" | 
      
    
    
    Bad test - assumes value equality in the graph.
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-graph-1.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p 1 .
    }
    Results
    data/ExprEquals/result-eq-graph-1.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xi1> | 
      | <http://example.org/things#xi2> | 
      | <http://example.org/things#xi3> | 
      
    
    
    Bad test - assumes value equality in the graph.
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-graph-2.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p 1.0e0 .
    }
    Results
    data/ExprEquals/result-eq-graph-2.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xd3> | 
      | <http://example.org/things#xd1> | 
      | <http://example.org/things#xd2> | 
      
    
    
    Bad test - assumes value equality in the graph.
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-graph-3.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p "1"
    }
    Results
    data/ExprEquals/result-eq-graph-3.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xp2> | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-graph-4.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p "zzz" .
    }
    Results
    data/ExprEquals/result-eq-graph-4.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xp1> | 
      
    
    
    Data
    
      data/ExprEquals/data-eq.ttl
    
    @prefix    :        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
:xi1 :p  1 .
:xi2 :p  "1"^^xsd:integer .
:xi3 :p  "01"^^xsd:integer .
:xd1 :p  "1.0e0"^^xsd:double .
:xd2 :p  "1.0"^^xsd:double .
:xd3 :p  "1"^^xsd:double .
## :xdec1 :p  "1.0"^^xsd:decimal .
## :xdec2 :p  "1"^^xsd:decimal .
## :xdec3 :p  "01"^^xsd:decimal .
:xt1 :p  "zzz"^^:myType .
:xp1 :p  "zzz" .
:xp2 :p  "1" .
:xu :p  :z .
#:xb :p  _:a .
    Query
      data/ExprEquals/query-eq-graph-5.rq
    PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX  : <http://example.org/things#>
SELECT  ?x
WHERE
    { ?x :p ?v .
      FILTER ( ?v = :z  ) .
    }
    Results
    data/ExprEquals/result-eq-graph-5.ttl
    
      
        | x | 
|---|
      | <http://example.org/things#xu> | 
      
    
    
    Extracted: Writing a Simple Query 
    Data
    
      data/extracted-examples/data-2.1.ttl
    
    # Writing a Simple Query
<http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> "SPARQL Tutorial" .
    Query
      data/extracted-examples/query-2.1.rq
    # Writing a Simple Query
SELECT ?title
WHERE
{
  <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title .
}
    Results
    data/extracted-examples/result-2.1.ttl
    
    
    Extracted: Examples of Query Syntax 
    Query
      data/extracted-examples/query-2.1.6.rq
    # Examples of Query Syntax
PREFIX  dc: <http://purl.org/dc/elements/1.1/>
SELECT  ?title
WHERE   { <http://example.org/book/book1> dc:title ?title }
    
    Extracted: Examples of Query Syntax 
    Query
      data/extracted-examples/query-2.1.6-q1.rq
    # Examples of Query Syntax
PREFIX  dc: <http://purl.org/dc/elements/1.1/>
PREFIX  : <http://example.org/book/>
SELECT  $title
WHERE   { :book1  dc:title  $title }
    
    Extracted: Examples of Query Syntax 
    Query
      data/extracted-examples/query-2.1.6-q2.rq
    # Examples of Query Syntax
BASE    <http://example.org/book/>
PREFIX  dc: <http://purl.org/dc/elements/1.1/>
SELECT  $title
WHERE   { <book1>  dc:title  ?title }
    
    Extracted: Examples of Query Syntax 
    Query
      data/extracted-examples/query-2.1.6-q3.rq
    # Examples of Query Syntax
BASE    <http://example.org/book/>
PREFIX  dcore:  <http://purl.org/dc/elements/1.1/>
SELECT  ?title
WHERE   { <book1> dcore:title ?title }
    
    Extracted: Data descriptions used in this document 
    Query
      
    cannot open '' for printing: No such file or directory
    
    Extracted: Pattern Solutions 
    Data
    
      data/extracted-examples/data-2.4.ttl
    
    # Pattern Solutions
<http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> "SPARQL" .
    Query
      data/extracted-examples/query-2.4.rq
    # Pattern Solutions
PREFIX  dc: <http://purl.org/dc/elements/1.1/>
SELECT  ?book ?title
WHERE   { ?book dc:title ?title }
    Results
    data/extracted-examples/result-2.4.ttl
    
      
        | book | title | 
|---|
      | <http://example.org/book/book1> | "SPARQL" | 
      
    
    
    Extracted: Example of Basic Graph Pattern Matching 
    Data
    
      data/extracted-examples/data-2.5.3.ttl
    
    # Example of Basic Graph Pattern Matching
@prefix foaf:    <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name   "Johnny Lee Outlaw" .
_:a  foaf:mbox   <mailto:outlaw@example.com> .
_:b  foaf:name   "A. N. Other" .
_:b  foaf:mbox   <mailto:other@example.com> .
    Query
      data/extracted-examples/query-2.5.3.rq
    # Example of Basic Graph Pattern Matching
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?mbox
WHERE
  { ?x foaf:name "Johnny Lee Outlaw" .
    ?x foaf:mbox ?mbox }
    Results
    data/extracted-examples/result-2.5.3.ttl
    
      
        | mbox | 
|---|
      | <mailto:outlaw@example.com> | 
      
    
    
    Extracted: Multiple Matches 
    Data
    
      data/extracted-examples/data-2.6.ttl
    
    # Multiple Matches
@prefix foaf:  <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name   "Johnny Lee Outlaw" .
_:a  foaf:mbox   <mailto:jlow@example.com> .
_:b  foaf:name   "Peter Goodguy" .
_:b  foaf:mbox   <mailto:peter@example.org> .
    Query
      data/extracted-examples/query-2.6.rq
    # Multiple Matches
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE
  { ?x foaf:name ?name .
    ?x foaf:mbox ?mbox }
    Results
    data/extracted-examples/result-2.6.ttl
    
      
        | name | mbox | 
|---|
      | "Johnny Lee Outlaw" | <mailto:jlow@example.com> | 
      | "Peter Goodguy" | <mailto:peter@example.org> | 
      
    
    
    Extracted: Blank Nodes in Query Results 
    Data
    
      data/extracted-examples/data-2.7.ttl
    
    # Blank Nodes in Query Results
@prefix foaf:  <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name   "Alice" .
_:b  foaf:name   "Bob" .
    Query
      data/extracted-examples/query-2.7.rq
    # Blank Nodes in Query Results
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?x ?name
WHERE  { ?x foaf:name ?name }
    Results
    data/extracted-examples/result-2.7.ttl
    
      
        | name | x | 
|---|
      | "Bob" | <_:d.74a0> | 
      | "Alice" | <_:c.74a0> | 
      
    
    
    Extracted: Blank Nodes in Query Results 
    Data
    
      data/extracted-examples/data-2.7.ttl
    
    # Blank Nodes in Query Results
@prefix foaf:  <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name   "Alice" .
_:b  foaf:name   "Bob" .
    Query
      data/extracted-examples/query-2.7.rq
    # Blank Nodes in Query Results
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?x ?name
WHERE  { ?x foaf:name ?name }
    Results
    data/extracted-examples/result-2.7-r1.ttl
    
      
        | name | x | 
|---|
      | "Bob" | <_:s.bae41> | 
      | "Alice" | <_:r.bae41> | 
      
    
    
    Extracted: Querying Reification Vocabulary 
    Data
    
      data/extracted-examples/data-2.9.ttl
    
    # Querying Reification Vocabulary
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc:  <http://purl.org/dc/elements/1.1/> .
@prefix :    <http://example/ns#> .
_:a   rdf:subject   <http://example.org/book/book1> .
_:a   rdf:predicate dc:title .
_:a   rdf:object    "SPARQL" .
_:a   :saidBy       "Alice" .
_:b   rdf:subject   <http://example.org/book/book1> .
_:b   rdf:predicate dc:title .
_:b   rdf:object    "SPARQL Tutorial" .
_:b   :saidBy       "Bob" .
    Query
      data/extracted-examples/query-2.9.rq
    # Querying Reification Vocabulary
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?book ?title
WHERE
{ ?book dc:title ?title }
    Results
    data/extracted-examples/result-2.9.ttl
    
    
    Extracted: Querying Reification Vocabulary 
    Data
    
      data/extracted-examples/data-2.9.ttl
    
    # Querying Reification Vocabulary
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc:  <http://purl.org/dc/elements/1.1/> .
@prefix :    <http://example/ns#> .
_:a   rdf:subject   <http://example.org/book/book1> .
_:a   rdf:predicate dc:title .
_:a   rdf:object    "SPARQL" .
_:a   :saidBy       "Alice" .
_:b   rdf:subject   <http://example.org/book/book1> .
_:b   rdf:predicate dc:title .
_:b   rdf:object    "SPARQL Tutorial" .
_:b   :saidBy       "Bob" .
    Query
      data/extracted-examples/query-2.9-q1.rq
    # Querying Reification Vocabulary
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>
PREFIX :     <http://example/ns#>
SELECT ?book ?title
WHERE
{ ?t rdf:subject    ?book  .
  ?t rdf:predicate  dc:title .
  ?t rdf:object     ?title .
  ?t :saidBy       " Bob" .
}
    Results
    data/extracted-examples/result-2.9-r1.ttl
    
      
        | title | book | 
|---|
      | "SPARQL Tutorial" | <http://example.org/book/book1> | 
      
    
    
    Extracted: Matching Integers 
    Data
    
      data/extracted-examples/data-3.1.ttl
    
    # Matching RDF Literals
@prefix dt:   <http://example.org/datatype#> .
@prefix ns:   <http://example.org/ns#> .
@prefix :     <http://example.org/ns#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
:x   ns:p     "42"^^xsd:integer .
:y   ns:p     "abc"^^dt:specialDatatype .
:z   ns:p     "cat"@en .
    Query
      data/extracted-examples/query-3.1.1.rq
    # Matching Integers
SELECT ?v WHERE { ?v ?p 42 }
    
    Extracted: Matching Arbitrary Datatypes 
    Data
    
      data/extracted-examples/data-3.1.ttl
    
    # Matching RDF Literals
@prefix dt:   <http://example.org/datatype#> .
@prefix ns:   <http://example.org/ns#> .
@prefix :     <http://example.org/ns#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
:x   ns:p     "42"^^xsd:integer .
:y   ns:p     "abc"^^dt:specialDatatype .
:z   ns:p     "cat"@en .
    Query
      data/extracted-examples/query-3.1.2.rq
    # Matching Arbitrary Datatypes
SELECT ?v WHERE { ?v ?p "abc"^^<http://example.org/datatype#specialDatatype> }
    
    Extracted: Matching Language Tags 
    Data
    
      data/extracted-examples/data-3.1.ttl
    
    # Matching RDF Literals
@prefix dt:   <http://example.org/datatype#> .
@prefix ns:   <http://example.org/ns#> .
@prefix :     <http://example.org/ns#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
:x   ns:p     "42"^^xsd:integer .
:y   ns:p     "abc"^^dt:specialDatatype .
:z   ns:p     "cat"@en .
    Query
      data/extracted-examples/query-3.1.3.rq
    # Matching Language Tags
SELECT ?x WHERE { ?x ?p "cat" }
    
    Extracted: Matching Language Tags 
    Data
    
      data/extracted-examples/data-3.1.ttl
    
    # Matching RDF Literals
@prefix dt:   <http://example.org/datatype#> .
@prefix ns:   <http://example.org/ns#> .
@prefix :     <http://example.org/ns#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
:x   ns:p     "42"^^xsd:integer .
:y   ns:p     "abc"^^dt:specialDatatype .
:z   ns:p     "cat"@en .
    Query
      data/extracted-examples/query-3.1.3-q1.rq
    # Matching Language Tags
SELECT ?x WHERE { ?x ?p "cat"@en }
    
    Extracted: Value Constraints 
    Data
    
      data/extracted-examples/data-3.2.ttl
    
    # Value Constraints
@prefix dc:   <http://purl.org/dc/elements/1.1/> .
@prefix :     <http://example.org/book/> .
@prefix ns:   <http://example.org/ns#> .
:book1  dc:title  "SPARQL Tutorial" .
:book1  ns:price  42 .
:book2  dc:title  "The Semantic Web" .
:book2  ns:price  23 .
    Query
      data/extracted-examples/query-3.2.rq
    # Value Constraints
PREFIX  dc:  <http://purl.org/dc/elements/1.1/>
PREFIX  ns:  <http://example.org/ns#>
SELECT  ?title ?price
WHERE   { ?x ns:price ?price .
          FILTER (?price < 30) .
          ?x dc:title ?title . }
    Results
    data/extracted-examples/result-3.2.ttl
    
      
        | price | title | 
|---|
      | "23" | "The Semantic Web" | 
      
    
    
    Extracted: Group Graph Patterns 
    Query
      data/extracted-examples/query-4.1.rq
    # Group Graph Patterns
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE  {
          ?x foaf:name ?name .
          ?x foaf:mbox ?mbox .
       }
    
    Extracted: Group Graph Patterns 
    Query
      data/extracted-examples/query-4.1-q1.rq
    # Group Graph Patterns
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE  { { ?x foaf:name ?name . }
         { ?x foaf:mbox ?mbox . }
       }
    
    Extracted: Optional Pattern Matching 
    Data
    
      data/extracted-examples/data-5.1.ttl
    
    # Optional Pattern Matching
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
_:a  rdf:type        foaf:Person .
_:a  foaf:name       "Alice" .
_:a  foaf:mbox       <mailto:alice@example.com> .
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  rdf:type        foaf:Person .
_:b  foaf:name       "Bob" .
    Query
      data/extracted-examples/query-5.1.rq
    # Optional Pattern Matching
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE  { ?x foaf:name  ?name .
         OPTIONAL { ?x  foaf:mbox  ?mbox }
       }
    Results
    data/extracted-examples/result-5.1.ttl
    
      
        | name | mbox | 
|---|
      | "Alice" | <mailto:alice@example.com> | 
      | "Alice" | <mailto:alice@work.example> | 
      | "Bob" |  | 
      
    
    
    Extracted: Constraints in Optional Pattern Matching 
    Data
    
      data/extracted-examples/data-5.2.ttl
    
    # Constraints in Optional Pattern Matching
@prefix dc:   <http://purl.org/dc/elements/1.1/> .
@prefix :     <http://example.org/book/> .
@prefix ns:   <http://example.org/ns#> .
:book1  dc:title  "SPARQL Tutorial" .
:book1  ns:price  42 .
:book2  dc:title  "The Semantic Web" .
:book2  ns:price  23 .
    Query
      data/extracted-examples/query-5.2.rq
    # Constraints in Optional Pattern Matching
PREFIX  dc:  <http://purl.org/dc/elements/1.1/>
PREFIX  ns:  <http://example.org/ns#>
SELECT  ?title ?price
WHERE   { ?x dc:title ?title .
          OPTIONAL { ?x ns:price ?price . FILTER (?price < 30) }
        }
    Results
    data/extracted-examples/result-5.2.ttl
    
      
        | price | title | 
|---|
      | "23" | "The Semantic Web" | 
      |  | "SPARQL Tutorial" | 
      
    
    
    Extracted: Multiple Optional Graph Patterns 
    Data
    
      data/extracted-examples/data-5.3.ttl
    
    # Multiple Optional Graph Patterns
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice" .
_:a  foaf:homepage   <http://work.example.org/alice/> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       <mailto:bob@work.example> .
    Query
      data/extracted-examples/query-5.3.rq
    # Multiple Optional Graph Patterns
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox ?hpage
WHERE  { ?x foaf:name  ?name .
         OPTIONAL { ?x foaf:mbox ?mbox } .
         OPTIONAL { ?x foaf:homepage ?hpage }
       }
    Results
    data/extracted-examples/result-5.3.ttl
    
      
        | name | mbox | hpage | 
|---|
      | "Bob" | <mailto:bob@example.com> |  | 
      | "Alice" |  | <http://work.example.org/alice/> | 
      
    
    
    Extracted: Nested Optional Graph Patterns 
    Data
    
      data/extracted-examples/data-5.5.ttl
    
    # Nested Optional Graph Patterns
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix vcard:      <http://www.w3.org/2001/vcard-rdf/3.0#> .
_:a  foaf:name     "Alice" .
_:a  foaf:mbox     <mailto:alice@work.example> .
_:a  vcard:N       _:x .
_:x  vcard:Family  "Hacker" .
_:x  vcard:Given   "Alice" .
_:b  foaf:name     "Bob" .
_:b  foaf:mbox     <mailto:bob@work.example> .
_:b  foaf:N        _:z .
_:z  vcard:Family  "Hacker" .
_:e  foaf:name     "Ella" .
_:e  vcard:N       _:y .
_:y  vcard:Given   "Eleanor" .
    Query
      data/extracted-examples/query-5.5.rq
    # Nested Optional Graph Patterns
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
SELECT ?foafName ?mbox ?gname ?fname
WHERE
  {  ?x foaf:name ?foafName .
     OPTIONAL { ?x foaf:mbox ?mbox } .
     OPTIONAL {  ?x vcard:N ?vc .
                 ?vc vcard:Given ?gname .
                 OPTIONAL { ?vc vcard:Family ?fname }
              }
  }
    Results
    data/extracted-examples/result-5.5.ttl
    
      
        | foafName | mbox | gname | fname | 
|---|
      | "Bob" | <mailto:bob@work.example> |  |  | 
      | "Alice" | <mailto:alice@work.example> | "Alice" | "Hacker" | 
      | "Ella" |  | "Eleanor" |  | 
      
    
    
    Extracted: Joining Patterns with UNION 
    Data
    
      data/extracted-examples/data-6.1.ttl
    
    # Joining Patterns with UNION
@prefix dc10:  <http://purl.org/dc/elements/1.0/> .
@prefix dc11:  <http://purl.org/dc/elements/1.1/> .
_:a  dc10:title     "SPARQL Query Language Tutorial" .
_:b  dc11:title     "SPARQL Protocol Tutorial" .
_:c  dc10:title     "SPARQL" .
_:c  dc11:title     "SPARQL (updated)" .
    Query
      data/extracted-examples/query-6.1.rq
    # Joining Patterns with UNION
PREFIX dc10:  <http://purl.org/dc/elements/1.0/>
PREFIX dc11:  <http://purl.org/dc/elements/1.1/>
SELECT ?title
WHERE  { { ?book dc10:title  ?title } UNION { ?book dc11:title  ?title } }
    Results
    data/extracted-examples/result-6.1.ttl
    
      
        | title | 
|---|
      | "SPARQL Query Language Tutorial" | 
      | "SPARQL (updated)" | 
      | "SPARQL" | 
      | "SPARQL Protocol Tutorial" | 
      
    
    
    Extracted: Joining Patterns with UNION 
    Data
    
      data/extracted-examples/data-6.1.ttl
    
    # Joining Patterns with UNION
@prefix dc10:  <http://purl.org/dc/elements/1.0/> .
@prefix dc11:  <http://purl.org/dc/elements/1.1/> .
_:a  dc10:title     "SPARQL Query Language Tutorial" .
_:b  dc11:title     "SPARQL Protocol Tutorial" .
_:c  dc10:title     "SPARQL" .
_:c  dc11:title     "SPARQL (updated)" .
    Query
      data/extracted-examples/query-6.1-q1.rq
    # Joining Patterns with UNION
PREFIX dc10:  <http://purl.org/dc/elements/1.0/>
PREFIX dc11:  <http://purl.org/dc/elements/1.1/>
SELECT ?x ?y
WHERE  { { ?book dc10:title ?x } UNION { ?book dc11:title  ?y } }
    Results
    data/extracted-examples/result-6.1-r1.ttl
    
      
        | y | x | 
|---|
      |  | "SPARQL Query Language Tutorial" | 
      |  | "SPARQL" | 
      | "SPARQL Protocol Tutorial" |  | 
      | "SPARQL (updated)" |  | 
      
    
    
    Extracted: Joining Patterns with UNION 
    Data
    
      data/extracted-examples/data-6.1.ttl
    
    # Joining Patterns with UNION
@prefix dc10:  <http://purl.org/dc/elements/1.0/> .
@prefix dc11:  <http://purl.org/dc/elements/1.1/> .
_:a  dc10:title     "SPARQL Query Language Tutorial" .
_:b  dc11:title     "SPARQL Protocol Tutorial" .
_:c  dc10:title     "SPARQL" .
_:c  dc11:title     "SPARQL (updated)" .
    Query
      data/extracted-examples/query-6.1-q2.rq
    # Joining Patterns with UNION
PREFIX dc10:  <http://purl.org/dc/elements/1.1/>
PREFIX dc11:  <http://purl.org/dc/elements/1.0/>
SELECT ?title ?author
WHERE  { { ?book dc10:title ?title .  ?book dc10:creator ?author }
         UNION
         { ?book dc11:title ?title .  ?book dc11:creator ?author }
       }
    Results
    data/extracted-examples/result-6.1-r2.ttl
    
      
        | title | author | 
|---|
      | "SPARQL Query Language Tutorial" | "Bob" | 
      | "SPARQL Protocol Tutorial" | "Alice" | 
      
    
    
    Extracted: Examples of RDF Datasets 
    Query
      
    cannot open '' for printing: No such file or directory
    
    Extracted: Examples of RDF Datasets 
    Query
      
    cannot open '' for printing: No such file or directory
    
    Extracted: Accessing Graph Names 
    Data
    
      data/extracted-examples/data-8-d1.ttl
    
    # Querying the Dataset
# Named graph: http://example.org/foaf/bobFoaf
@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#> .
_:z  foaf:mbox     <mailto:bob@work.example> .
_:z  rdfs:seeAlso  <http://example.org/foaf/bobFoaf> .
_:z  foaf:nick     "Robert" .
<http://example.org/foaf/bobFoaf>
     rdf:type      foaf:PersonalProfileDocument .
    Query
      data/extracted-examples/query-8.1.rq
    # Accessing Graph Names
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?src ?bobNick
WHERE
  {
    GRAPH ?src
    { ?x foaf:mbox <mailto:bob@work.example> .
      ?x foaf:nick ?bobNick
    }
  }
    Results
    data/extracted-examples/result-8.1.ttl
    
      
        | bobNick | src | 
|---|
      | "Robert" | <http://example.org/foaf/bobFoaf> | 
      | "Bobby" | <http://example.org/foaf/aliceFoaf> | 
      
    
    
    Extracted: Restricting by Graph IRI 
    Data
    
      data/extracted-examples/data-8-d1.ttl
    
    # Querying the Dataset
# Named graph: http://example.org/foaf/bobFoaf
@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#> .
_:z  foaf:mbox     <mailto:bob@work.example> .
_:z  rdfs:seeAlso  <http://example.org/foaf/bobFoaf> .
_:z  foaf:nick     "Robert" .
<http://example.org/foaf/bobFoaf>
     rdf:type      foaf:PersonalProfileDocument .
    Query
      data/extracted-examples/query-8.2.rq
    # Restricting by Graph IRI
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX data: <http://example.org/foaf/>
SELECT ?nick
WHERE
  {
     GRAPH data:bobFoaf {
         ?x foaf:mbox <mailto:bob@work.example> .
         ?x foaf:nick ?nick }
  }
    Results
    data/extracted-examples/result-8.2.ttl
    
    
    Extracted: Restricting by Bound Variables 
    Data
    
      data/extracted-examples/data-8-d1.ttl
    
    # Querying the Dataset
# Named graph: http://example.org/foaf/bobFoaf
@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#> .
_:z  foaf:mbox     <mailto:bob@work.example> .
_:z  rdfs:seeAlso  <http://example.org/foaf/bobFoaf> .
_:z  foaf:nick     "Robert" .
<http://example.org/foaf/bobFoaf>
     rdf:type      foaf:PersonalProfileDocument .
    Query
      data/extracted-examples/query-8.3.rq
    # Restricting by Bound Variables
PREFIX  data:  <http://example.org/foaf/>
PREFIX  foaf:  <http://xmlns.com/foaf/0.1/>
PREFIX  rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?mbox ?nick ?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:nick ?nick
  }
}
    Results
    data/extracted-examples/result-8.3.ttl
    
      
        | mbox | nick | ppd | 
|---|
      | <mailto:bob@work.example> | "Robert" | <http://example.org/foaf/bobFoaf> | 
      
    
    
    Extracted: Named and Default Graphs 
    Data
    
      data/extracted-examples/data-8.4-d2.ttl
    
    # Named and Default Graphs
# Graph: locally allocated IRI: tag:example.org,2005-06-06:graph2
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
_:a foaf:name "Alice" .
_:a foaf:mbox <mailto:alice@work.example> .
_:b foaf:name "Bob" .
_:b foaf:mbox <mailto:bob@newcorp.example.org> .
    Query
      data/extracted-examples/query-8.4.rq
    # Named and Default Graphs
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>
SELECT ?name ?mbox ?date
WHERE
  {  ?g dc:publisher ?name ;
        dc:date ?date .
    GRAPH ?g
      { ?person foaf:name ?name ; foaf:mbox ?mbox }
  }
    Results
    data/extracted-examples/result-8.4.ttl
    
      
        | name | mbox | date | 
|---|
      | "Bob" | <mailto:bob@oldcorp.example.org> | "2004-12-06" | 
      | "Bob" | <mailto:bob@newcorp.example.org> | "2005-01-10" | 
      
    
    
    Extracted: Specifying the Default Graph 
    Data
    
      data/extracted-examples/data-9.1.ttl
    
    # Specifying the Default Graph
# Default graph (stored at http://example.org/foaf/aliceFoaf)
@prefix  foaf:  <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name     "Alice" .
_:a  foaf:mbox     <mailto:alice@work.example> .
    Query
      data/extracted-examples/query-9.1.rq
    # Specifying the Default Graph
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT  ?name
FROM    <http://example.org/foaf/aliceFoaf>
WHERE   { ?x foaf:name ?name }
    Results
    data/extracted-examples/result-9.1.ttl
    
    
    Extracted: Specifying Named Graphs 
    Data
    
      data/extracted-examples/data-9.2-d1.ttl
    
    # Specifying Named Graphs
# Graph: http://example.org/alice
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
_:a foaf:name "Alice" .
_:a foaf:mbox <mailto:alice@work.example> .
    Query
      data/extracted-examples/query-9.2.rq
    # Specifying Named Graphs
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?src ?name
FROM NAMED <http://example.org/alice>
FROM NAMED <http://example.org/bob>
WHERE
{ GRAPH ?src { ?x foaf:name ?name } }
    Results
    data/extracted-examples/result-9.2.ttl
    
      
        | src | name | 
|---|
      | <http://example.org/alice> | "Alice" | 
      | <http://example.org/bob> | "Bob" | 
      
    
    
    Extracted: Combining FROM and FROM NAMED 
    Data
    
      data/extracted-examples/data-9.3-d2.ttl
    
    # Combining FROM and FROM NAMED
# Named graph: http://example.org/alice
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
_:a foaf:name "Alice" .
_:a foaf:mbox <mailto:alice@work.example.org> .
    Query
      data/extracted-examples/query-9.3.rq
    # Combining FROM and FROM NAMED
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?who ?g ?mbox
FROM <http://example.org/dft.ttl>
FROM NAMED <http://example.org/alice>
FROM NAMED <http://example.org/bob>
WHERE
{
   ?g dc:publisher ?who .
   GRAPH ?g { ?x foaf:mbox ?mbox }
}
    Results
    data/extracted-examples/result-9.3.ttl
    
      
        | who | g | mbox | 
|---|
      | "Alice Hacker" | <http://example.org/alice> | <mailto:alice@work.example.org> | 
      | "Bob Hacker" | <http://example.org/bob> | <mailto:bob@oldcorp.example.org> | 
      
    
    
    Extracted: Projection 
    Data
    
      data/extracted-examples/data-10.1.1.ttl
    
    # Projection
@prefix foaf:        <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice" .
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       <mailto:bob@work.example> .
    Query
      data/extracted-examples/query-10.1.1.rq
    # Projection
PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE
 { ?x foaf:name ?name }
    Results
    data/extracted-examples/result-10.1.1.ttl
    
    
    Extracted: DISTINCT 
    Data
    
      data/extracted-examples/data-10.1.2.ttl
    
    # DISTINCT
@prefix  foaf:  <http://xmlns.com/foaf/0.1/> .
_:a    foaf:name   "Alice" .
_:a    foaf:mbox   <mailto:alice@org> .
_:z    foaf:name   "Alice" .
_:z    foaf:mbox   <mailto:smith@work> .
    Query
      data/extracted-examples/query-10.1.2.rq
    # DISTINCT
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT ?name WHERE { ?x foaf:name ?name }
    Results
    data/extracted-examples/result-10.1.2.ttl
    
    
    Extracted: ORDER BY 
    Query
      data/extracted-examples/query-10.1.3.rq
    # ORDER BY
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name }
ORDER BY ?name
    
    Extracted: ORDER BY 
    Query
      data/extracted-examples/query-10.1.3-q1.rq
    # ORDER BY
PREFIX     :    <http://example.org/ns#>
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>
SELECT ?name
WHERE { ?x foaf:name ?name ; :empId ?emp }
ORDER BY DESC(?emp)
    
    Extracted: ORDER BY 
    Query
      data/extracted-examples/query-10.1.3-q2.rq
    # ORDER BY
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name ; :empId ?emp }
ORDER BY ?name DESC(?emp)
    
    Extracted: LIMIT 
    Query
      data/extracted-examples/query-10.1.4.rq
    # LIMIT
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name }
LIMIT 20
    
    Extracted: OFFSET 
    Query
      data/extracted-examples/query-10.1.5.rq
    # OFFSET
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT  ?name
WHERE   { ?x foaf:name ?name }
ORDER BY ?name
LIMIT   5
OFFSET  10
    
    Extracted: Selecting Variables 
    Data
    
      data/extracted-examples/data-10.2.ttl
    
    # Selecting Variables
@prefix  foaf:  <http://xmlns.com/foaf/0.1/> .
_:a    foaf:name   "Alice" .
_:a    foaf:knows  _:b .
_:a    foaf:knows  _:c .
_:b    foaf:name   "Bob" .
_:c    foaf:name   "Clare" .
_:c    foaf:nick   "CT" .
    Query
      data/extracted-examples/query-10.2.rq
    # Selecting Variables
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT ?nameX ?nameY ?nickY
WHERE
  { ?x foaf:knows ?y ;
       foaf:name ?nameX .
    ?y foaf:name ?nameY .
    OPTIONAL { ?y foaf:nick ?nickY }
  }
    Results
    data/extracted-examples/result-10.2.ttl
    
      
        | nameX | nameY | nickY | 
|---|
      | "Alice" | "Bob" |  | 
      | "Alice" | "Clare" | "CT" | 
      
    
    
    Extracted: Selecting Variables 
    Data
    
      data/extracted-examples/data-10.2.ttl
    
    # Selecting Variables
@prefix  foaf:  <http://xmlns.com/foaf/0.1/> .
_:a    foaf:name   "Alice" .
_:a    foaf:knows  _:b .
_:a    foaf:knows  _:c .
_:b    foaf:name   "Bob" .
_:c    foaf:name   "Clare" .
_:c    foaf:nick   "CT" .
    Query
      data/extracted-examples/query-10.2.rq
    # Selecting Variables
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
SELECT ?nameX ?nameY ?nickY
WHERE
  { ?x foaf:knows ?y ;
       foaf:name ?nameX .
    ?y foaf:name ?nameY .
    OPTIONAL { ?y foaf:nick ?nickY }
  }
    Results
    data/extracted-examples/result-10.2-r1.ttl
    
    Extracted: Constructing an Output Graph 
    Data
    
      data/extracted-examples/data-10.3.ttl
    
    # Constructing an Output Graph
@prefix  foaf:  <http://xmlns.com/foaf/0.1/> .
_:a    foaf:name   "Alice" .
_:a    foaf:mbox   <mailto:alice@example.org> .
    Query
      data/extracted-examples/query-10.3.rq
    # Constructing an Output Graph
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
PREFIX vcard:   <http://www.w3.org/2001/vcard-rdf/3.0#>
CONSTRUCT   { <http://example.org/person#Alice> vcard:FN ?name }
WHERE       { ?x foaf:name ?name }
    Results
    data/extracted-examples/result-10.3.ttl
    
    Extracted: Templates with Blank Nodes 
    Data
    
      data/extracted-examples/data-10.3.1.ttl
    
    # Templates with Blank Nodes
@prefix  foaf:  <http://xmlns.com/foaf/0.1/> .
_:a    foaf:givenname   "Alice" .
_:a    foaf:family_name "Hacker" .
_:b    foaf:firstname   "Bob" .
_:b    foaf:surname     "Hacker" .
    Query
      data/extracted-examples/query-10.3.1.rq
    # Templates with Blank Nodes
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
PREFIX vcard:   <http://www.w3.org/2001/vcard-rdf/3.0#>
CONSTRUCT { ?x  vcard:N _:v .
            _:v vcard:givenName ?gname .
            _:v vcard:familyName ?fname }
WHERE
 {
    { ?x foaf:firstname ?gname } UNION  { ?x foaf:givenname   ?gname } .
    { ?x foaf:surname   ?fname } UNION  { ?x foaf:family_name ?fname } .
 }
    Results
    data/extracted-examples/result-10.3.1.ttl
    
    Extracted: Accessing Graphs in the RDF Dataset 
    Query
      data/extracted-examples/query-10.3.2.rq
    # Accessing Graphs in the RDF Dataset
CONSTRUCT { ?s ?p ?o } WHERE { GRAPH <http://example.org/aGraph> { ?s ?p ?o } . }
    
    Extracted: Accessing Graphs in the RDF Dataset 
    Query
      data/extracted-examples/query-10.3.2-q1.rq
    # Accessing Graphs in the RDF Dataset
PREFIX  dc: <http://purl.org/dc/elements/1.1/>
PREFIX app: <http://example.org/ns#>
CONSTRUCT { ?s ?p ?o } WHERE
 {
   GRAPH ?g { ?s ?p ?o } .
   { ?g dc:publisher <http://www.w3.org/> } .
   { ?g dc:date ?date } .
   FILTER ( app:customDate(?date) > "2005-02-28T00:00:00Z"^^xsd:dateTime ) .
 }
    
    Extracted: Solution Modifiers and CONSTRUCT 
    Data
    
      data/extracted-examples/data-10.3.3.ttl
    
    # Solution Modifiers and CONSTRUCT
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix site: <http://example.org/stats#> .
_:a foaf:name "Alice" .
_:a site:hits 2349 .
_:b foaf:name "Bob" .
_:b site:hits 105 .
_:c foaf:name "Eve" .
_:c site:hits 181 .
    Query
      data/extracted-examples/query-10.3.3.rq
    # Solution Modifiers and CONSTRUCT
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX site: <http://example.org/stats#>
CONSTRUCT { [] foaf:name ?name }
WHERE
{ [] foaf:name ?name ;
     site:hits ?hits .
}
ORDER BY desc(?hits)
LIMIT 2
    Results
    data/extracted-examples/result-10.3.3.ttl
    
    Extracted: Explicit IRIs 
    Query
      data/extracted-examples/query-10.4.1.rq
    # Explicit IRIs
DESCRIBE <http://example.org/>
    
    Extracted: Identifying Resources 
    Query
      data/extracted-examples/query-10.4.2.rq
    # Identifying Resources
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
DESCRIBE ?x
WHERE    { ?x foaf:mbox <mailto:alice@org> }
    
    Extracted: Identifying Resources 
    Query
      data/extracted-examples/query-10.4.2-q1.rq
    # Identifying Resources
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
DESCRIBE ?x
WHERE    { ?x foaf:name "Alice" }
    
    Extracted: Identifying Resources 
    Query
      data/extracted-examples/query-10.4.2-q2.rq
    # Identifying Resources
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
DESCRIBE ?x ?y <http://example.org/>
WHERE    {?x foaf:knows ?y}
    
    Extracted: Descriptions of Resources 
    Query
      data/extracted-examples/query-10.4.3.rq
    # Descriptions of Resources
PREFIX ent:  <http://org.example.com/employees#>
DESCRIBE ?x WHERE { ?x ent:employeeId "1234" }
    Results
    data/extracted-examples/result-10.4.3.ttl
    
    Extracted: Asking 'yes or no' questions 
    Data
    
      data/extracted-examples/data-10.5.ttl
    
    # Asking 'yes or no' questions
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice" .
_:a  foaf:homepage   <http://work.example.org/alice/> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       <mailto:bob@work.example> .
    Query
      data/extracted-examples/query-10.5.rq
    # Asking 'yes or no' questions
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
ASK  { ?x foaf:name  "Alice" }
    Results
    data/extracted-examples/true.ttl
    
    
    Extracted: Asking 'yes or no' questions 
    Data
    
      data/extracted-examples/data-10.5.ttl
    
    # Asking 'yes or no' questions
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice" .
_:a  foaf:homepage   <http://work.example.org/alice/> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       <mailto:bob@work.example> .
    Query
      data/extracted-examples/query-10.5.rq
    # Asking 'yes or no' questions
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
ASK  { ?x foaf:name  "Alice" }
    Results
    data/extracted-examples/result-10.5-r1.ttl
    
    Extracted: Asking 'yes or no' questions 
    Data
    
      data/extracted-examples/data-10.5.ttl
    
    # Asking 'yes or no' questions
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice" .
_:a  foaf:homepage   <http://work.example.org/alice/> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       <mailto:bob@work.example> .
    Query
      data/extracted-examples/query-10.5-q1.rq
    # Asking 'yes or no' questions
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
ASK  { ?x foaf:name  "Alice" ;
          foaf:mbox  <mailto:alice@work.example> }
    Results
    data/extracted-examples/false.ttl
    
    
    Extracted: Testing Values 
    Data
    
      data/extracted-examples/data-11.ttl
    
    # Testing Values
@prefix a:          <http://www.w3.org/2000/10/annotation-ns#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
_:a   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:a   dc:date       "2004-12-31T19:00:00-05:00" .
_:b   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:b   dc:date       "2004-12-31T19:01:00-05:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
    Query
      data/extracted-examples/query-11.rq
    # Testing Values
PREFIX a:      <http://www.w3.org/2000/10/annotation-ns#>
PREFIX dc:     <http://purl.org/dc/elements/1.1/>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?annot
WHERE { ?annot  a:annotates  <http://www.w3.org/TR/rdf-sparql-query/> .
        ?annot  dc:date      ?date .
        FILTER ( ?date > "2005-01-01T00:00:00Z"^^xsd:dateTime ) }
    
    Extracted: bound 
    Data
    
      data/extracted-examples/data-11.4.1.ttl
    
    # bound
@prefix foaf:        <http://xmlns.com/foaf/0.1/> .
@prefix dc:          <http://purl.org/dc/elements/1.1/> .
@prefix xsd:          <http://www.w3.org/2001/XMLSchema#> .
_:a  foaf:givenName  "Alice".
_:b  foaf:givenName  "Bob" .
_:b  dc:date         "2005-04-04T04:04:04Z"^^xsd:dateTime .
    Query
      data/extracted-examples/query-11.4.1.rq
    # bound
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>
PREFIX xsd:   <http://www.w3.org/2001/XMLSchema#>
SELECT ?name
 WHERE { ?x foaf:givenName  ?name .
         OPTIONAL { ?x dc:date ?date } .
         FILTER ( bound(?date) ) }
    Results
    data/extracted-examples/result-11.4.1.ttl
    
    
    Extracted: bound 
    Data
    
      data/extracted-examples/data-11.4.1.ttl
    
    # bound
@prefix foaf:        <http://xmlns.com/foaf/0.1/> .
@prefix dc:          <http://purl.org/dc/elements/1.1/> .
@prefix xsd:          <http://www.w3.org/2001/XMLSchema#> .
_:a  foaf:givenName  "Alice".
_:b  foaf:givenName  "Bob" .
_:b  dc:date         "2005-04-04T04:04:04Z"^^xsd:dateTime .
    Query
      data/extracted-examples/query-11.4.1-q1.rq
    # bound
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc:   <http://purl.org/dc/elements/1.1/>
SELECT ?name
 WHERE { ?x foaf:givenName  ?name .
         OPTIONAL { ?x dc:date ?date } .
         FILTER (!bound(?date)) }
    Results
    data/extracted-examples/result-11.4.1-r1.ttl
    
    
    Extracted: isIRI 
    Data
    
      data/extracted-examples/data-11.4.2.ttl
    
    # isIRI
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       "bob@work.example" .
    Query
      data/extracted-examples/query-11.4.2.rq
    # isIRI
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
            foaf:mbox  ?mbox .
         FILTER isIRI(?mbox) }
    Results
    data/extracted-examples/result-11.4.2.ttl
    
      
        | name | mbox | 
|---|
      | "Alice" | <mailto:alice@work.example> | 
      
    
    
    Extracted: isBlank 
    Data
    
      data/extracted-examples/data-11.4.3.ttl
    
    # isBlank
@prefix a:          <http://www.w3.org/2000/10/annotation-ns#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:a   dc:creator    "Alice B. Toeclips" .
_:b   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:b   dc:creator    _:c .
_:c   foaf:given    "Bob".
_:c   foaf:family   "Smith".
    Query
      data/extracted-examples/query-11.4.3.rq
    # isBlank
PREFIX a:      <http://www.w3.org/2000/10/annotation-ns#>
PREFIX dc:     <http://purl.org/dc/elements/1.1/>
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?given ?family
 WHERE { ?annot  a:annotates  <http://www.w3.org/TR/rdf-sparql-query/> .
         ?annot  dc:creator   ?c .
         OPTIONAL { ?c  foaf:given   ?given ; foaf:family  ?family } .
         FILTER isBlank(?c)
       }
    Results
    data/extracted-examples/result-11.4.3.ttl
    
    
    Extracted: isLiteral 
    Data
    
      data/extracted-examples/data-11.4.4.ttl
    
    # isLiteral
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       "bob@work.example" .
    Query
      data/extracted-examples/query-11.4.4.rq
    # isLiteral
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
           foaf:mbox  ?mbox .
         FILTER isLiteral(?mbox) }
    Results
    data/extracted-examples/result-11.4.4.ttl
    
      
        | mbox | name | 
|---|
      | "bob@work.example" | "Bob" | 
      
    
    
    Extracted: str 
    Data
    
      data/extracted-examples/data-11.4.5.ttl
    
    # str
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Bob" .
_:b  foaf:mbox       <mailto:bob@home.example> .
    Query
      data/extracted-examples/query-11.4.5.rq
    # str
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
            foaf:mbox  ?mbox .
         FILTER regex(str(?mbox), "@work.example") }
    Results
    data/extracted-examples/result-11.4.5.ttl
    
      
        | mbox | name | 
|---|
      | <mailto:alice@work.example> | "Alice" | 
      
    
    
    Extracted: lang 
    Data
    
      data/extracted-examples/data-11.4.6.ttl
    
    # lang
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Robert"@EN.
_:a  foaf:name       "Roberto"@ES.
_:a  foaf:mbox       <mailto:bob@work.example> .
    Query
      data/extracted-examples/query-11.4.6.rq
    # lang
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
 WHERE { ?x foaf:name  ?name ;
            foaf:mbox  ?mbox .
         FILTER ( lang(?name) = "ES" ) }
    Results
    data/extracted-examples/result-11.4.6.ttl
    
      
        | mbox | name | 
|---|
      | <mailto:bob@work.example> | "Roberto" | 
      
    
    
    Extracted: datatype 
    Data
    
      data/extracted-examples/data-11.4.7.ttl
    
    # datatype
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix eg:         <http://biometrics.example/ns#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a  foaf:name       "Alice".
_:a  eg:shoeSize     "9.5"^^xsd:float .
_:b  foaf:name       "Bob".
_:b  eg:shoeSize     "42"^^xsd:integer .
    Query
      data/extracted-examples/query-11.4.7.rq
    # datatype
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX eg:   <http://biometrics.example/ns#>
SELECT ?name ?size
 WHERE { ?x foaf:name  ?name ; eg:shoeSize  ?size .
         FILTER ( datatype(?size) = xsd:integer ) }
    Results
    data/extracted-examples/result-11.4.7.ttl
    
    
    Extracted: RDFterm-equal 
    Data
    
      data/extracted-examples/data-11.4.10.ttl
    
    # RDFterm-equal
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice".
_:a  foaf:mbox       <mailto:alice@work.example> .
_:b  foaf:name       "Ms A.".
_:b  foaf:mbox       <mailto:alice@work.example> .
    Query
      data/extracted-examples/query-11.4.10.rq
    # RDFterm-equal
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name1 ?name2
 WHERE { ?x foaf:name  ?name1 ;
            foaf:mbox  ?mbox1 .
         ?y foaf:name  ?name2 ;
            foaf:mbox  ?mbox2 .
         FILTER (?mbox1 = ?mbox2 && ?name1 != ?name2)
       }
    Results
    data/extracted-examples/result-11.4.10.ttl
    
      
        | name1 | name2 | 
|---|
      | "Alice" | "Ms A." | 
      | "Ms A." | "Alice" | 
      
    
    
    Extracted: RDFterm-equal 
    Data
    
      data/extracted-examples/data-11.4.10-d1.ttl
    
    # RDFterm-equal
@prefix a:          <http://www.w3.org/2000/10/annotation-ns#> .
@prefix dc:         <http://purl.org/dc/elements/1.1/> .
_:b   a:annotates   <http://www.w3.org/TR/rdf-sparql-query/> .
_:b   dc:date       "2004-12-31T19:00:00-05:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
    Query
      data/extracted-examples/query-11.4.10-q1.rq
    # RDFterm-equal
PREFIX a:      <http://www.w3.org/2000/10/annotation-ns#>
PREFIX dc:     <http://purl.org/dc/elements/1.1/>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?annotates
WHERE { ?annot  a:annotates  ?annotates .
        ?annot  dc:date      ?date .
        FILTER ( ?date = xsd:dateTime("2004-01-01T00:00:00Z") || ?date = xsd:dateTime("2005-01-01T00:00:00Z") ) }
    Results
    data/extracted-examples/result-11.4.10-r1.ttl
    
      
        | annotates | 
|---|
      | <http://www.w3.org/TR/rdf-sparql-query/> | 
      
    
    
    Extracted: langMatches 
    Data
    
      data/extracted-examples/data-11.4.11.ttl
    
    # langMatches
@prefix dc:       <http://purl.org/dc/elements/1.1/> .
_:a  dc:title         "That Seventies Show"@en .
_:a  dc:title         "Cette Série des Années Soixante-dix"@fr .
_:a  dc:title         "Cette Série des Années Septante"@fr-BE .
_:b  dc:title         "Il Buono, il Bruto, il Cattivo" .
    Query
      data/extracted-examples/query-11.4.11.rq
    # langMatches
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?title
 WHERE { ?x dc:title  "That Seventies Show"@en ;
            dc:title  ?title .
         FILTER langMatches( lang(?title), "FR" ) }
    Results
    data/extracted-examples/result-11.4.11.ttl
    
      
        | title | 
|---|
      | "Cette Série des Années Septante" | 
      | "Cette Série des Années Soixante-dix" | 
      
    
    
    Extracted: langMatches 
    Data
    
      data/extracted-examples/data-11.4.11.ttl
    
    # langMatches
@prefix dc:       <http://purl.org/dc/elements/1.1/> .
_:a  dc:title         "That Seventies Show"@en .
_:a  dc:title         "Cette Série des Années Soixante-dix"@fr .
_:a  dc:title         "Cette Série des Années Septante"@fr-BE .
_:b  dc:title         "Il Buono, il Bruto, il Cattivo" .
    Query
      data/extracted-examples/query-11.4.11-q1.rq
    # langMatches
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?title
 WHERE { ?x dc:title  ?title .
         FILTER langMatches( lang(?title), "*" ) }
    Results
    data/extracted-examples/result-11.4.11-r1.ttl
    
      
        | title | 
|---|
      | "Cette Série des Années Septante" | 
      | "Cette Série des Années Soixante-dix" | 
      | "That Seventies Show" | 
      
    
    
    Extracted: regex 
    Data
    
      data/extracted-examples/data-11.4.12.ttl
    
    # regex
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a  foaf:name       "Alice".
_:b  foaf:name       "Bob" .
    Query
      data/extracted-examples/query-11.4.12.rq
    # regex
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name
 WHERE { ?x foaf:name  ?name
         FILTER regex(?name, "^ali", "i") }
    Results
    data/extracted-examples/result-11.4.12.ttl
    
    
    Extracted: Extensible Value Testing 
    Query
      data/extracted-examples/query-11.6.rq
    # Extensible Value Testing
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX func: <http://example.org/functions#>
SELECT ?name ?id
WHERE { ?x foaf:name  ?name ;
           func:empId   ?id .
        FILTER (func:even(?id)) }
    
    Extracted: Extensible Value Testing 
    Query
      data/extracted-examples/query-11.6-q1.rq
    # Extensible Value Testing
PREFIX aGeo: <http://example.org/geo#>
SELECT ?neighbor
WHERE { ?a aGeo:placeName "Grenoble" .
        ?a aGeo:location ?axLoc .
        ?a aGeo:location ?ayLoc .
        ?b aGeo:placeName ?neighbor .
        ?b aGeo:location ?bxLoc .
        ?b aGeo:location ?byLoc .
        FILTER ( aGeo:distance(?axLoc, ?ayLoc, ?bxLoc, ?byLoc) < 10 ) .
      }
    
    
    FILTER in BGP with matching triple pattern
    Data
    
      data/Filter/filter-data.n3
    
    @prefix ex: <http://example.org/> .
ex:s ex:p 1.
    Query
      data/Filter/dawg-filter-scope-001.rq
    PREFIX ex: <http://example.org/>
SELECT ?x
{
  ex:s ex:p ?x .
  FILTER(!bound(?x)) .
}
    Results
    data/Filter/filter-no-matches.n3
    
    
    
    FILTER as a sibling of a group containing BGP with matching triple pattern
    Data
    
      data/Filter/filter-data.n3
    
    @prefix ex: <http://example.org/> .
ex:s ex:p 1.
    Query
      data/Filter/dawg-filter-scope-002.rq
    PREFIX ex: <http://example.org/>
SELECT ?x
{
  { ex:s ex:p ?x . }
  FILTER(!bound(?x)) .
}
    Results
    data/Filter/filter-no-matches.n3
    
    
    FILTER inside a group which is a sibling of a BGP with matching triple pattern
    Data
    
      data/Filter/filter-data.n3
    
    @prefix ex: <http://example.org/> .
ex:s ex:p 1.
    Query
      data/Filter/dawg-filter-scope-003.rq
    PREFIX ex: <http://example.org/>
SELECT ?x
{
  ex:s ex:p ?x .
  { FILTER(!bound(?x)) . }
}
    Results
    data/Filter/filter-one-match.n3
    
    
    FILTER inside a group which is a sibling of a group containing BGP with matching triple pattern
    Data
    
      data/Filter/filter-data.n3
    
    @prefix ex: <http://example.org/> .
ex:s ex:p 1.
    Query
      data/Filter/dawg-filter-scope-004.rq
    PREFIX ex: <http://example.org/>
SELECT ?x
{
  { ex:s ex:p ?x . }
  { FILTER(!bound(?x)) . }
}
    Results
    data/Filter/filter-one-match.n3
    
    
    
    FILTER after a matching triple in a BGP
    Data
    
      data/Filter/filter-data.n3
    
    @prefix ex: <http://example.org/> .
ex:s ex:p 1.
    Query
      data/Filter/dawg-filter-order-001.rq
    PREFIX ex: <http://example.org/>
SELECT ?x
{
  ex:s ex:p ?x .
  FILTER(?x = 1) .
}
    Results
    data/Filter/filter-one-match.n3
    
    
    FILTER before a matching triple in a BGP
    Data
    
      data/Filter/filter-data.n3
    
    @prefix ex: <http://example.org/> .
ex:s ex:p 1.
    Query
      data/Filter/dawg-filter-order-002.rq
    PREFIX ex: <http://example.org/>
SELECT ?x
{
  FILTER(?x = 1) .
  ex:s ex:p ?x .
}
    Results
    data/Filter/filter-one-match.n3
    
    
    Data
    
      data/i18n/kanji.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
# See DOCUMENT INFO below.
# NAMESPACES
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix 食: <http://www.w3.org/2001/sw/DataAccess/tests/data/i18n/kanji.ttl#> .
# DOCUMENT INFO
<> rdfs:comment "test kanji IRIs (composed from QNames)" ;
   owl:versionInfo "$Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $".
# DOCUMENT
[ foaf:name "Alice" ;
  食:食べる 食:納豆 ] .
[ foaf:name "Bob" ;
  食:食べる 食:海老 ] .
    Query
      data/i18n/kanji-01.rq
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
# test kanji QNames
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX 食: <http://www.w3.org/2001/sw/DataAccess/tests/data/i18n/kanji.ttl#>
SELECT ?name ?food WHERE {
  [ foaf:name ?name ;
    食:食べる ?food ] . }
    Results
    data/i18n/kanji-01-results.ttl
    
    Data
    
      data/i18n/kanji.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
# See DOCUMENT INFO below.
# NAMESPACES
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix 食: <http://www.w3.org/2001/sw/DataAccess/tests/data/i18n/kanji.ttl#> .
# DOCUMENT INFO
<> rdfs:comment "test kanji IRIs (composed from QNames)" ;
   owl:versionInfo "$Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $".
# DOCUMENT
[ foaf:name "Alice" ;
  食:食べる 食:納豆 ] .
[ foaf:name "Bob" ;
  食:食べる 食:海老 ] .
    Query
      data/i18n/kanji-02.rq
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
# test wide spaces
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX 食: <http://www.w3.org/2001/sw/DataAccess/tests/data/i18n/kanji.ttl#>
SELECT ?name WHERE {
  [ foaf:name ?name ;
    食:食べる 食:海老 ] . }
    Results
    data/i18n/kanji-02-results.ttl
    
    Data
    
      data/i18n/normalization-01.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
# See DOCUMENT INFO below.
# NAMESPACES
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix HR: <http://www.w3.org/2001/sw/DataAccess/tests/data/i18n/normalization.ttl#> .
# DOCUMENT INFO
<> rdfs:comment "Normalized and non-normalized IRIs" ;
   owl:versionInfo "$Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $".
# DOCUMENT
[ foaf:name "Alice" ;
  HR:resumé "Alice's normalized resumé" ] .
[ foaf:name "Bob" ;
  HR:resumé "Bob's non-normalized resumé" ] .
[ foaf:name "Eve" ;
  HR:resumé "Eve's normalized resumé" ;
  HR:resumé "Eve's non-normalized resumé" ] .
    Query
      data/i18n/normalization-01.rq
    # Figure out what happens with normalization form C.
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX HR: <http://www.w3.org/2001/sw/DataAccess/tests/data/i18n/normalization.ttl#>
SELECT ?name
 WHERE { [ foaf:name ?name;
           HR:resumé ?resume ] . }
    Results
    data/i18n/normalization-01-results.ttl
    
    
    
    Example 1 from http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096
    Data
    
      data/i18n/normalization-02.ttl
    
    # Example 1 from
# http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix : <http://example/vocab#>.
:s1 :p <example://a/b/c/%7Bfoo%7D#xyz>.
:s2 :p <eXAMPLE://a/./b/../b/%63/%7bfoo%7d#xyz>.
    Query
      data/i18n/normalization-02.rq
    # Example 1 from
# http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX : <http://example/vocab#>
PREFIX p1: <eXAMPLE://a/./b/../b/%63/%7bfoo%7d#>
SELECT ?S WHERE { ?S :p p1:xyz }
    Results
    data/i18n/normalization-02-results.ttl
    
      
        | S | 
|---|
      | <http://example/vocab#s2> | 
      
    
    
    
    Example 2 from http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096
    Data
    
      data/i18n/normalization-03.ttl
    
    # Example 1 from
# http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix : <http://example/vocab#>.
:s3 :p <http://example.com:80/#abc>.
:s4 :p <http://example.com/#abc>.
:s5 :p <http://example.com/#abc>.
    Query
      data/i18n/normalization-03.rq
    # Example 2 from
# http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JulSep/0096
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX : <http://example/vocab#>
PREFIX p2: <http://example.com:80/#>
SELECT ?S WHERE { ?S :p p2:abc }
    Results
    data/i18n/normalization-03-results.ttl
    
      
        | S | 
|---|
      | <http://example/vocab#s3> | 
      
    
    
    
    graph match - no lexical form in data (assumes no value matching)
    Data
    
      data/OpenWorld/data-1.ttl
    
    @prefix t: <http://example/t#> .
@prefix :  <http://example/ns#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "a"^^t:type1 .
:x2 :p "b"^^t:type1 .
:y1 :p "a"^^t:type2 .
:y2 :p "b"^^t:type2 .
:z1 :p 1 .
:z2 :p "01"^^xsd:integer .
:z3 :p 2 .
:z4 :p "02"^^xsd:integer .
    Query
      data/OpenWorld/open-eq-01.rq
    # SPARQL is defined over simple entailment so
# only syntactic matches show.
# (Some systems may match because they do
# value-based matching in the graph (D-entailment))
# Does not strictly match "1"^xsd:integer
PREFIX  :       <http://example/ns#>
PREFIX  t:      <http://example/t#>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{ ?x :p "001"^^xsd:integer }
    Results
    data/OpenWorld/open-eq-01-result.srx
    
    
    graph match - unknown type
    Data
    
      data/OpenWorld/data-1.ttl
    
    @prefix t: <http://example/t#> .
@prefix :  <http://example/ns#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "a"^^t:type1 .
:x2 :p "b"^^t:type1 .
:y1 :p "a"^^t:type2 .
:y2 :p "b"^^t:type2 .
:z1 :p 1 .
:z2 :p "01"^^xsd:integer .
:z3 :p 2 .
:z4 :p "02"^^xsd:integer .
    Query
      data/OpenWorld/open-eq-02.rq
    # Test matching in a graph pattern
# Unknown type
PREFIX  :       <http://example/ns#>
PREFIX  t:      <http://example/t#>
SELECT *
{ ?x :p "a"^^t:type1 }
    Results
    data/OpenWorld/open-eq-02-result.srx
    
    
    Filter(?v=1)
    Data
    
      data/OpenWorld/data-1.ttl
    
    @prefix t: <http://example/t#> .
@prefix :  <http://example/ns#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "a"^^t:type1 .
:x2 :p "b"^^t:type1 .
:y1 :p "a"^^t:type2 .
:y2 :p "b"^^t:type2 .
:z1 :p 1 .
:z2 :p "01"^^xsd:integer .
:z3 :p 2 .
:z4 :p "02"^^xsd:integer .
    Query
      data/OpenWorld/open-eq-03.rq
    # SPARQL FILTER test by value.
# A processor knows about XSD integer
# so 1 and 01 pass the filter
PREFIX  :       <http://example/ns#>
PREFIX  t:      <http://example/t#>
PREFIX  rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{ ?x :p ?v
  FILTER ( ?v = 1 )
}
    Results
    data/OpenWorld/open-eq-03-result.srx
    
    
    Filter(?v!=1)
    Data
    
      data/OpenWorld/data-1.ttl
    
    @prefix t: <http://example/t#> .
@prefix :  <http://example/ns#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "a"^^t:type1 .
:x2 :p "b"^^t:type1 .
:y1 :p "a"^^t:type2 .
:y2 :p "b"^^t:type2 .
:z1 :p 1 .
:z2 :p "01"^^xsd:integer .
:z3 :p 2 .
:z4 :p "02"^^xsd:integer .
    Query
      data/OpenWorld/open-eq-04.rq
    # SPARQL FILTER test by value.
# A processor knows about XSD integer
# so 1 and 01 are excluded by the filter
PREFIX  :       <http://example/ns#>
PREFIX  t:      <http://example/t#>
PREFIX  rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{ ?x :p ?v
  FILTER ( ?v != 1 )
}
    Results
    data/OpenWorld/open-eq-04-result.srx
    
    
    FILTER(?v = unknown type)
    Data
    
      data/OpenWorld/data-1.ttl
    
    @prefix t: <http://example/t#> .
@prefix :  <http://example/ns#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "a"^^t:type1 .
:x2 :p "b"^^t:type1 .
:y1 :p "a"^^t:type2 .
:y2 :p "b"^^t:type2 .
:z1 :p 1 .
:z2 :p "01"^^xsd:integer .
:z3 :p 2 .
:z4 :p "02"^^xsd:integer .
    Query
      data/OpenWorld/open-eq-05.rq
    # SPARQL FILTER test by value.
# Only one valus is known to be "a"^^t:type1
# (others maybe but the processor does not positively know this)
PREFIX  :       <http://example/ns#>
PREFIX  t:      <http://example/t#>
SELECT *
{ ?x :p ?v
  FILTER ( ?v = "a"^^t:type1 )
}
    Results
    data/OpenWorld/open-eq-05-result.srx
    
    
    FILTER(?v != unknown type)
    Data
    
      data/OpenWorld/data-1.ttl
    
    @prefix t: <http://example/t#> .
@prefix :  <http://example/ns#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "a"^^t:type1 .
:x2 :p "b"^^t:type1 .
:y1 :p "a"^^t:type2 .
:y2 :p "b"^^t:type2 .
:z1 :p 1 .
:z2 :p "01"^^xsd:integer .
:z3 :p 2 .
:z4 :p "02"^^xsd:integer .
    Query
      data/OpenWorld/open-eq-06.rq
    # SPARQL FILTER test by value for known types.
# Nothing is known to be not the same value as  "a"^^t:type1
#  "b"^^t:type1 might be a different lexical form for the same value
#  "a"^^t:type2 might have overlapping value spaces for this lexicial form.
PREFIX  :       <http://example/ns#>
PREFIX  t:      <http://example/t#>
SELECT *
{ ?x :p ?v
  FILTER ( ?v != "a"^^t:type1 )
}
    Results
    data/OpenWorld/open-eq-06-result.srx
    
    Test of '=' 
    Data
    
      data/OpenWorld/data-2.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "xyz" .
:x2 :p "xyz"@en .
:x3 :p "xyz"@EN .
:x4 :p "xyz"^^xsd:string .
:x5 :p "xyz"^^xsd:integer .
:x6 :p "xyz"^^:unknown .
:x7 :p _:xyz .
:x8 :p :xyz .
:y1 :q "abc" .
:y2 :q "abc"@en .
:y3 :q "abc"@EN .
:y4 :q "abc"^^xsd:string .
:y5 :q "abc"^^xsd:integer .
:y6 :q "abc"^^:unknown .
:y7 :q _:abc .
:y8 :q :abc .
    Query
      data/OpenWorld/open-eq-07.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x1 :p ?v1 .
    ?x2 :p ?v2 .
    FILTER ( ?v1 = ?v2 )
}
ORDER BY ?x1 ?x2
    Results
    data/OpenWorld/open-eq-07-result.srx
    
    Test of '!='
    Data
    
      data/OpenWorld/data-2.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "xyz" .
:x2 :p "xyz"@en .
:x3 :p "xyz"@EN .
:x4 :p "xyz"^^xsd:string .
:x5 :p "xyz"^^xsd:integer .
:x6 :p "xyz"^^:unknown .
:x7 :p _:xyz .
:x8 :p :xyz .
:y1 :q "abc" .
:y2 :q "abc"@en .
:y3 :q "abc"@EN .
:y4 :q "abc"^^xsd:string .
:y5 :q "abc"^^xsd:integer .
:y6 :q "abc"^^:unknown .
:y7 :q _:abc .
:y8 :q :abc .
    Query
      data/OpenWorld/open-eq-08.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x1 :p ?v1 .
    ?x2 :p ?v2 .
    FILTER ( ?v1 != ?v2 )
}
ORDER BY ?x1 ?x2
    Results
    data/OpenWorld/open-eq-08-result.srx
    
    Test of '='
    Data
    
      data/OpenWorld/data-2.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "xyz" .
:x2 :p "xyz"@en .
:x3 :p "xyz"@EN .
:x4 :p "xyz"^^xsd:string .
:x5 :p "xyz"^^xsd:integer .
:x6 :p "xyz"^^:unknown .
:x7 :p _:xyz .
:x8 :p :xyz .
:y1 :q "abc" .
:y2 :q "abc"@en .
:y3 :q "abc"@EN .
:y4 :q "abc"^^xsd:string .
:y5 :q "abc"^^xsd:integer .
:y6 :q "abc"^^:unknown .
:y7 :q _:abc .
:y8 :q :abc .
    Query
      data/OpenWorld/open-eq-09.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x :p ?v1 .
    ?y :q ?v2 .
    FILTER ( ?v1 = ?v2 )
}
ORDER BY ?x ?y
    Results
    data/OpenWorld/open-eq-09-result.srx
    
    Test of '!='
    Data
    
      data/OpenWorld/data-2.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "xyz" .
:x2 :p "xyz"@en .
:x3 :p "xyz"@EN .
:x4 :p "xyz"^^xsd:string .
:x5 :p "xyz"^^xsd:integer .
:x6 :p "xyz"^^:unknown .
:x7 :p _:xyz .
:x8 :p :xyz .
:y1 :q "abc" .
:y2 :q "abc"@en .
:y3 :q "abc"@EN .
:y4 :q "abc"^^xsd:string .
:y5 :q "abc"^^xsd:integer .
:y6 :q "abc"^^:unknown .
:y7 :q _:abc .
:y8 :q :abc .
    Query
      data/OpenWorld/open-eq-10.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x :p ?v1 .
    ?y :q ?v2 .
    FILTER ( ?v1 != ?v2 )
}
ORDER BY ?x ?y
    Results
    data/OpenWorld/open-eq-10-result.srx
    
    test of '=' || '!='
    Data
    
      data/OpenWorld/data-2.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "xyz" .
:x2 :p "xyz"@en .
:x3 :p "xyz"@EN .
:x4 :p "xyz"^^xsd:string .
:x5 :p "xyz"^^xsd:integer .
:x6 :p "xyz"^^:unknown .
:x7 :p _:xyz .
:x8 :p :xyz .
:y1 :q "abc" .
:y2 :q "abc"@en .
:y3 :q "abc"@EN .
:y4 :q "abc"^^xsd:string .
:y5 :q "abc"^^xsd:integer .
:y6 :q "abc"^^:unknown .
:y7 :q _:abc .
:y8 :q :abc .
    Query
      data/OpenWorld/open-eq-11.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x :p ?v1 .
    ?y :q ?v2 .
    FILTER ( ?v1 != ?v2 || ?v1 = ?v2 )
}
ORDER BY ?x ?y
    Results
    data/OpenWorld/open-eq-11-result.srx
    
    find pairs that don't value-compare
    Data
    
      data/OpenWorld/data-2.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p "xyz" .
:x2 :p "xyz"@en .
:x3 :p "xyz"@EN .
:x4 :p "xyz"^^xsd:string .
:x5 :p "xyz"^^xsd:integer .
:x6 :p "xyz"^^:unknown .
:x7 :p _:xyz .
:x8 :p :xyz .
:y1 :q "abc" .
:y2 :q "abc"@en .
:y3 :q "abc"@EN .
:y4 :q "abc"^^xsd:string .
:y5 :q "abc"^^xsd:integer .
:y6 :q "abc"^^:unknown .
:y7 :q _:abc .
:y8 :q :abc .
    Query
      data/OpenWorld/open-eq-12.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x ?v1 ?y ?v2
{
    ?x :p ?v1 .
    ?y :p ?v2 .
    OPTIONAL { ?y :p ?v3 . FILTER( ?v1 != ?v3 || ?v1 = ?v3 )}
    FILTER (!bound(?v3))
}
ORDER BY ?x ?y
    Results
    data/OpenWorld/open-eq-12-result.srx
    
    Added type : xsd:date '='
    Data
    
      data/OpenWorld/data-3.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:dt1 :r "2006-08-23T09:00:00+01:00"^^xsd:dateTime .
:d1 :r "2006-08-23"^^xsd:date .
:d2 :r "2006-08-23Z"^^xsd:date .
:d3 :r "2006-08-23+00:00"^^xsd:date .
:d4 :r "2001-01-01"^^xsd:date .
:d5 :r "2001-01-01Z"^^xsd:date .
:d6 :s "2006-08-23"^^xsd:date .
:d7 :s "2006-08-24Z"^^xsd:date .
:d8 :s "2000-01-01"^^xsd:date .
    Query
      data/OpenWorld/date-1.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x :r ?v .
    FILTER ( ?v = "2006-08-23"^^xsd:date )
}
    Results
    data/OpenWorld/date-1-result.srx
    
    Added type : xsd:date '!='
    Data
    
      data/OpenWorld/data-3.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:dt1 :r "2006-08-23T09:00:00+01:00"^^xsd:dateTime .
:d1 :r "2006-08-23"^^xsd:date .
:d2 :r "2006-08-23Z"^^xsd:date .
:d3 :r "2006-08-23+00:00"^^xsd:date .
:d4 :r "2001-01-01"^^xsd:date .
:d5 :r "2001-01-01Z"^^xsd:date .
:d6 :s "2006-08-23"^^xsd:date .
:d7 :s "2006-08-24Z"^^xsd:date .
:d8 :s "2000-01-01"^^xsd:date .
    Query
      data/OpenWorld/date-2.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x :r ?v .
    FILTER ( ?v != "2006-08-23"^^xsd:date )
}
    Results
    data/OpenWorld/date-2-result.srx
    
    Added type : xsd:date '>'
    Data
    
      data/OpenWorld/data-3.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:dt1 :r "2006-08-23T09:00:00+01:00"^^xsd:dateTime .
:d1 :r "2006-08-23"^^xsd:date .
:d2 :r "2006-08-23Z"^^xsd:date .
:d3 :r "2006-08-23+00:00"^^xsd:date .
:d4 :r "2001-01-01"^^xsd:date .
:d5 :r "2001-01-01Z"^^xsd:date .
:d6 :s "2006-08-23"^^xsd:date .
:d7 :s "2006-08-24Z"^^xsd:date .
:d8 :s "2000-01-01"^^xsd:date .
    Query
      data/OpenWorld/date-3.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
    ?x :r ?v .
    FILTER ( ?v > "2006-08-22"^^xsd:date )
}
    Results
    data/OpenWorld/date-3-result.srx
    
    xsd:date ORDER BY
    Data
    
      data/OpenWorld/data-3.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:dt1 :r "2006-08-23T09:00:00+01:00"^^xsd:dateTime .
:d1 :r "2006-08-23"^^xsd:date .
:d2 :r "2006-08-23Z"^^xsd:date .
:d3 :r "2006-08-23+00:00"^^xsd:date .
:d4 :r "2001-01-01"^^xsd:date .
:d5 :r "2001-01-01Z"^^xsd:date .
:d6 :s "2006-08-23"^^xsd:date .
:d7 :s "2006-08-24Z"^^xsd:date .
:d8 :s "2000-01-01"^^xsd:date .
    Query
      data/OpenWorld/date-4.rq
    PREFIX     :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x ?date
{
    ?x :s ?date .
    FILTER ( datatype(?date) = xsd:date )
}
ORDER BY ?date
    Results
    data/OpenWorld/date-4-result.srx
    
    Find things that compare with < or >
    Data
    
      data/OpenWorld/data-4.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p [ :v1 "v1" ; :v2 "v2" ] .
:x2 :p [ :v1 1 ; :v2 "v2" ] .
:x3 :p [ :v1 "x"^^:unknown ; :v2 "x"^^:unknown ] .
:x4 :p [ :v1 <test:abc> ; :v2 <test:abc> ] .
:x5 :p [ :v1 "2006-08-23T09:00:00+01:00"^^xsd:dateTime ;
         :v2 "2006-08-22"^^xsd:date ].
    Query
      data/OpenWorld/open-cmp-01.rq
    PREFIX      :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x ?v1 ?v2
{
    ?x :p [ :v1 ?v1 ; :v2 ?v2 ] .
    FILTER ( ?v1 < ?v2 || ?v1 > ?v2 )
}
    Results
    data/OpenWorld/open-cmp-01-result.srx
    
    Find things that compare with <= and >
    Data
    
      data/OpenWorld/data-4.ttl
    
    @prefix     : <http://example/> .
@prefix  xsd:    <http://www.w3.org/2001/XMLSchema#> .
:x1 :p [ :v1 "v1" ; :v2 "v2" ] .
:x2 :p [ :v1 1 ; :v2 "v2" ] .
:x3 :p [ :v1 "x"^^:unknown ; :v2 "x"^^:unknown ] .
:x4 :p [ :v1 <test:abc> ; :v2 <test:abc> ] .
:x5 :p [ :v1 "2006-08-23T09:00:00+01:00"^^xsd:dateTime ;
         :v2 "2006-08-22"^^xsd:date ].
    Query
      data/OpenWorld/open-cmp-02.rq
    PREFIX      :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?x ?v1 ?v2
{
    ?x :p [ :v1 ?v1 ; :v2 ?v2 ] .
    FILTER ( ?v1 <= ?v2 || ?v1 > ?v2 )
}
    Results
    data/OpenWorld/open-cmp-02-result.srx
    
    One optional clause
    Data
    
      data/Optional/data.ttl
    
    @prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a foaf:mbox   <mailto:alice@example.net> .
_:a foaf:name   "Alice" .
_:a foaf:nick   "WhoMe?" .
_:b foaf:mbox   <mailto:bert@example.net> .
_:b foaf:name   "Bert" .
_:e foaf:mbox   <mailto:eve@example.net> .
_:e foaf:nick   "DuckSoup" .
    Query
      data/Optional/q-opt-1.rq
    PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?mbox ?name
   {
     ?x foaf:mbox ?mbox .
     OPTIONAL { ?x foaf:name  ?name } .
   }
    Results
    data/Optional/result-opt-1.ttl
    
      
        | name | mbox | 
|---|
      |  | <mailto:eve@example.net> | 
      | "Alice" | <mailto:alice@example.net> | 
      | "Bert" | <mailto:bert@example.net> | 
      
    
    
    One optional clause
    Data
    
      data/Optional/data.ttl
    
    @prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a foaf:mbox   <mailto:alice@example.net> .
_:a foaf:name   "Alice" .
_:a foaf:nick   "WhoMe?" .
_:b foaf:mbox   <mailto:bert@example.net> .
_:b foaf:name   "Bert" .
_:e foaf:mbox   <mailto:eve@example.net> .
_:e foaf:nick   "DuckSoup" .
    Query
      data/Optional/q-opt-2.rq
    PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?mbox ?name ?nick
   {
     ?x foaf:mbox ?mbox .
     OPTIONAL { ?x foaf:name  ?name } .
     OPTIONAL { ?x foaf:nick  ?nick } .
   }
    Results
    data/Optional/result-opt-2.ttl
    
      
        | name | nick | mbox | 
|---|
      | "Bert" |  | <mailto:bert@example.net> | 
      | "Alice" | "WhoMe?" | <mailto:alice@example.net> | 
      |  | "DuckSoup" | <mailto:eve@example.net> | 
      
    
    
    Union is not optional
    Data
    
      data/Optional/data.ttl
    
    @prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a foaf:mbox   <mailto:alice@example.net> .
_:a foaf:name   "Alice" .
_:a foaf:nick   "WhoMe?" .
_:b foaf:mbox   <mailto:bert@example.net> .
_:b foaf:name   "Bert" .
_:e foaf:mbox   <mailto:eve@example.net> .
_:e foaf:nick   "DuckSoup" .
    Query
      data/Optional/q-opt-3.rq
    PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>
SELECT ?mbox ?name
   {
     { ?x foaf:mbox ?mbox }
   UNION
     { ?x foaf:mbox ?mbox . ?x foaf:name  ?name }
   }
    Results
    data/Optional/result-opt-3.ttl
    
      
        | name | mbox | 
|---|
      |  | <mailto:alice@example.net> | 
      | "Bert" | <mailto:bert@example.net> | 
      |  | <mailto:eve@example.net> | 
      |  | <mailto:bert@example.net> | 
      | "Alice" | <mailto:alice@example.net> | 
      
    
    
    Optional triples: single optional triple case.
    Data
    
      data/part1/dawg-data-01.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <mailto:fred@edu> .
    Query
      data/part1/dawg-query-001.rq
    # Get name, and optionally the mbox, of each person
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE
  { ?person foaf:name ?name .
    OPTIONAL { ?person foaf:mbox ?mbox}
  }
    Results
    data/part1/dawg-result-001.n3
    
      
        | name | mbox | 
|---|
      | "Eve" |  | 
      | "Alice" | <mailto:alice@work> | 
      | "Bob" | <mailto:bob@home> | 
      | "Bob" | <mailto:bob@work> | 
      
    
    
    Optional triples: multiple triples in one optional clause. Must find a name for each person known.
    Data
    
      data/part1/dawg-data-01.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <mailto:fred@edu> .
    Query
      data/part1/dawg-query-002.rq
    # Get names of people, together with the names of people they know.
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?name2
WHERE
  { ?person foaf:name ?name .
    OPTIONAL {
      ?person foaf:knows ?p2 .
      ?p2     foaf:name   ?name2 .
    }
  }
    Results
    data/part1/dawg-result-002.n3
    
      
        | name | name2 | 
|---|
      | "Eve" |  | 
      | "Alice" | "Bob" | 
      | "Bob" | "Alice" | 
      
    
    
    Optional triples: multiple optional clauses.
    Data
    
      data/part1/dawg-data-01.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <mailto:fred@edu> .
    Query
      data/part1/dawg-query-003.rq
    # Get names and mboxes, each of which may be optional.
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?name ?mbox
WHERE
  {
    { ?person rdf:type foaf:Person } .
    OPTIONAL { ?person foaf:name  ?name } .
    OPTIONAL {?person foaf:mbox  ?mbox} .
  }
    Results
    data/part1/dawg-result-003.n3
    
      
        | mbox | name | 
|---|
      | <mailto:alice@work> | "Alice" | 
      |  | "Eve" | 
      | <mailto:fred@edu> |  | 
      | <mailto:bob@home> | "Bob" | 
      | <mailto:bob@work> | "Bob" | 
      
    
    
    Optional triples: just a single optional clauses.
    Data
    
      data/part1/dawg-data-01.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <mailto:fred@edu> .
    Query
      data/part1/dawg-query-004.rq
    # Get optional get the mbox, of each person
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE
  { OPTIONAL { ?person foaf:name ?name } }
    Results
    data/part1/dawg-result-004.n3
    
    
    Simple entailment
    Data
    
      data/rdfSemantics/data-se-01.n3
    
    @prefix : <http://example.org/data#> .
_:a :r _:a .
_:a :p _:b .
_:b :url <http://example.org> .
    Query
      data/rdfSemantics/query-se-01.rq
    PREFIX : <http://example.org/data#>
SELECT ?x ?p ?y
WHERE { ?x ?p ?y }
    Results
    data/rdfSemantics/result-se-01.n3
    
      
        | x | p | y | 
|---|
      | <_:a_0.58abb> | <http://example.org/data#r> | <_:a_0.58abb> | 
      | <_:a_0.58abb> | <http://example.org/data#p> | <_:b_0.58abb> | 
      | <_:b_0.58abb> | <http://example.org/data#url> | <http://example.org> | 
      
    
    
    Simple entailment redundancy
    Data
    
      data/rdfSemantics/data-se-01.n3
    
    @prefix : <http://example.org/data#> .
_:a :r _:a .
_:a :p _:b .
_:b :url <http://example.org> .
    Query
      data/rdfSemantics/query-se-02.rq
    PREFIX : <http://example.org/data#>
SELECT ?x ?p ?y
WHERE { ?x ?p ?y }
    Results
    data/rdfSemantics/result-se-02.n3
    
      
        | x | p | y | 
|---|
      | <_:b_0.2e21b> | <http://example.org/data#url> | <http://example.org> | 
      | <_:a_0.2e21b> | <http://example.org/data#p> | <_:b_0.2e21b> | 
      | <_:a_0.2e21b> | <http://example.org/data#r> | <_:a_1.2e21b> | 
      | <_:a_0.2e21b> | <http://example.org/data#r> | <_:a_0.2e21b> | 
      
    
    
    Simple entailment missing coreference
    Data
    
      data/rdfSemantics/data-se-01.n3
    
    @prefix : <http://example.org/data#> .
_:a :r _:a .
_:a :p _:b .
_:b :url <http://example.org> .
    Query
      data/rdfSemantics/query-se-03.rq
    PREFIX : <http://example.org/data#>
SELECT ?x ?p ?y
WHERE { ?x ?p ?y }
    Results
    data/rdfSemantics/result-se-03.n3
    
      
        | y | p | x | 
|---|
      | <http://example.org> | <http://example.org/data#url> | <_:b_0.1de8> | 
      | <_:b_0.1de8> | <http://example.org/data#p> | <_:a_0.1de8> | 
      | <_:a_1.1de8> | <http://example.org/data#r> | <_:a_0.1de8> | 
      
    
    
    Simple entailment bnode in where clause
    Data
    
      data/rdfSemantics/data-se-01.n3
    
    @prefix : <http://example.org/data#> .
_:a :r _:a .
_:a :p _:b .
_:b :url <http://example.org> .
    Query
      data/rdfSemantics/query-se-04.rq
    PREFIX : <http://example.org/data#>
SELECT ?p ?y
WHERE { _:x ?p ?y }
    Results
    data/rdfSemantics/result-se-04.n3
    
      
        | y | p | 
|---|
      | <http://example.org> | <http://example.org/data#url> | 
      | <_:b_0.d3761> | <http://example.org/data#p> | 
      | <_:a_0.d3761> | <http://example.org/data#r> | 
      
    
    
    Counting semantics - queried with a variable subject
    Data
    
      data/rdfSemantics/data-se-foaf.ttl
    
    # data-se-foaf -- FOAF data
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ms: <http://www.mindswap.org/2003/owl/mindswap#> .
<http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia>
    rdf:type foaf:Person, ms:Researcher ;
    foaf:mbox <mailto:bparsia@isr.umd.edu> .
<http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark>
    rdf:type foaf:Person, ms:Programmer ;
    foaf:mbox <mailto:kendall@monkeyfist.com> ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia> .
<http://bblfish.net/people/henry/foaf#me>
    rdf:type foaf:Person ;
    foaf:mbox <mailto:henry.story@bblfish.net> .
_:Edd_Dumbill
    rdf:type foaf:Person ;
    foaf:mbox <mailto:edd@xml.com> ;
    foaf:knows _:Simon_St_Laurent ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark> .
_:Simon_St_Laurent
    rdf:type foaf:Person ;
    foaf:mbox <mailto:simon@xmlhack.com> ;
    foaf:knows _:Edd_Dumbill .
    Query
      data/rdfSemantics/query-se-var-type-var.rq
    # query-se-var-type-var -- Counting semantics - queried with a variable subject
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?who ?type
WHERE { ?who rdf:type ?type }
    Results
    data/rdfSemantics/result-se-var-type-var.ttl
    
      
        | who | type | 
|---|
      | <http://bblfish.net/people/henry/foaf#me> | <http://xmlns.com/foaf/0.1/Person> | 
      | <_:g90.e61ac> | <http://xmlns.com/foaf/0.1/Person> | 
      | <_:g91.e61ac> | <http://xmlns.com/foaf/0.1/Person> | 
      | <http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia> | <http://xmlns.com/foaf/0.1/Person> | 
      | <http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark> | <http://xmlns.com/foaf/0.1/Person> | 
      | <http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark> | <http://www.mindswap.org/2003/owl/mindswap#Programmer> | 
      | <http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia> | <http://www.mindswap.org/2003/owl/mindswap#Researcher> | 
      
    
    
    Counting semantics - queried with a bNode subject
    Data
    
      data/rdfSemantics/data-se-foaf.ttl
    
    # data-se-foaf -- FOAF data
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ms: <http://www.mindswap.org/2003/owl/mindswap#> .
<http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia>
    rdf:type foaf:Person, ms:Researcher ;
    foaf:mbox <mailto:bparsia@isr.umd.edu> .
<http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark>
    rdf:type foaf:Person, ms:Programmer ;
    foaf:mbox <mailto:kendall@monkeyfist.com> ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia> .
<http://bblfish.net/people/henry/foaf#me>
    rdf:type foaf:Person ;
    foaf:mbox <mailto:henry.story@bblfish.net> .
_:Edd_Dumbill
    rdf:type foaf:Person ;
    foaf:mbox <mailto:edd@xml.com> ;
    foaf:knows _:Simon_St_Laurent ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark> .
_:Simon_St_Laurent
    rdf:type foaf:Person ;
    foaf:mbox <mailto:simon@xmlhack.com> ;
    foaf:knows _:Edd_Dumbill .
    Query
      data/rdfSemantics/query-se-bNode-type-var.rq
    # query-se-bNode-type-var -- Counting semantics - queried with a bNode subject
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?type
WHERE { _:who rdf:type ?type }
    Results
    data/rdfSemantics/result-se-bNode-type-var.ttl
    
      
        | type | 
|---|
      | <http://www.mindswap.org/2003/owl/mindswap#Programmer> | 
      | <http://xmlns.com/foaf/0.1/Person> | 
      | <http://xmlns.com/foaf/0.1/Person> | 
      | <http://www.mindswap.org/2003/owl/mindswap#Researcher> | 
      | <http://xmlns.com/foaf/0.1/Person> | 
      | <http://xmlns.com/foaf/0.1/Person> | 
      | <http://xmlns.com/foaf/0.1/Person> | 
      
    
    
    are bNode labels allowed in FILTERs?
    Data
    
      data/rdfSemantics/data-se-foaf.ttl
    
    # data-se-foaf -- FOAF data
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ms: <http://www.mindswap.org/2003/owl/mindswap#> .
<http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia>
    rdf:type foaf:Person, ms:Researcher ;
    foaf:mbox <mailto:bparsia@isr.umd.edu> .
<http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark>
    rdf:type foaf:Person, ms:Programmer ;
    foaf:mbox <mailto:kendall@monkeyfist.com> ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia> .
<http://bblfish.net/people/henry/foaf#me>
    rdf:type foaf:Person ;
    foaf:mbox <mailto:henry.story@bblfish.net> .
_:Edd_Dumbill
    rdf:type foaf:Person ;
    foaf:mbox <mailto:edd@xml.com> ;
    foaf:knows _:Simon_St_Laurent ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark> .
_:Simon_St_Laurent
    rdf:type foaf:Person ;
    foaf:mbox <mailto:simon@xmlhack.com> ;
    foaf:knows _:Edd_Dumbill .
    Query
      data/rdfSemantics/query-se-bNode-constraint.rq
    # query-se-bNode-type-var -- Counting semantics - queried with a bNode subject
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?mbox
WHERE { _:who foaf:mbox ?mbox
	FILTER isBlank(_:who) }
    Results
    data/rdfSemantics/result-se-bNode-constraint.ttl
    
      
        | mbox | 
|---|
      | <mailto:edd@xml.com> | 
      | <mailto:simon@xmlhack.com> | 
      
    
    
    do bNode lables bridge basic graph patterns?
    Data
    
      data/rdfSemantics/data-se-foaf.ttl
    
    # data-se-foaf -- FOAF data
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ms: <http://www.mindswap.org/2003/owl/mindswap#> .
<http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia>
    rdf:type foaf:Person, ms:Researcher ;
    foaf:mbox <mailto:bparsia@isr.umd.edu> .
<http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark>
    rdf:type foaf:Person, ms:Programmer ;
    foaf:mbox <mailto:kendall@monkeyfist.com> ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Bijan.Parsia> .
<http://bblfish.net/people/henry/foaf#me>
    rdf:type foaf:Person ;
    foaf:mbox <mailto:henry.story@bblfish.net> .
_:Edd_Dumbill
    rdf:type foaf:Person ;
    foaf:mbox <mailto:edd@xml.com> ;
    foaf:knows _:Simon_St_Laurent ;
    foaf:knows <http://www.mindswap.org/2004/owl/mindswappers#Kendall.Clark> .
_:Simon_St_Laurent
    rdf:type foaf:Person ;
    foaf:mbox <mailto:simon@xmlhack.com> ;
    foaf:knows _:Edd_Dumbill .
    Query
      data/rdfSemantics/query-se-bNode-join.rq
    # query-se-bNode-type-var -- Counting semantics - queried with a bNode subject
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?who ?whom
WHERE { _:who foaf:mbox ?who
	OPTIONAL { _:who foaf:knows _:whom .
		   _:whom foaf:mbox ?whom } }
    Results
    data/rdfSemantics/result-se-bNode-join.ttl
    
      
        | who | whom | 
|---|
      | <mailto:edd@xml.com> | <mailto:kendall@monkeyfist.com> | 
      | <mailto:simon@xmlhack.com> | <mailto:edd@xml.com> | 
      | <mailto:henry.story@bblfish.net> |  | 
      | <mailto:edd@xml.com> | <mailto:simon@xmlhack.com> | 
      | <mailto:bparsia@isr.umd.edu> |  | 
      | <mailto:kendall@monkeyfist.com> | <mailto:bparsia@isr.umd.edu> | 
      
    
    
    Simple unanchored match test
    Data
    
      data/regex/regex-data-01.n3
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ex: <http://example.com/#> .
ex:foo rdf:value "abcDEFghiJKL" , "ABCdefGHIjkl", "0123456789",
	<http://example.com/uri>, "http://example.com/literal" .
    Query
      data/regex/regex-query-001.rq
    PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  ex: <http://example.com/#>
SELECT ?val
WHERE {
	ex:foo rdf:value ?val .
	FILTER regex(?val, "GHI")
}
    Results
    data/regex/regex-result-001.n3
    
    
    Case insensitive unanchored match test
    Data
    
      data/regex/regex-data-01.n3
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ex: <http://example.com/#> .
ex:foo rdf:value "abcDEFghiJKL" , "ABCdefGHIjkl", "0123456789",
	<http://example.com/uri>, "http://example.com/literal" .
    Query
      data/regex/regex-query-002.rq
    PREFIX  ex: <http://example.com/#>
PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?val
WHERE {
	ex:foo rdf:value ?val .
	FILTER regex(?val, "DeFghI", "i")
}
    Results
    data/regex/regex-result-002.n3
    
      
        | val | 
|---|
      | "abcDEFghiJKL" | 
      | "ABCdefGHIjkl" | 
      
    
    
    Use/mention test
    Data
    
      data/regex/regex-data-01.n3
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ex: <http://example.com/#> .
ex:foo rdf:value "abcDEFghiJKL" , "ABCdefGHIjkl", "0123456789",
	<http://example.com/uri>, "http://example.com/literal" .
    Query
      data/regex/regex-query-003.rq
    PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  ex:  <http://example.com/#>
SELECT ?val
WHERE {
	ex:foo rdf:value ?val .
	FILTER regex(?val, "example\\.com")
}
    Results
    data/regex/regex-result-003.n3
    
      
        | val | 
|---|
      | "http://example.com/literal" | 
      
    
    
    str()+URI test
    Data
    
      data/regex/regex-data-01.n3
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ex: <http://example.com/#> .
ex:foo rdf:value "abcDEFghiJKL" , "ABCdefGHIjkl", "0123456789",
	<http://example.com/uri>, "http://example.com/literal" .
    Query
      data/regex/regex-query-004.rq
    PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  ex: <http://example.com/#>
SELECT ?val
WHERE {
	ex:foo rdf:value ?val .
	FILTER regex(str(?val), "example\\.com")
}
    Results
    data/regex/regex-result-004.n3
    
      
        | val | 
|---|
      | <http://example.com/uri> | 
      | "http://example.com/literal" | 
      
    
    
    rf1 variable binding example (bindings in header order)
    Data
    
      data/rf1/rf1-example-data.n3
    
    @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#> .
@prefix ex:         <http://ns.example.org/#> .
_:a  foaf:name       "Alice" .
_:a  foaf:homepage   <http://work.example.org/alice/> .
_:a  foaf:mbox       "" .
_:a  ex:blurb       "<p xmlns=\"http://www.w3.org/1999/xhtml\">My name is <b>Alice</b></p>"^^rdf:XMLLiteral .
_:a  foaf:knows      _:b .
_:b  foaf:name       "Bob"@en .
_:b  foaf:mbox       <mailto:bob@work.example.org> .
_:b  foaf:homepage   <http://work.example.org/bob/> .
_:b  ex:ageInYears   30 .
_:b  foaf:knows      _:a .
    Query
      data/rf1/rf1-example.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX ex: <http://ns.example.org/#>
SELECT ?x ?hpage ?name ?mbox ?age ?blurb ?friend
WHERE { ?x foaf:name ?name .
        ?x foaf:mbox ?mbox .
        ?x foaf:homepage ?hpage .
        ?x foaf:knows ?friend .
        OPTIONAL { ?x ex:ageInYears ?age } .
        OPTIONAL { ?x ex:blurb ?blurb }
      }
ORDER BY ?name
    Results
    data/rf1/rf1-example.srx
    
    rf1 variable binding example (bindings in arbitrary order)
    Data
    
      data/rf1/rf1-example-data.n3
    
    @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#> .
@prefix ex:         <http://ns.example.org/#> .
_:a  foaf:name       "Alice" .
_:a  foaf:homepage   <http://work.example.org/alice/> .
_:a  foaf:mbox       "" .
_:a  ex:blurb       "<p xmlns=\"http://www.w3.org/1999/xhtml\">My name is <b>Alice</b></p>"^^rdf:XMLLiteral .
_:a  foaf:knows      _:b .
_:b  foaf:name       "Bob"@en .
_:b  foaf:mbox       <mailto:bob@work.example.org> .
_:b  foaf:homepage   <http://work.example.org/bob/> .
_:b  ex:ageInYears   30 .
_:b  foaf:knows      _:a .
    Query
      data/rf1/rf1-example.rq
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX ex: <http://ns.example.org/#>
SELECT ?x ?hpage ?name ?mbox ?age ?blurb ?friend
WHERE { ?x foaf:name ?name .
        ?x foaf:mbox ?mbox .
        ?x foaf:homepage ?hpage .
        ?x foaf:knows ?friend .
        OPTIONAL { ?x ex:ageInYears ?age } .
        OPTIONAL { ?x ex:blurb ?blurb }
      }
ORDER BY ?name
    Results
    data/rf1/rf1-example-mixedbindings.srx
    
    SELECT - one  variable in query, one in SELECT
    Data
    
      data/Select/data-1.ttl
    
    @prefix : <http://example.org/> .
:x :p 1 .
:x :q 2 .
    Query
      data/Select/q-select-1.rq
    PREFIX : <http://example.org/>
SELECT ?x
  { :x :p ?x }
    Results
    data/Select/results-select-1.ttl
    
    
    SELECT - one variable in query, two in SELECT
    Data
    
      data/Select/data-1.ttl
    
    @prefix : <http://example.org/> .
:x :p 1 .
:x :q 2 .
    Query
      data/Select/q-select-2.rq
    PREFIX : <http://example.org/>
SELECT ?x ?y
  { :x :p ?x }
    Results
    data/Select/results-select-2.ttl
    
    
    SELECT - two variables in query, one in SELECT
    Data
    
      data/Select/data-1.ttl
    
    @prefix : <http://example.org/> .
:x :p 1 .
:x :q 2 .
    Query
      data/Select/q-select-3.rq
    PREFIX : <http://example.org/>
SELECT ?x
  { :x :p ?x . :x :q ?y }
    Results
    data/Select/results-select-3.ttl
    
    
    Simple triple match
    Data
    
      data/simple2/data-01.n3
    
    @prefix : <http://example.org/data/> .
:x :p :v1 .
:x :p :v2 .
    Query
      data/simple2/dawg-tp-01.rq
    PREFIX : <http://example.org/data/>
SELECT *
WHERE { :x ?p ?q }
    Results
    data/simple2/result-tp-01.n3
    
      
        | p | q | 
|---|
      | <http://example.org/data/p> | <http://example.org/data/v2> | 
      | <http://example.org/data/p> | <http://example.org/data/v1> | 
      
    
    
    Simple triple match
    Data
    
      data/simple2/data-01.n3
    
    @prefix : <http://example.org/data/> .
:x :p :v1 .
:x :p :v2 .
    Query
      data/simple2/dawg-tp-02.rq
    PREFIX : <http://example.org/data/>
SELECT *
WHERE { ?x :p ?q }
    Results
    data/simple2/result-tp-02.n3
    
      
        | x | q | 
|---|
      | <http://example.org/data/x> | <http://example.org/data/v1> | 
      | <http://example.org/data/x> | <http://example.org/data/v2> | 
      
    
    
    Simple triple match - repeated variable
    Data
    
      data/simple2/data-02.n3
    
    @prefix : <http://example.org/data/> .
:y :y :x .
:x :y :y .
:y :x :y .
    Query
      data/simple2/dawg-tp-03.rq
    SELECT *
WHERE { ?a ?a ?b }
    Results
    data/simple2/result-tp-03.n3
    
      
        | b | a | 
|---|
      | <http://example.org/data/x> | <http://example.org/data/y> | 
      
    
    
    Simple triple match - two triples, common variable
    Data
    
      data/simple2/dawg-data-01.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows      _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows      _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <fred@edu> .
    Query
      data/simple2/dawg-tp-04.rq
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE
  { ?x rdf:type foaf:Person }
  { ?x foaf:name ?name }
    Results
    data/simple2/result-tp-04.n3
    
    
    Tested suggested by PFPS on C2.38 http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2006Feb/0028
    Data
    
      data/simple2/dawg-data-05.n3
    
    @prefix ex: <http://www.example.org/> .
_:a ex:a _:b .
    Query
      data/simple2/dawg-tp-05.rq
    PREFIX ex: <http://www.example.org/>
SELECT ?x WHERE {
  ?x ex:a ex:b .
}
    Results
    data/simple2/result-tp-05.n3
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-01.rq
    PREFIX : <http://example.org/ns#>
SELECT ?v
WHERE { [] :num ?v }
    Results
    data/SolutionSeq/results-seq-01.ttl
    
      
        | v | 
|---|
      | "3" | 
      | "2" | 
      | "1" | 
      | "1.5" | 
      | "3" | 
      | "2" | 
      | "1" | 
      | "4" | 
      
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-02.rq
    PREFIX : <http://example.org/ns#>
SELECT DISTINCT ?v
WHERE { [] :num ?v }
    Results
    data/SolutionSeq/results-seq-02.ttl
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-03.rq
    PREFIX : <http://example.org/ns#>
SELECT ?v
WHERE { [] :num ?v }
ORDER BY ?v
    Results
    data/SolutionSeq/results-seq-03.ttl
    
      
        | v | 
|---|
      | "4" | 
      | "1.5" | 
      | "1" | 
      | "2" | 
      | "2" | 
      | "1" | 
      | "3" | 
      | "3" | 
      
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-04.rq
    PREFIX : <http://example.org/ns#>
SELECT DISTINCT ?v
WHERE { [] :num ?v }
ORDER BY ?v
    Results
    data/SolutionSeq/results-seq-04.ttl
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-05.rq
    PREFIX : <http://example.org/ns#>
SELECT ?v
WHERE { [] :str ?v }
    Results
    data/SolutionSeq/results-seq-05.ttl
    
      
        | v | 
|---|
      | "1" | 
      | "AAA" | 
      | "002" | 
      | "aaa" | 
      | "" | 
      
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-06.rq
    PREFIX : <http://example.org/ns#>
SELECT ?v
WHERE { [] :str ?v }
ORDER BY ?v
    Results
    data/SolutionSeq/results-seq-06.ttl
    
      
        | v | 
|---|
      | "AAA" | 
      | "aaa" | 
      | "1" | 
      | "" | 
      | "002" | 
      
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-07.rq
    PREFIX : <http://example.org/ns#>
SELECT ?v
WHERE { [] :str ?v }
ORDER BY ?v
OFFSET 2
    Results
    data/SolutionSeq/results-seq-07.ttl
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-08.rq
    PREFIX : <http://example.org/ns#>
SELECT ?v
WHERE { [] :num ?v }
ORDER BY ASC(?v)
LIMIT 2
    Results
    data/SolutionSeq/results-seq-08.ttl
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-09.rq
    PREFIX : <http://example.org/ns#>
SELECT DISTINCT ?v
WHERE { [] :num ?v }
ORDER BY DESC(?v)
LIMIT 2
    Results
    data/SolutionSeq/results-seq-09.ttl
    
    
    Data
    
      data/SolutionSeq/data-1.ttl
    
    @prefix :  <http://example.org/ns#> .
:x :num  1 .
:x :num  2 .
:x :num  3 .
:x :num  4 .
:x :num  1.5 .
:y :num  1 .
:y :num  2 .
:y :num  3 .
:x :str  "aaa" .
:x :str  "002" .
:x :str  "1" .
:x :str  "AAA" .
:x :str  "" .
    Query
      data/SolutionSeq/q-seq-10.rq
    PREFIX : <http://example.org/ns#>
SELECT ?v
WHERE { [] :num ?v }
ORDER BY ?v
LIMIT 2
OFFSET 2
    Results
    data/SolutionSeq/results-seq-10.ttl
    
    
    NotApproved
    only opaque types with identical lexical and datatypes can be tested for =
    Data
    
      data/Sorting/sort-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
# Generated by <http://www.w3.org/2001/sw/DataAccess/tests/data/Sorting/genSort> $Revision: 1.72 $
@prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix srt: <http://www.w3.org/2001/sw/DataAccess/tests/data/Sorting/sort-0#> .
@prefix air: <http://www.daml.org/2001/10/html/airport-ont#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
srt:minus_two	srt:str1	"str -2" ;
		srt:str2	"-2" ;
		srt:int1	"-2"^^xsd:integer ;
		srt:bNode1	_:m2 ;
		srt:bNode2	_:minus_two ;
		srt:uri1	srt:m2 ;
		srt:uri2	srt:minus_two .
srt:minus_one	srt:str1	"str -1" ;
		srt:str2	"-1" ;
		srt:int1	"-1"^^xsd:integer ;
		srt:bNode1	_:m1 ;
		srt:bNode2	_:minus_one ;
		srt:uri1	srt:m1 ;
		srt:uri2	srt:minus_one ;
		srt:het1	_:minus_one .
srt:zero	srt:str1	"str 0" ;
		srt:str2	"0" ;
		srt:int1	"0"^^xsd:integer ;
		srt:bNode1	_:p0 ;
		srt:bNode2	_:zero ;
		srt:uri1	srt:p0 ;
		srt:uri2	srt:zero ;
		srt:het1	srt:hp0 .
srt:one	srt:str1	"str 1" ;
		srt:str2	"1" ;
		srt:int1	"1"^^xsd:integer ;
		srt:bNode1	_:p1 ;
		srt:bNode2	_:one ;
		srt:uri1	srt:p1 ;
		srt:uri2	srt:one ;
		srt:het1	"1" .
srt:oneB	srt:str1	"str 1" ;
		srt:str2	"1" ;
		srt:int1	"1"^^xsd:integer ;
		srt:bNode1	_:p1 ;
		srt:bNode2	_:oneB ;
		srt:uri1	srt:p1 ;
		srt:uri2	srt:one ;
		srt:het1	"1"@EN .
srt:oneC	srt:str1	"str 1" ;
		srt:str2	"1" ;
		srt:int1	"1"^^xsd:integer ;
		srt:bNode1	_:p1 ;
		srt:bNode2	_:oneC ;
		srt:uri1	srt:p1 ;
		srt:uri2	srt:one ;
		srt:het1	"1"^^xsd:string .
srt:two	srt:str1	"str 2" ;
		srt:str2	"2" ;
		srt:int1	"2"^^xsd:integer ;
		srt:bNode1	_:p2 ;
		srt:bNode2	_:two ;
		srt:uri1	srt:p2 ;
		srt:uri2	srt:two ;
		srt:het1	"2"^^xsd:integer .
srt:three	srt:str1	"str 3" ;
		srt:str2	"3" ;
		srt:int1	"3"^^xsd:integer ;
		srt:bNode1	_:p3 ;
		srt:bNode2	_:three ;
		srt:uri1	srt:p3 ;
		srt:uri2	srt:three ;
		srt:het1	"3"^^xsd:float .
srt:four	srt:str1	"str 4" ;
		srt:str2	"4" ;
		srt:int1	"4"^^xsd:integer ;
		srt:bNode1	_:p4 ;
		srt:bNode2	_:four ;
		srt:uri1	srt:p4 ;
		srt:uri2	srt:four .
srt:five	srt:str1	"str 5" ;
		srt:str2	"5" ;
		srt:int1	"5"^^xsd:integer ;
		srt:bNode1	_:p5 ;
		srt:bNode2	_:five ;
		srt:uri1	srt:p5 ;
		srt:uri2	srt:five ;
		srt:het1	_:five .
srt:six	srt:str1	"str 6" ;
		srt:str2	"6" ;
		srt:int1	"6"^^xsd:integer ;
		srt:bNode1	_:p6 ;
		srt:bNode2	_:six ;
		srt:uri1	srt:p6 ;
		srt:uri2	srt:six ;
		srt:het1	srt:hp6 .
srt:seven	srt:str1	"str 7" ;
		srt:str2	"7" ;
		srt:int1	"7"^^xsd:integer ;
		srt:bNode1	_:p7 ;
		srt:bNode2	_:seven ;
		srt:uri1	srt:p7 ;
		srt:uri2	srt:seven ;
		srt:het1	"7" .
srt:eight	srt:str1	"str 8" ;
		srt:str2	"8" ;
		srt:int1	"8"^^xsd:integer ;
		srt:bNode1	_:p8 ;
		srt:bNode2	_:eight ;
		srt:uri1	srt:p8 ;
		srt:uri2	srt:eight ;
		srt:het1	"8"@EN .
srt:eightB	srt:str1	"str 8" ;
		srt:str2	"8" ;
		srt:int1	"8"^^xsd:integer ;
		srt:bNode1	_:p8 ;
		srt:bNode2	_:eightB ;
		srt:uri1	srt:p8 ;
		srt:uri2	srt:eight ;
		srt:het1	"8"^^xsd:string .
srt:nine	srt:str1	"str 9" ;
		srt:str2	"9" ;
		srt:int1	"9"^^xsd:integer ;
		srt:bNode1	_:p9 ;
		srt:bNode2	_:nine ;
		srt:uri1	srt:p9 ;
		srt:uri2	srt:nine ;
		srt:het1	"9"^^xsd:integer .
srt:ten	srt:str1	"str 10" ;
		srt:str2	"10" ;
		srt:int1	"10"^^xsd:integer ;
		srt:bNode1	_:p10 ;
		srt:bNode2	_:ten ;
		srt:uri1	srt:p10 ;
		srt:uri2	srt:ten ;
		srt:het1	"10"^^xsd:float .
srt:eleven	srt:str1	"str 11" ;
		srt:str2	"11" ;
		srt:int1	"11"^^xsd:integer ;
		srt:bNode1	_:p11 ;
		srt:bNode2	_:eleven ;
		srt:uri1	srt:p11 ;
		srt:uri2	srt:eleven .
srt:twelve	srt:str1	"str 12" ;
		srt:str2	"12" ;
		srt:int1	"12"^^xsd:integer ;
		srt:bNode1	_:p12 ;
		srt:bNode2	_:twelve ;
		srt:uri1	srt:p12 ;
		srt:uri2	srt:twelve ;
		srt:het1	_:twelve .
srt:thirteen	srt:str1	"str 13" ;
		srt:str2	"13" ;
		srt:int1	"13"^^xsd:integer ;
		srt:bNode1	_:p13 ;
		srt:bNode2	_:thirteen ;
		srt:uri1	srt:p13 ;
		srt:uri2	srt:thirteen ;
		srt:het1	srt:hp13 .
srt:fourteen	srt:str1	"str 14" ;
		srt:str2	"14" ;
		srt:int1	"14"^^xsd:integer ;
		srt:bNode1	_:p14 ;
		srt:bNode2	_:fourteen ;
		srt:uri1	srt:p14 ;
		srt:uri2	srt:fourteen ;
		srt:het1	"14" .
srt:fifteen	srt:str1	"str 15" ;
		srt:str2	"15" ;
		srt:int1	"15"^^xsd:integer ;
		srt:bNode1	_:p15 ;
		srt:bNode2	_:fifteen ;
		srt:uri1	srt:p15 ;
		srt:uri2	srt:fifteen ;
		srt:het1	"15"@EN .
srt:fifteenB	srt:str1	"str 15" ;
		srt:str2	"15" ;
		srt:int1	"15"^^xsd:integer ;
		srt:bNode1	_:p15 ;
		srt:bNode2	_:fifteenB ;
		srt:uri1	srt:p15 ;
		srt:uri2	srt:fifteen ;
		srt:het1	"15"^^xsd:string .
srt:fifteenC	srt:str1	"str 15" ;
		srt:str2	"15" ;
		srt:int1	"15"^^xsd:integer ;
		srt:bNode1	_:p15 ;
		srt:bNode2	_:fifteenC ;
		srt:uri1	srt:p15 ;
		srt:uri2	srt:fifteen ;
		srt:het1	"15"^^xsd:integer .
srt:sixteen	srt:str1	"str 16" ;
		srt:str2	"16" ;
		srt:int1	"16"^^xsd:integer ;
		srt:bNode1	_:p16 ;
		srt:bNode2	_:sixteen ;
		srt:uri1	srt:p16 ;
		srt:uri2	srt:sixteen ;
		srt:het1	"16"^^xsd:float .
srt:seventeen	srt:str1	"str 17" ;
		srt:str2	"17" ;
		srt:int1	"17"^^xsd:integer ;
		srt:bNode1	_:p17 ;
		srt:bNode2	_:seventeen ;
		srt:uri1	srt:p17 ;
		srt:uri2	srt:seventeen .
srt:eighteen	srt:str1	"str 18" ;
		srt:str2	"18" ;
		srt:int1	"18"^^xsd:integer ;
		srt:bNode1	_:p18 ;
		srt:bNode2	_:eighteen ;
		srt:uri1	srt:p18 ;
		srt:uri2	srt:eighteen ;
		srt:het1	_:eighteen .
srt:nineteen	srt:str1	"str 19" ;
		srt:str2	"19" ;
		srt:int1	"19"^^xsd:integer ;
		srt:bNode1	_:p19 ;
		srt:bNode2	_:nineteen ;
		srt:uri1	srt:p19 ;
		srt:uri2	srt:nineteen ;
		srt:het1	srt:hp19 .
srt:twenty	srt:str1	"str 20" ;
		srt:str2	"20" ;
		srt:int1	"20"^^xsd:integer ;
		srt:bNode1	_:p20 ;
		srt:bNode2	_:twenty ;
		srt:uri1	srt:p20 ;
		srt:uri2	srt:twenty ;
		srt:het1	"20" .
srt:twenty_one	srt:str1	"str 21" ;
		srt:str2	"21" ;
		srt:int1	"21"^^xsd:integer ;
		srt:bNode1	_:p21 ;
		srt:bNode2	_:twenty_one ;
		srt:uri1	srt:p21 ;
		srt:uri2	srt:twenty_one ;
		srt:het1	"21"@EN .
srt:twenty_two	srt:str1	"str 22" ;
		srt:str2	"22" ;
		srt:int1	"22"^^xsd:integer ;
		srt:bNode1	_:p22 ;
		srt:bNode2	_:twenty_two ;
		srt:uri1	srt:p22 ;
		srt:uri2	srt:twenty_two ;
		srt:het1	"22"^^xsd:string .
srt:twenty_twoB	srt:str1	"str 22" ;
		srt:str2	"22" ;
		srt:int1	"22"^^xsd:integer ;
		srt:bNode1	_:p22 ;
		srt:bNode2	_:twenty_twoB ;
		srt:uri1	srt:p22 ;
		srt:uri2	srt:twenty_two ;
		srt:het1	"22"^^xsd:integer .
srt:twenty_three	srt:str1	"str 23" ;
		srt:str2	"23" ;
		srt:int1	"23"^^xsd:integer ;
		srt:bNode1	_:p23 ;
		srt:bNode2	_:twenty_three ;
		srt:uri1	srt:p23 ;
		srt:uri2	srt:twenty_three ;
		srt:het1	"23"^^xsd:float .
    Query
      data/Sorting/one-of-one-column.rq
    PREFIX srt: <http://www.w3.org/2001/sw/DataAccess/tests/data/Sorting/sort-0#>
SELECT ?str1
 WHERE {?s srt:str1 ?str1}
	ORDER BY ASC (?str1)
    Results
    data/Sorting/one-of-one-column-result.n3
    
      
        | str1 | 
|---|
      | "str 20" | 
      | "str 2" | 
      | "str 19" | 
      | "str 18" | 
      | "str 17" | 
      | "str 16" | 
      | "str 15" | 
      | "str 14" | 
      | "str 13" | 
      | "str 12" | 
      | "str 11" | 
      | "str 10" | 
      | "str 1" | 
      | "str 0" | 
      | "str -2" | 
      | "str -1" | 
      | "str 21" | 
      | "str 22" | 
      | "str 23" | 
      | "str 3" | 
      | "str 4" | 
      | "str 5" | 
      | "str 6" | 
      | "str 7" | 
      | "str 8" | 
      | "str 9" | 
      
    
    
    
    Alphabetic sort (ascending) on untyped literals
    Data
    
      data/sort/data-sort-1.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a foaf:name "Eve".
_:b foaf:name "Alice" .
_:c foaf:name "Fred" .
_:e foaf:name "Bob" .
    Query
      data/sort/query-sort-1.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name }
ORDER BY ?name
    Results
    data/sort/result-sort-1.rdf
    
      
        | name | 
|---|
      | "Fred" | 
      | "Eve" | 
      | "Bob" | 
      | "Alice" | 
      
    
    
    Alphabetic sort (descending) on untyped literals
    Data
    
      data/sort/data-sort-1.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a foaf:name "Eve".
_:b foaf:name "Alice" .
_:c foaf:name "Fred" .
_:e foaf:name "Bob" .
    Query
      data/sort/query-sort-2.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name }
ORDER BY DESC(?name)
    Results
    data/sort/result-sort-2.rdf
    
      
        | name | 
|---|
      | "Alice" | 
      | "Bob" | 
      | "Eve" | 
      | "Fred" | 
      
    
    
    Sort on (possibly unbound) URIs
    Data
    
      data/sort/data-sort-3.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
_:a rdf:type foaf:Person ;
    foaf:name "Eve" ;
    foaf:mbox <mailto:eve@work.example> .
_:b rdf:type foaf:Person ;
    foaf:name "Alice" ;
    foaf:mbox <mailto:alice@work.example> .
_:c rdf:type foaf:Person ;
    foaf:mbox <mailto:fred@work.example> ;
    foaf:name "Fred" .
_:e foaf:name "Bob" .
    Query
      data/sort/query-sort-3.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE { ?x foaf:name ?name .
           OPTIONAL { ?x foaf:mbox ?mbox }
      }
ORDER BY ASC(?mbox)
    Results
    data/sort/result-sort-3.rdf
    
      
        | mbox | name | 
|---|
      | <mailto:fred@work.example> | "Fred" | 
      | <mailto:eve@work.example> | "Eve" | 
      | <mailto:alice@work.example> | "Alice" | 
      |  | "Bob" | 
      
    
    
    Sort on datatyped (integer) literals
    Data
    
      data/sort/data-sort-4.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix ex:        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a rdf:type foaf:Person ;
    foaf:name "Eve" ;
    ex:empId "9"^^xsd:integer .
_:b rdf:type foaf:Person ;
    foaf:name "Alice" ;
    ex:empId "29"^^xsd:integer .
_:c rdf:type foaf:Person ;
    foaf:name "Fred" ;
    ex:empId "27"^^xsd:integer .
_:e foaf:name "Bob" ;
    ex:empId "23"^^xsd:integer .
_:f foaf:name "Bob" ;
    ex:empId "30"^^xsd:integer .
    Query
      data/sort/query-sort-4.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
PREFIX ex:        <http://example.org/things#>
SELECT ?name ?emp
WHERE { ?x foaf:name ?name ;
           ex:empId ?emp
      }
ORDER BY ASC(?emp)
    Results
    data/sort/result-sort-4.rdf
    
      
        | emp | name | 
|---|
      | "30" | "Bob" | 
      | "29" | "Alice" | 
      | "27" | "Fred" | 
      | "23" | "Bob" | 
      | "9" | "Eve" | 
      
    
    
    Sort first on untyped literals (ascending), then on datatyped (integer) literals (descending
    Data
    
      data/sort/data-sort-4.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix ex:        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a rdf:type foaf:Person ;
    foaf:name "Eve" ;
    ex:empId "9"^^xsd:integer .
_:b rdf:type foaf:Person ;
    foaf:name "Alice" ;
    ex:empId "29"^^xsd:integer .
_:c rdf:type foaf:Person ;
    foaf:name "Fred" ;
    ex:empId "27"^^xsd:integer .
_:e foaf:name "Bob" ;
    ex:empId "23"^^xsd:integer .
_:f foaf:name "Bob" ;
    ex:empId "30"^^xsd:integer .
    Query
      data/sort/query-sort-5.rq
    PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
PREFIX ex:      <http://example.org/things#>
SELECT ?name ?emp
WHERE { ?x foaf:name ?name ;
           ex:empId ?emp
      }
ORDER BY ?name DESC(?emp)
    Results
    data/sort/result-sort-5.rdf
    
      
        | emp | name | 
|---|
      | "27" | "Fred" | 
      | "9" | "Eve" | 
      | "23" | "Bob" | 
      | "30" | "Bob" | 
      | "29" | "Alice" | 
      
    
    
    Sort on mixed result of uris and literals.
    Data
    
      data/sort/data-sort-6.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix ex:        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a rdf:type foaf:Person ;
    foaf:name "Eve" ;
    ex:address <http://example.org/eve> .
_:b rdf:type foaf:Person ;
    foaf:name "Alice" ;
    ex:address "Fascination Street 11" .
_:c rdf:type foaf:Person ;
    foaf:name "Fred" ;
    ex:address "fred@work.example" .
_:e foaf:name "Bob" ;
    ex:address <mailto:bob@work.example> .
    Query
      data/sort/query-sort-6.rq
    PREFIX ex:      <http://example.org/things#>
SELECT ?address
WHERE { ?x ex:address ?address }
ORDER BY ASC(?address)
    Results
    data/sort/result-sort-6.rdf
    
      
        | address | 
|---|
      | "fred@work.example" | 
      | "Fascination Street 11" | 
      | <mailto:bob@work.example> | 
      | <http://example.org/eve> | 
      
    
    
    Sort on comparable mixed typed literals (integer and float)
    Data
    
      data/sort/data-sort-7.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix ex:        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a rdf:type foaf:Person ;
    foaf:name "Eve" ;
    ex:empId "9"^^xsd:integer .
_:b rdf:type foaf:Person ;
    foaf:name "Alice" ;
    ex:empId "29"^^xsd:integer .
_:c rdf:type foaf:Person ;
    foaf:name "Fred" ;
    ex:empId "27"^^xsd:integer .
_:e foaf:name "Bob" ;
    ex:empId "23.0"^^xsd:float .
    Query
      data/sort/query-sort-4.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
PREFIX ex:        <http://example.org/things#>
SELECT ?name ?emp
WHERE { ?x foaf:name ?name ;
           ex:empId ?emp
      }
ORDER BY ASC(?emp)
    Results
    data/sort/result-sort-7.rdf
    
      
        | emp | name | 
|---|
      | "27" | "Fred" | 
      | "23.0" | "Bob" | 
      | "9" | "Eve" | 
      | "29" | "Alice" | 
      
    
    
    Sort on several mixed values (bnode, uri, literal)
    Data
    
      data/sort/data-sort-8.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix ex:        <http://example.org/things#> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a foaf:name "Eve" ;
    ex:empId "9"^^xsd:integer .
_:f foaf:name "John" ;
    ex:empId [ ex:number "29"^^xsd:integer ] .
_:g foaf:name "Dirk" ;
    ex:empId <http://example.org/dirk01> .
    Query
      data/sort/query-sort-4.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
PREFIX ex:        <http://example.org/things#>
SELECT ?name ?emp
WHERE { ?x foaf:name ?name ;
           ex:empId ?emp
      }
ORDER BY ASC(?emp)
    Results
    data/sort/result-sort-8.rdf
    
      
        | emp | name | 
|---|
      | "9" | "Eve" | 
      | <http://example.org/dirk01> | "Dirk" | 
      | <_:node0.a1081> | "John" | 
      
    
    
    Alphabetic sort (ascending) on datatyped (string) literals
    Data
    
      data/sort/data-sort-9.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a foaf:name "Eve"^^xsd:string .
_:b foaf:name "Alice"^^xsd:string .
_:c foaf:name "Fred"^^xsd:string .
_:e foaf:name "Bob"^^xsd:string .
    Query
      data/sort/query-sort-9.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name }
ORDER BY ?name
    Results
    data/sort/result-sort-9.rdf
    
      
        | name | 
|---|
      | "Fred" | 
      | "Eve" | 
      | "Bob" | 
      | "Alice" | 
      
    
    
    Alphabetic sort (descending) on datatyped (string) literals
    Data
    
      data/sort/data-sort-9.ttl
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a foaf:name "Eve"^^xsd:string .
_:b foaf:name "Alice"^^xsd:string .
_:c foaf:name "Fred"^^xsd:string .
_:e foaf:name "Bob"^^xsd:string .
    Query
      data/sort/query-sort-10.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name }
ORDER BY DESC(?name)
    Results
    data/sort/result-sort-10.rdf
    
      
        | name | 
|---|
      | "Alice" | 
      | "Bob" | 
      | "Eve" | 
      | "Fred" | 
      
    
    
    Untrusted graphs query example 1
    Query
      data/source-named/untrusted-graph-q1.rq
    SELECT *
FROM        <dft.n3>
FROM NAMED  <a.n3>
FROM NAMED  <b.n3>
WHERE
  { ?x ?y ?z . ?z ?r ?s }
    Results
    data/source-named/untrusted-graph-q1-result.n3
    
    
    Untrusted graphs query example 2
    Query
      data/source-named/untrusted-graph-q2.rq
    SELECT *
FROM       <dft.n3>
FROM NAMED <a.n3>
FROM NAMED <b.n3>
WHERE
  {
    GRAPH ?src1 { ?x ?y ?z } .
    GRAPH ?src2 { ?z ?r ?s } .
  }
    Results
    data/source-named/untrusted-graph-q2-result.n3
    
      
        | src2 | src1 | s | r | z | y | x | 
|---|
      | <test:rb.n3> | <test:ra.n3> | <http://example.org/ns#z> | <http://example.org/ns#p> | <http://example.org/ns#c> | <http://example.org/ns#b> | <http://example.org/ns#a> | 
      
    
    
    Untrusted graphs query example 4
    Query
      data/source-named/untrusted-graph-q4.rq
    SELECT *
FROM       <dft.n3>
FROM NAMED <dft.n3>
FROM NAMED <a.n3>
FROM NAMED <b.n3>
WHERE
 {
    GRAPH ?src1 { ?x ?y ?z } .
    GRAPH ?src2 { ?z ?r ?s }
 }
    Results
    data/source-named/untrusted-graph-q4-result.n3
    
      
        | src1 | x | y | src2 | r | s | z | 
|---|
      | <test:ra.n3> | <http://example.org/ns#a> | <http://example.org/ns#b> | <test:rb.n3> | <http://example.org/ns#p> | <http://example.org/ns#z> | <http://example.org/ns#c> | 
      | <test:rdft.n3> | <http://example.org/ns#aRoot> | <http://example.org/ns#q> | <test:ra.n3> | <http://example.org/ns#b> | <http://example.org/ns#c> | <http://example.org/ns#a> | 
      
    
    
    Untrusted graphs query example 5
    Query
      data/source-named/untrusted-graph-q5.rq
    SELECT *
FROM NAMED <dft.n3>
FROM NAMED <a.n3>
FROM NAMED <b.n3>
WHERE
  {
    GRAPH ?src1 { ?x ?y ?z } .
    GRAPH ?src2 { ?z ?r ?s } .
  }
    Results
    data/source-named/untrusted-graph-q4-result.n3
    
      
        | z | s | r | src2 | y | x | src1 | 
|---|
      | <http://example.org/ns#a> | <http://example.org/ns#c> | <http://example.org/ns#b> | <test:ra.n3> | <http://example.org/ns#q> | <http://example.org/ns#aRoot> | <test:rdft.n3> | 
      | <http://example.org/ns#c> | <http://example.org/ns#z> | <http://example.org/ns#p> | <test:rb.n3> | <http://example.org/ns#b> | <http://example.org/ns#a> | <test:ra.n3> | 
      
    
    
    Nested GRAPH statements use innermost graph
    Query
      data/source-named/nested-graph-query.rq
    PREFIX : <http://example.org/ns#>
SELECT ?o
FROM NAMED <ng1.n3>
FROM NAMED <ng2.n3>
{
  GRAPH <ng1.n3> {
  GRAPH <ng2.n3> {
      :s :p ?o .
  }
  }
}
    Results
    data/source-named/nested-graph-query-result.n3
    
      
        | o | 
|---|
      | <http://example.org/ns#o2> | 
      | <http://example.org/ns#o> | 
      
    
    
    trivial test
    Data
    
      data/source-simple2/source-data-01.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows     _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows     _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
    Query
      data/source-simple2/source-query-001
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?name ?source
WHERE {
  GRAPH ?snode {
      {?person foaf:name ?name}
      {?snode dc:source ?source}
    }
}
    Results
    data/source-simple2/source-result-001.n3
    
      
        | name | source | 
|---|
      | "Eve" | <file:data/source/source-data-01.n3> | 
      | "Alice" | <file:data/source/source-data-01.n3> | 
      | "Bob" | <file:data/source/source-data-01.n3> | 
      
    
    
    2 file test
    Data
    
      data/source-simple2/source-data-02.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    .
    Query
      data/source-simple2/source-query-001
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?name ?source
WHERE {
  GRAPH ?snode {
      {?person foaf:name ?name}
      {?snode dc:source ?source}
    }
}
    Results
    data/source-simple2/source-result-002.n3
    
      
        | source | name | 
|---|
      | <file:data/source/source-data-02.n3> | "Alice" | 
      | <file:data/source/source-data-01.n3> | "Eve" | 
      | <file:data/source/source-data-01.n3> | "Alice" | 
      | <file:data/source/source-data-01.n3> | "Bob" | 
      
    
    
    selecting 1 file from 2 test
    Data
    
      data/source-simple2/source-data-02.n3
    
    @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#> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    .
    Query
      data/source-simple2/source-query-003
    # Finds person-name restioans from same source as alice's email address
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT DISTINCT ?name ?mailbox
WHERE {
      GRAPH ?snode { ?person foaf:name ?name }
      GRAPH ?snode {?person foaf:mbox ?mailbox }
      GRAPH ?snode {?x      foaf:mbox <mailto:bob@work> }
}
    Results
    data/source-simple2/source-result-003.n3
    
      
        | mailbox | name | 
|---|
      | <mailto:alice@work> | "Alice" | 
      | <mailto:bob@home> | "Bob" | 
      | <mailto:bob@work> | "Bob" | 
      
    
    
    check files cant assert things against models
    Data
    
      data/source-simple2/source-data-03.n3
    
    @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#> .
@prefix dc:	    <http://purl.org/dc/elements/1.1/> .
<file:data/source/source-data-03.n3> <dc:source> <http://example.com> .
_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows     _:bob ;
    .
_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ;
    foaf:knows     _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home> ;
    .
_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ;
    foaf:knows    _:fred ;
    .
    Query
      data/source-simple2/source-query-005
    # Get dc:sources of the SOURCE of this file, check users can't make assertions
# about it
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT DISTINCT ?source
WHERE {
  GRAPH ?snode {
      {?person foaf:name ?name}
      {?snode dc:source ?source}
  }
}
    Results
    data/source-simple2/source-result-005.n3
    
      
        | source | 
|---|
      | <file:data/source/source-data-01.n3> | 
      
    
    
    Simple triple match on two graphs
    Query
      data/SourceSimple/source-simple-01.rq
    SELECT *
FROM <file:simple-data-1.n3>
FROM <file:simple-data-2.n3>
WHERE {?x ?y ?z}
    Results
    data/SourceSimple/result-ss-01.n3
    
      
        | z | y | x | 
|---|
      | <http://example.org/c> | <http://example.org/b> | <http://example.org/a> | 
      
    
    
    Triple match using SOURCE
    Query
      data/SourceSimple/source-simple-02.rq
    SELECT *
FROM <file:simple-data-1.n3>
FROM <file:simple-data-2.n3>
WHERE { GRAPH ?src {?x ?y ?z} }
    Results
    data/SourceSimple/result-ss-02.n3
    
      
        | z | y | src | x | 
|---|
      | <http://example.org/c> | <http://example.org/b> | <file:simple-data-1.n3> | <http://example.org/a> | 
      | <http://example.org/c> | <http://example.org/b> | <file:simple-data-2.n3> | <http://example.org/a> | 
      
    
    
    Triple match using SOURCE - SELECTed variables
    Query
      data/SourceSimple/source-simple-03.rq
    SELECT ?x ?y ?z
FROM <file:simple-data-1.n3>
FROM <file:simple-data-2.n3>
WHERE { GRAPH ?src {?x ?y ?z}}
    Results
    data/SourceSimple/result-ss-03.n3
    
      
        | x | y | z | 
|---|
      | <http://example.org/a> | <http://example.org/b> | <http://example.org/c> | 
      | <http://example.org/a> | <http://example.org/b> | <http://example.org/c> | 
      
    
    
    Simple triple match - one named container
    Query
      data/SourceSimple/source-simple-04.rq
    SELECT *
FROM <file:simple-data-1.n3>
WHERE {GRAPH ?src {?x ?y ?z}}
    Results
    data/SourceSimple/result-ss-04.n3
    
      
        | x | src | y | z | 
|---|
      | <http://example.org/a> | <file:simple-data-1.n3> | <http://example.org/b> | <http://example.org/c> | 
      
    
    
    Simple triple match - no named container
    Data
    
      data/SourceSimple/simple-data-1.n3
    
    @prefix : <http://example.org/> .
:a :b :c .
    Query
      data/SourceSimple/source-simple-05.rq
    SELECT *
WHERE { GRAPH ?src {?x ?y ?z} }
    Results
    data/SourceSimple/result-ss-05.n3
    
      
        | x | src | y | z | 
|---|
      | <http://example.org/a> |  | <http://example.org/b> | <http://example.org/c> | 
      
    
    
    Return the names of the authors of publication X
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-1.rq
    prefix ex: <http://example.org/survey-sample/ontology/>
SELECT ?n
WHERE
     { ?x ex:author [ ?li [ ex:name ?n] ].
     }
    Results
    data/survey/result-survey-1.ttl
    
      
        | n | 
|---|
      | "Willy" | 
      | "Mary" | 
      | "Bob" | 
      | "John" | 
      
    
    
    Return the name and, if known, the e-mail of the author of publication X
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-2.rq
    prefix ex: <http://example.org/survey-sample/ontology/>
SELECT ?n ?addr
WHERE
     { ?y ex:author [ ?li ?who ].
       ?who ex:name ?n.
       OPTIONAL { ?who ex:email ?addr }
     }
    Results
    data/survey/result-survey-2.ttl
    
      
        | addr | n | 
|---|
      |  | "Willy" | 
      | "mary@example.org" | "Mary" | 
      |  | "Bob" | 
      |  | "John" | 
      
    
    
    Return the labels of all topics and (union) the titles of all publications.
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-3.rq
    prefix ex: <http://example.org/survey-sample/ontology/>
prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?title
WHERE
     { { [] a acm:Topic; rdfs:label ?title }
     UNION
      { [] ex:title ?title }}
    Results
    data/survey/result-survey-3.ttl
    
      
        | title | 
|---|
      | "Datenbankmanagement" | 
      | "Database Management" | 
      | "Informationsysteme" | 
      | "Information Systems" | 
      | "An Overview of RDF Query Languages" | 
      | "Anfragesprachen" | 
      | "Query Languages" | 
      | "Languages" | 
      | "Sprachen" | 
      
    
    
    Return the person who has classified the publication X.
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-8.rq
    prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix ex: <http://example.org/survey-sample/ontology/>
prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#>
prefix dc: <http://purl.org/dc/elements/1.1/>
SELECT ?who WHERE
{
  [ rdf:subject ?work;
    rdf:predicate ex:isAbout;
    rdf:object ?topic
  ] dc:creator ?who
}
    Results
    data/survey/result-survey-8.ttl
    
      
        | who | 
|---|
      | <http://example.org/survey-sample/person01> | 
      
    
    
    Return the first author of Publication X.
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-9.rq
    prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix ex: <http://example.org/survey-sample/ontology/>
SELECT ?n WHERE
     { ?y ex:author [ rdf:_1 [ ex:name ?n] ].
     }
    Results
    data/survey/result-survey-9.ttl
    
    
    Return all resources whose namespace starts with http://example.org/survey-sample/.
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-10.rq
    select DISTINCT ?R where
 { ?R ?x ?y.
   FILTER ( regex(str(?R), "http://example.org/") )
}
    Results
    data/survey/result-survey-10.ttl
    
      
        | R | 
|---|
      | <http://example.org/survey-sample/ontology/author> | 
      | <http://example.org/survey-sample/ontology/Topic> | 
      | <http://example.org/survey-sample/ontology/Human> | 
      | <http://example.org/survey-sample/ontology/Person> | 
      | <http://example.org/survey-sample/ontology/InProceedings> | 
      | <http://example.org/survey-sample/ontology/Publication> | 
      | <http://example.org/survey-sample/ontology/title> | 
      | <http://example.org/survey-sample/ontology/pages> | 
      | <http://example.org/survey-sample/ontology/year> | 
      | <http://example.org/survey-sample/ontology/isAbout> | 
      | <http://example.org/survey-sample/ontology/name> | 
      | <http://example.org/survey-sample/ontology/email> | 
      | <http://example.org/survey-sample/person01> | 
      | <http://example.org/survey-sample/person02> | 
      | <http://example.org/survey-sample/person03> | 
      | <http://example.org/survey-sample/person04> | 
      | <http://example.org/survey-sample/Paper> | 
      | <http://example.org/survey-sample/ontology/reified_triple> | 
      | <http://example.org/ACMTopic/Information_Systems> | 
      | <http://example.org/ACMTopic/Information_Systems/Database_Management> | 
      | <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> | 
      | <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> | 
      
    
    
    Return the German label of the topic whose English label is 'Database Management'.
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-11.rq
    prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?de
WHERE
{
  [ rdfs:label ?de, "Database Management"@en ].
  FILTER ( lang(?de) = "de" )
}
    Results
    data/survey/result-survey-11.ttl
    
    
    Return all publications where the page number is the lexical value '08'.
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-12.rq
    prefix ex: <http://example.org/survey-sample/ontology/>
SELECT ?PUB WHERE {
  ?PUB ex:pages "08"
}
    Results
    data/survey/result-survey-12.ttl
    
      
        | PUB | 
|---|
      | <http://example.org/survey-sample/Paper> | 
      
    
    
    Return all publications where the page number is the integer value 8.
    Data
    
      data/survey/survey-sample.ttl
    
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/survey-sample/ontology/> .
@prefix : <http://example.org/survey-sample/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix acm: <http://daml.umbc.edu/ontologies/topic-ont#> .
:person01 a ex:Person ;
	ex:name "John" .
ex:name a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
:person02 a ex:Person , ex:Human ;
	ex:name "Bob" .
ex:author a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range rdf:Seq .
ex:Person a rdfs:Class ;
	rdfs:subClassOf ex:Human .
ex:reified_triple a rdf:Statement ;
	rdf:subject ex:Paper ;
	rdf:predicate ex:isAbout ;
	rdf:object <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	dc:creator :person01.
:person03 ex:email "mary@example.org" ;
	ex:name "Mary" .
ex:year a rdf:Property ;
	rdfs:domain ex:Publication .
:Paper a ex:InProceedings ;
       ex:isAbout <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
       ex:year "2004" ;
       ex:pages "08" ;
       ex:title "An Overview of RDF Query Languages" ;
       ex:author [ a rdf:Seq ;
		   rdf:_1 :person01 ;
		   rdf:_2 :person02 ;
		   rdf:_3 :person03 ;
		   rdf:_4 :person04
		  ] .
ex:email a rdf:Property ;
	rdfs:domain ex:Person ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
<http://example.org/ACMTopic/Information_Systems> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management> ;
	rdfs:label "Informationsysteme"@de , "Information Systems"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> a acm:Topic ;
	rdfs:label "Anfragesprachen"@de , "Query Languages"@en .
<http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages/Query_Languages> ;
	a acm:Topic ;
	rdfs:label "Sprachen"@de , "Languages"@en .
ex:title a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#STRING> .
ex:InProceedings a rdfs:Class ;
	rdfs:subClassOf ex:Publication .
ex:isAbout a rdf:Property ;
	rdfs:range ex:Topic .
ex:Topic a rdfs:Class .
<http://example.org/ACMTopic/Information_Systems/Database_Management> a acm:Topic ;
	acm:SubTopic <http://example.org/ACMTopic/Information_Systems/Database_Management/Languages> ;
	rdfs:label "Datenbankmanagement"@de , "Database Management"@en .
:person04 a ex:Human ;
	ex:name "Willy" .
ex:Human a rdfs:Class ;
	rdfs:subClassOf ex:Person .
ex:Publication a rdfs:Class .
ex:pages a rdf:Property ;
	rdfs:domain ex:Publication ;
	rdfs:range <http://www.w3.org/2001/XMLSchema#INTEGER> .
    Query
      data/survey/query-survey-13.rq
    prefix ex: <http://example.org/survey-sample/ontology/>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
SELECT ?PUB WHERE {
  ?PUB ex:pages ?n.
  FILTER ( xsd:integer(?n) = 8 )
}
    Results
    data/survey/result-survey-13.ttl
    
      
        | PUB | 
|---|
      | <http://example.org/survey-sample/Paper> | 
      
    
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-basic-01.rq
    SELECT *
WHERE { }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-basic-02.rq
    SELECT * {}
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-basic-03.rq
    # No trailing dot
PREFIX : <http://example.org/ns#>
SELECT *
WHERE { ?x ?y ?z }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-basic-04.rq
    # With trailing dot
SELECT *
WHERE { ?x ?y ?z . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-basic-05.rq
    # Two triples : no trailing dot
SELECT *
WHERE { ?x ?y ?z . ?a ?b ?c }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-basic-06.rq
    # Two triples : with trailing dot
SELECT *
WHERE { ?x ?y ?z . ?a ?b ?c . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-bnodes-01.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { [:p :q ] }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-bnodes-02.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { [] :p :q }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-bnodes-03.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { :x [] :q }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-bnodes-04.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { :x _:a :q }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-bnodes-05.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { [ ?x ?y ] :p [ ?pa ?b ] }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-bnodes-06.rq
    PREFIX : <http://example.org/ns#>
SELECT *
WHERE { [ :p :q ; ] }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-bnodes-07.rq
    PREFIX : <http://example.org/ns#>
SELECT *
WHERE { _:a :p1 :q1 .
        _:a :p2 :q2 .
      }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-expr-01.rq
    SELECT *
WHERE { ?s ?p ?o . FILTER (?o) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-expr-02.rq
    SELECT *
WHERE { ?s ?p ?o . FILTER (?o) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-expr-03.rq
    SELECT *
WHERE { ?s ?p ?o . FILTER REGEX(?o, "foo") }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-expr-04.rq
    SELECT *
WHERE { ?s ?p ?o . FILTER REGEX(?o, "foo", "i") }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-expr-05.rq
    PREFIX xsd:   <http://www.w3.org/2001/XMLSchema#>
SELECT *
WHERE { ?s ?p ?o . FILTER (xsd:integer(?o)) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-expr-06.rq
    PREFIX :      <http://example.org/ns#>
PREFIX xsd:   <http://www.w3.org/2001/XMLSchema#>
SELECT *
WHERE { ?s ?p ?o . FILTER (:myFunc(?s,?o)) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-forms-01.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { ( [ ?x ?y ] ) :p ( [ ?pa ?b ] 57 ) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-forms-02.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { ( [] [] ) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-limit-offset-07.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY ?o
LIMIT 5
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-limit-offset-08.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY ?o
LIMIT 5
OFFSET 3
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-limit-offset-09.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY ?o
OFFSET 3
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lists-01.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { ( ?x ) :p ?z  }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lists-02.rq
    PREFIX : <http://example.org/ns#>
SELECT * WHERE { ?x :p ( ?z ) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lists-03.rq
    SELECT * WHERE { ( ?z ) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lists-04.rq
    SELECT * WHERE { ( ( ?z ) ) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lists-05.rq
    SELECT * WHERE { ( ( ) ) }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-01.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p "x" }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-02.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p 'x' }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-03.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p "x\"y'z" }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-04.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p 'x"y\'z' }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-05.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p "x\"" }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-06.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p 'x\'' }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-07.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p 123 }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-08.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p 123. . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-09.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p """Long
""
Literal
""" }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-10.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p '''Long
'' """
Literal''' }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-11.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p """Long""\"Literal""" }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-12.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p '''Long''\'Literal''' }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-13.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p """Long\"""Literal""" }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-lit-14.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT * WHERE { :x :p '''Long\'''Literal''' }
    
    Query
      
    cannot open '' for printing: No such file or directory
    
    Query
      
    cannot open '' for printing: No such file or directory
    
    Query
      
    cannot open '' for printing: No such file or directory
    
    Query
      
    cannot open '' for printing: No such file or directory
    
    Query
      
    cannot open '' for printing: No such file or directory
    
    Query
      
    cannot open '' for printing: No such file or directory
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-order-01.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY ?o
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-order-02.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY (?o+5)
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-order-03.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY ASC(?o)
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-order-04.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY DESC(?o)
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-order-05.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY DESC(:func(?s, ?o))
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-order-06.rq
    PREFIX :      <http://example.org/ns#>
SELECT *
{ ?s ?p ?o }
ORDER BY
  DESC(?o+57) :func2(?o) ASC(?s)
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-pat-01.rq
    PREFIX : <http:/example.org/ns#>
SELECT *
{ }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-pat-02.rq
    # No DOT after optional
PREFIX : <http:/example.org/ns#>
SELECT *
{ ?a :b :c OPTIONAL{:x :y :z} :x ?y ?z }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-pat-03.rq
    # No DOT between non-triples patterns
PREFIX : <http:/example.org/ns#>
SELECT *
{ ?a :b :c
  OPTIONAL{:x :y :z}
  { :x1 :y1 :z1 } UNION { :x2 :y2 :z2 }
}
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-pat-04.rq
    # No DOT between non-triples patterns
PREFIX : <http:/example.org/ns#>
SELECT *
{
  OPTIONAL{:x :y :z}
  ?a :b :c
  { :x1 :y1 :z1 } UNION { :x2 :y2 :z2 }
}
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-07.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT *
WHERE { : : : . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-08.rq
    BASE   <http://example.org/>
PREFIX :  <#>
PREFIX x.y:  <x#>
SELECT *
WHERE { :a.b  x.y:  : . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-09.rq
    PREFIX : <http://example.org/ns#>
SELECT *
WHERE { :_1 :p.rdf :z.z . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-10.rq
    PREFIX :  <http://example.org/ns#>
PREFIX a: <http://example.org/ns2#>
SELECT *
WHERE { : a: :a . : : : . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-11.rq
    PREFIX :  <>
SELECT *
WHERE { : : : . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-12.rq
    PREFIX :  <#>
SELECT *
WHERE { : : : . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-13.rq
    BASE   <http://example.org/>
PREFIX :  <#>
SELECT *
WHERE { : : : . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-qname-14.rq
    BASE   <http://example.org/>
PREFIX :  <#>
PREFIX x.y:  <x#>
SELECT *
WHERE { :a.b  x.y:  : . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-01.rq
    # Operator
PREFIX :  <http://example.org/ns#>
SELECT *
{ OPTIONAL { } }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-02.rq
    # Operator
PREFIX :  <http://example.org/ns#>
SELECT *
{ OPTIONAL { :a :b :c } }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-03.rq
    # Triple, no DOT, operator
PREFIX :  <http://example.org/ns#>
SELECT *
{ :p :q :r OPTIONAL { :a :b :c } }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-04.rq
    # Triple, DOT, operator
PREFIX :  <http://example.org/ns#>
SELECT *
{ :p :q :r . OPTIONAL { :a :b :c } }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-05.rq
    # Triple, DOT, operator
PREFIX :  <http://example.org/ns#>
SELECT *
{ :p :q :r . OPTIONAL { :a :b :c } }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-06.rq
    # Triple, DOT, operator, DOT
PREFIX :  <http://example.org/ns#>
SELECT *
{ :p :q :r . OPTIONAL { :a :b :c } . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-07.rq
    # Operator, no DOT
PREFIX :  <http://example.org/ns#>
SELECT *
{ OPTIONAL { :a :b :c } }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-08.rq
    # Operator, DOT
PREFIX :  <http://example.org/ns#>
SELECT *
{ OPTIONAL { :a :b :c } . }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-09.rq
    # Operator, triple
PREFIX :  <http://example.org/ns#>
SELECT *
{ OPTIONAL { :a :b :c } ?x ?y ?z }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-struct-10.rq
    # Operator, DOT triple
PREFIX :  <http://example.org/ns#>
SELECT *
{ OPTIONAL { :a :b :c } . ?x ?y ?z }
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-union-01.rq
    PREFIX : <http://example.org/ns#>
SELECT *
{
  { ?s ?p ?o } UNION { ?a ?b ?c }
}
    
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-union-02.rq
    PREFIX : <http://example.org/ns#>
SELECT *
{
  { ?s ?p ?o } UNION { ?a ?b ?c } UNION { ?r ?s ?t }
}
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-keywords-01.rq
    # use keyword FILTER as a namespace prefix
PREFIX FILTER: <http://example.org/ns#>
SELECT *
WHERE { ?x FILTER:foo ?z FILTER (?z) }
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-keywords-02.rq
    # use keyword FILTER as a local name
PREFIX : <http://example.org/ns#>
SELECT *
WHERE { ?x :FILTER ?z FILTER (?z) }
    
    Data
    
      data/SyntaxFull/empty.nt
    
    
    Query
      data/SyntaxFull/syntax-keywords-03.rq
    # use keyword UNION as a namespace prefix
PREFIX UNION: <http://example.org/ns#>
SELECT *
WHERE { ?x UNION:foo ?z }
    
    Syntax: using ? for variables in triple patterns
    Data
    
      data/Syntax/syn-data-01.n3
    
    @prefix :           <http://example.org/ns#> .
:a :a "AAAA" .
    Query
      data/Syntax/syntax-001.rq
    # Test of syntax
SELECT * WHERE { ?x ?y ?z }
    Results
    data/Syntax/result-syn-001.n3
    
      
        | x | y | z | 
|---|
      | <http://example.org/ns#a> | <http://example.org/ns#a> | "AAAA" | 
      
    
    
    Syntax: using $ for variables in triple patterns
    Data
    
      data/Syntax/syn-data-01.n3
    
    @prefix :           <http://example.org/ns#> .
:a :a "AAAA" .
    Query
      data/Syntax/syntax-001.rq
    # Test of syntax
SELECT * WHERE { ?x ?y ?z }
    Results
    data/Syntax/result-syn-002.n3
    
      
        | x | y | z | 
|---|
      | <http://example.org/ns#a> | <http://example.org/ns#a> | "AAAA" | 
      
    
    
    Syntax: using $ and ? for variables in triple patterns
    Data
    
      data/Syntax/syn-data-01.n3
    
    @prefix :           <http://example.org/ns#> .
:a :a "AAAA" .
    Query
      data/Syntax/syntax-003.rq
    # Test of syntax
SELECT * WHERE { ?x $x ?z }
    Results
    data/Syntax/result-syn-003.n3
    
      
        | x | z | 
|---|
      | <http://example.org/ns#a> | "AAAA" | 
      
    
    
    Syntax: using . in qname of triple pattern
    Data
    
      data/Syntax/syn-data-02.n3
    
    @prefix : <http://example.org/data/> .
:x :p <http://example.org/data/v1.1> .
:x :p <http://example.org/data/v2.1> .
    Query
      data/Syntax/syntax-004.rq
    PREFIX : <http://example.org/data/>
SELECT *
WHERE { ?x :p :v1.1 . }
    Results
    data/Syntax/result-syn-004.n3
    
      
        | x | 
|---|
      | <http://example.org/data/x> | 
      
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-double-double.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:double1 rdf:value ?l .
         t:double1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:double ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-double-float.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:double1 rdf:value ?l .
         t:float1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:double ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-double-decimal.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:double1 rdf:value ?l .
         t:decimal1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:double ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-float-float.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:float1 rdf:value ?l .
         t:float1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:float ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-float-decimal.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:float1 rdf:value ?l .
         t:decimal1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:float ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-decimal-decimal.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:decimal1 rdf:value ?l .
         t:decimal1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:decimal ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-integer-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:integer1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-nonPositiveInteger-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:nonPositiveIntegerN1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-negativeInteger-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:negativeIntegerN1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-long-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:long1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-int-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:int1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-byte-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:byte1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-nonNegativeInteger-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:nonNegativeInteger1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-unsignedLong-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:unsignedLong1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-unsignedInt-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:unsignedInt1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-unsignedShort-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:unsignedShort1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-unsignedByte-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:unsignedByte1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-positiveInteger-short.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:positiveInteger1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:integer ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-double.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:double1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:double ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-float.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:float1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:float ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-decimal.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:decimal1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:decimal ) }
    Results
    data/TypePromotion/true.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-short-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:short ) }
    Results
    data/TypePromotion/false.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-byte-short-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:byte1 rdf:value ?l .
         t:short1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:short ) }
    Results
    data/TypePromotion/false.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-long-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:long1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:decimal ) }
    Results
    data/TypePromotion/false.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-int-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:int1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:float ) }
    Results
    data/TypePromotion/false.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-short-byte-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:short1 rdf:value ?l .
         t:byte1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:double ) }
    Results
    data/TypePromotion/false.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-double-float-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:double1 rdf:value ?l .
         t:float1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:float ) }
    Results
    data/TypePromotion/false.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-double-decimal-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:double1 rdf:value ?l .
         t:decimal1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:decimal ) }
    Results
    data/TypePromotion/false.ttl
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/TypePromotion/tP.ttl
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#> .
t:decimal1		rdf:value	"1"^^xsd:decimal .
t:float1		rdf:value	"1"^^xsd:float .
t:double1		rdf:value	"1"^^xsd:double .
t:booleanT		rdf:value	"true"^^xsd:boolean .
t:dateTime1		rdf:value	"2005-01-14T12:34:56"^^xsd:dateTime .
# types derived from xsd:decimal:
 t:integer1		rdf:value	"1"^^xsd:integer .
  t:nonPositiveIntegerN1	rdf:value	"-1"^^xsd:nonPositiveInteger .
   t:negativeIntegerN1	rdf:value	"-1"^^xsd:negativeInteger .
  t:long1		rdf:value	"1"^^xsd:long .
   t:int1		rdf:value	"1"^^xsd:int .
    t:short1		rdf:value	"1"^^xsd:short .
     t:byte1		rdf:value	"1"^^xsd:byte .
  t:nonNegativeInteger1	rdf:value	"1"^^xsd:nonNegativeInteger .
   t:unsignedLong1	rdf:value	"1"^^xsd:unsignedLong .
    t:unsignedInt1	rdf:value	"1"^^xsd:unsignedInt .
     t:unsignedShort1	rdf:value	"1"^^xsd:unsignedShort .
      t:unsignedByte1	rdf:value	"1"^^xsd:unsignedByte .
   t:positiveInteger1	rdf:value	"1"^^xsd:positiveInteger .
    Query
      data/TypePromotion/tP-float-decimal-fail.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX t: <http://www.w3.org/2001/sw/DataAccess/tests/data/TypePromotion/tP-0#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK
 WHERE { t:float1 rdf:value ?l .
         t:decimal1 rdf:value ?r .
         FILTER ( datatype(?l + ?r) = xsd:decimal ) }
    Results
    data/TypePromotion/false.ttl
    
    
    Inference test from http://lists.w3.org/Archives/Public/public-rdf-dawg/2004OctDec/0538.html
    Data
    
      data/unsaid-inference/data-a.n3
    
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix :     <http://example.com/#> .
:C1 rdfs:subClassOf :C2 .
:x rdf:type :C1 .
    Query
      data/unsaid-inference/query-01.rq
    PREFIX : <http://example.com/#>
SELECT ?c WHERE (:x rdf:type ?c)
    Results
    data/unsaid-inference/result-01.n3
    
      
        | c | 
|---|
      | <http://example.com/#C1> | 
      
    
    
    UNSAID test from http://lists.w3.org/Archives/Public/public-rdf-dawg/2004OctDec/0538.html
    Data
    
      data/unsaid-inference/data-a.n3
    
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix :     <http://example.com/#> .
:C1 rdfs:subClassOf :C2 .
:x rdf:type :C1 .
    Query
      data/unsaid-inference/query-02.rq
    PREFIX : <http://example.com/#>
SELECT ?x WHERE UNSAID (?x rdf:type :C2)
    Results
    data/unsaid-inference/result-02.n3
    
      
        | x | 
|---|
      | <http://example.com/#x> | 
      
    
    
    UNSAID test from http://lists.w3.org/Archives/Public/public-rdf-dawg/2004OctDec/0538.html expressed as an ASK
    Data
    
      data/unsaid-inference/data-a.n3
    
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix :     <http://example.com/#> .
:C1 rdfs:subClassOf :C2 .
:x rdf:type :C1 .
    Query
      data/unsaid-inference/query-03.rq
    cannot open 'data/unsaid-inference/query-03.rq' for printing: No such file or directory
    Results
    data/unsaid-inference/result-03.n3
    
    
    Only extended types with identical lexical and datatypes can be tested for = .
    Data
    
      data/ValueTesting/extendedType-0.n3
    
    @prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#> .
@prefix air: <http://www.daml.org/2001/10/html/airport-ont#> .
loc:a	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:geodetic ;
		loc:rotational "30.300000"^^loc:latitude ;
		loc:orthogonal "-97.700000"^^loc:longitude
	]
 .
loc:b	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:EarthCenteredEarthFixed ;
		loc:rotational "-7420507.1"^^loc:ECEF_X ;
		loc:orthogonal "-5462738.5"^^loc:ECEF_Y
	]
 .
    Query
      data/ValueTesting/extendedType-eq-pass.rq
    # Only extended types with identical lexical rep and datatypes can be = .
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#>
PREFIX wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX air: <http://www.daml.org/2001/10/html/airport-ont#>
#PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
#SELECT ?a1 (xsd:float(xsd:string(?rot1))-5.5) ?a2
SELECT ?a1 ?a2
 WHERE {?a1 air:name ?name1 ;
            loc:location ?l1 .
        ?l1 loc:rotational ?rot1 .
        ?a2 air:name ?name2 ;
            loc:location ?l2 .
        ?l2 loc:rotational ?rot2 .
        FILTER (?rot1 = ?rot2)}
#        FILTER (str(?rot1) = "-7420507.1")}
    Results
    data/ValueTesting/extendedType-eq-pass-result.n3
    
      
        | a2 | a1 | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#b> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#b> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#a> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#a> | 
      
    
    
    
    Opaque types can not be tested for != .
    Data
    
      data/ValueTesting/extendedType-0.n3
    
    @prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#> .
@prefix air: <http://www.daml.org/2001/10/html/airport-ont#> .
loc:a	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:geodetic ;
		loc:rotational "30.300000"^^loc:latitude ;
		loc:orthogonal "-97.700000"^^loc:longitude
	]
 .
loc:b	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:EarthCenteredEarthFixed ;
		loc:rotational "-7420507.1"^^loc:ECEF_X ;
		loc:orthogonal "-5462738.5"^^loc:ECEF_Y
	]
 .
    Query
      data/ValueTesting/extendedType-ne-fail.rq
    # Opaque types can not be tested for != .
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#>
PREFIX wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX air: <http://www.daml.org/2001/10/html/airport-ont#>
SELECT ?a1 ?a2
 WHERE {?a1 air:name ?name1 ;
            loc:location ?l1 .
        ?l1 loc:rotational ?rot1 .
        ?a2 air:name ?name2 ;
            loc:location ?l2 .
        ?l2 loc:rotational ?rot2 .
        FILTER (?rot1 != ?rot2) }
    Results
    data/ValueTesting/extendedType-ne-fail-result.n3
    
    
    NotApproved
    Test FILTER match on extended type.
    Data
    
      data/ValueTesting/extendedType-0.n3
    
    @prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#> .
@prefix air: <http://www.daml.org/2001/10/html/airport-ont#> .
loc:a	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:geodetic ;
		loc:rotational "30.300000"^^loc:latitude ;
		loc:orthogonal "-97.700000"^^loc:longitude
	]
 .
loc:b	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:EarthCenteredEarthFixed ;
		loc:rotational "-7420507.1"^^loc:ECEF_X ;
		loc:orthogonal "-5462738.5"^^loc:ECEF_Y
	]
 .
    Query
      data/ValueTesting/extendedType-literal-eq.rq
    # Test FILTER match on extended type.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#>
PREFIX air: <http://www.daml.org/2001/10/html/airport-ont#>
SELECT ?a1
 WHERE {?a1 air:name ?name1 ;
            loc:location ?l1 .
        ?l1 loc:rotational ?r1 .
        FILTER (?r1 = "-7420507.1"^^loc:ECEF_X) }
    Results
    data/ValueTesting/extendedType-literal-eq-result.n3
    
      
        | a1 | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#b> | 
      
    
    
    NotApproved
    Test FILTER negative match on extended type.
    Data
    
      data/ValueTesting/extendedType-0.n3
    
    @prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#> .
@prefix air: <http://www.daml.org/2001/10/html/airport-ont#> .
loc:a	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:geodetic ;
		loc:rotational "30.300000"^^loc:latitude ;
		loc:orthogonal "-97.700000"^^loc:longitude
	]
 .
loc:b	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:EarthCenteredEarthFixed ;
		loc:rotational "-7420507.1"^^loc:ECEF_X ;
		loc:orthogonal "-5462738.5"^^loc:ECEF_Y
	]
 .
    Query
      data/ValueTesting/extendedType-literal-ne.rq
    # Test FILTER negative match on extended type.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#>
PREFIX air: <http://www.daml.org/2001/10/html/airport-ont#>
SELECT ?a1 ?a2
 WHERE {?a1 air:name ?name1 ;
            loc:location ?l1 .
        ?l1 loc:rotational ?r .
        FILTER (?r != "-7420507.1"^^loc:ECEF_X) }
    Results
    data/ValueTesting/extendedType-literal-ne-result.n3
    
    
    NotApproved
    Test graph match on extended type.
    Data
    
      data/ValueTesting/extendedType-0.n3
    
    @prefix r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#> .
@prefix air: <http://www.daml.org/2001/10/html/airport-ont#> .
loc:a	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:geodetic ;
		loc:rotational "30.300000"^^loc:latitude ;
		loc:orthogonal "-97.700000"^^loc:longitude
	]
 .
loc:b	air:name "Austin Bergstrom International" ;
	loc:location [ r:type loc:EarthCenteredEarthFixed ;
		loc:rotational "-7420507.1"^^loc:ECEF_X ;
		loc:orthogonal "-5462738.5"^^loc:ECEF_Y
	]
 .
    Query
      data/ValueTesting/extendedType-graph.rq
    # Test graph match on extended type.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX loc: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#>
PREFIX air: <http://www.daml.org/2001/10/html/airport-ont#>
SELECT ?a1
 WHERE {?a1 air:name ?name1 ;
            loc:location ?l1 .
        ?l1 loc:rotational "-7420507.1"^^loc:ECEF_X }
    Results
    data/ValueTesting/extendedType-graph-result.n3
    
      
        | a1 | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/extendedType-0#b> | 
      
    
    
    NotApproved
    Positive test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/ValueTesting/typePromotion-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/typePromotion-0#> .
t:one	rdf:value	"1"^^xsd:unsignedByte .
t:two	rdf:value	"2"^^xsd:unsignedShort .
    Query
      data/ValueTesting/typePromotion-decimal-decimal-pass.rq
    # Positive test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?one ?two
 WHERE { ?one rdf:value ?oneL .
         ?two rdf:value ?twoL .
         FILTER ( datatype(?oneL) = xsd:unsignedByte &&
                  datatype(?twoL) = xsd:unsignedShort &&
                  datatype(?oneL + ?twoL) = xsd:decimal ) }
    Results
    data/ValueTesting/typePromotion-decimal-decimal-pass-result.n3
    
      
        | one | two | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/typePromotion-0#one> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/typePromotion-0#two> | 
      
    
    
    NotApproved
    Negative test: product of type promotion within the xsd:decimal type tree.
    Data
    
      data/ValueTesting/typePromotion-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/typePromotion-0#> .
t:one	rdf:value	"1"^^xsd:unsignedByte .
t:two	rdf:value	"2"^^xsd:unsignedShort .
    Query
      data/ValueTesting/typePromotion-decimal-decimal-fail.rq
    # Negative test: product of type promotion within the xsd:decimal type tree.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?one ?two
 WHERE { ?one rdf:value ?oneL .
         ?two rdf:value ?twoL .
         FILTER ( datatype(?oneL) = xsd:unsignedByte &&
                  datatype(?twoL) = xsd:unsignedShort &&
                  datatype(?oneL + ?twoL) = xsd:unsignedShort ) }
    Results
    data/ValueTesting/typePromotion-decimal-decimal-fail-result.n3
    
    
    
    false^^xsd:boolean = 0^^xsd:boolean .
    Data
    
      data/ValueTesting/boolean-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#> .
# test values from http://www.w3.org/TR/xmlschema-2/#boolean
t:fdigit	rdf:value	"0"^^xsd:boolean .
t:ftext		rdf:value	"false"^^xsd:boolean .
t:tdigit	rdf:value	"1"^^xsd:boolean .
t:ttext		rdf:value	"true"^^xsd:boolean .
    Query
      data/ValueTesting/boolean-equiv-FALSE.rq
    # "false"^^xsd:boolean = "0"^^xsd:boolean .
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?one
 WHERE { ?one rdf:value ?oneL .
         FILTER ( ?oneL = FALSE ) }
    Results
    data/ValueTesting/boolean-equiv-FALSE-result.n3
    
      
        | one | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ftext> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#fdigit> | 
      
    
    
    
    true^^xsd:boolean = 1^^xsd:boolean .
    Data
    
      data/ValueTesting/boolean-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#> .
# test values from http://www.w3.org/TR/xmlschema-2/#boolean
t:fdigit	rdf:value	"0"^^xsd:boolean .
t:ftext		rdf:value	"false"^^xsd:boolean .
t:tdigit	rdf:value	"1"^^xsd:boolean .
t:ttext		rdf:value	"true"^^xsd:boolean .
    Query
      data/ValueTesting/boolean-equiv-TRUE.rq
    # "true"^^xsd:boolean = "1"^^xsd:boolean .
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?one
 WHERE { ?one rdf:value ?oneL .
         FILTER ( ?oneL = TRUE ) }
    Results
    data/ValueTesting/boolean-equiv-TRUE-result.n3
    
      
        | one | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#tdigit> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | 
      
    
    
    
    T=T T=1 1=T 1=1 F=F F=0 0=F 0=0 .
    Data
    
      data/ValueTesting/boolean-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#> .
# test values from http://www.w3.org/TR/xmlschema-2/#boolean
t:fdigit	rdf:value	"0"^^xsd:boolean .
t:ftext		rdf:value	"false"^^xsd:boolean .
t:tdigit	rdf:value	"1"^^xsd:boolean .
t:ttext		rdf:value	"true"^^xsd:boolean .
    Query
      data/ValueTesting/boolean-equiv-xsdType.rq
    # T=T T=1 1=T 1=1 F=F F=0 0=F 0=0 .
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?one ?two
 WHERE { ?one rdf:value ?oneL .
         ?two rdf:value ?twoL .
         FILTER ( ?oneL = ?twoL ) }
    Results
    data/ValueTesting/boolean-equiv-xsdType-result.n3
    
      
        | one | two | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#fdigit> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#fdigit> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#fdigit> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ftext> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ftext> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#fdigit> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ftext> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ftext> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#tdigit> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#tdigit> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#tdigit> | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#tdigit> | 
      
    
    
    
    Result of func-logical-or is the same term as xsd:boolean true.
    Data
    
      data/ValueTesting/boolean-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#> .
# test values from http://www.w3.org/TR/xmlschema-2/#boolean
t:fdigit	rdf:value	"0"^^xsd:boolean .
t:ftext		rdf:value	"false"^^xsd:boolean .
t:tdigit	rdf:value	"1"^^xsd:boolean .
t:ttext		rdf:value	"true"^^xsd:boolean .
    Query
      data/ValueTesting/boolean-logical-OR.rq
    # EBV result is the same as an xsd:boolean
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?one
 WHERE { ?one rdf:value ?oneL .
         FILTER ( (TRUE || FALSE) = ?oneL ) }
    Results
    data/ValueTesting/boolean-logical-OR-result.n3
    
      
        | one | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#tdigit> | 
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | 
      
    
    
    
    Graph match on the canonical lexical form of FALSE.
    Data
    
      data/ValueTesting/boolean-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#> .
# test values from http://www.w3.org/TR/xmlschema-2/#boolean
t:fdigit	rdf:value	"0"^^xsd:boolean .
t:ftext		rdf:value	"false"^^xsd:boolean .
t:tdigit	rdf:value	"1"^^xsd:boolean .
t:ttext		rdf:value	"true"^^xsd:boolean .
    Query
      data/ValueTesting/boolean-false-canonical.rq
    # Graph match on the canonical lexical form of FALSE.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s
 WHERE { ?s ?p FALSE }
    Results
    data/ValueTesting/boolean-false-canonical-result.n3
    
      
        | s | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ftext> | 
      
    
    
    
    Graph match on the canonical lexical form of TRUE.
    Data
    
      data/ValueTesting/boolean-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#> .
# test values from http://www.w3.org/TR/xmlschema-2/#boolean
t:fdigit	rdf:value	"0"^^xsd:boolean .
t:ftext		rdf:value	"false"^^xsd:boolean .
t:tdigit	rdf:value	"1"^^xsd:boolean .
t:ttext		rdf:value	"true"^^xsd:boolean .
    Query
      data/ValueTesting/boolean-true-canonical.rq
    # Graph match on the canonical lexical form of TRUE.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s
 WHERE { ?s ?p TRUE }
    Results
    data/ValueTesting/boolean-true-canonical-result.n3
    
      
        | s | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | 
      
    
    
    
    = match on the canonical lexical result of an EBV.
    Data
    
      data/ValueTesting/boolean-0.n3
    
    # $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix t: <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#> .
# test values from http://www.w3.org/TR/xmlschema-2/#boolean
t:fdigit	rdf:value	"0"^^xsd:boolean .
t:ftext		rdf:value	"false"^^xsd:boolean .
t:tdigit	rdf:value	"1"^^xsd:boolean .
t:ttext		rdf:value	"true"^^xsd:boolean .
    Query
      data/ValueTesting/boolean-EBV-canonical.rq
    # = match on the canonical lexical result of an EBV.
# $Id: index.html,v 1.72 2007/09/20 14:25:08 aseaborne Exp $
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s
 WHERE { ?s ?p ?o
         FILTER ( str(TRUE || FALSE) = str(?o) ) }
    Results
    data/ValueTesting/boolean-EBV-canonical-result.n3
    
      
        | s | 
|---|
      | <http://www.w3.org/2001/sw/DataAccess/tests/data/ValueTesting/boolean-0#ttext> | 
      
    
    
    FILTER with < on xsd:string
    Data
    
      data/ValueTesting/xsd-string-data.n3
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a foaf:name "Eve"^^xsd:string .
_:b foaf:name "Alice"^^xsd:string .
_:c foaf:name "Fred"^^xsd:string .
_:e foaf:name "Bob"^^xsd:string .
_:f foaf:name "Sue"^^xsd:string .
    Query
      data/ValueTesting/xsd-string-lt.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
PREFIX xsd:        <http://www.w3.org/2001/XMLSchema#>
SELECT ?name
WHERE {
	_:someone foaf:name ?name .
	FILTER ( ?name < "M"^^xsd:string )
}
    Results
    data/ValueTesting/xsd-string-lt-result.rdf
    
      
        | name | 
|---|
      | "Fred" | 
      | "Eve" | 
      | "Bob" | 
      | "Alice" | 
      
    
    
    FILTER with > on xsd:string
    Data
    
      data/ValueTesting/xsd-string-data.n3
    
    @prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> .
_:a foaf:name "Eve"^^xsd:string .
_:b foaf:name "Alice"^^xsd:string .
_:c foaf:name "Fred"^^xsd:string .
_:e foaf:name "Bob"^^xsd:string .
_:f foaf:name "Sue"^^xsd:string .
    Query
      data/ValueTesting/xsd-string-gt.rq
    PREFIX foaf:       <http://xmlns.com/foaf/0.1/>
PREFIX xsd:        <http://www.w3.org/2001/XMLSchema#>
SELECT ?name
WHERE {
	_:someone foaf:name ?name .
	FILTER ( ?name > "M"^^xsd:string )
}
    Results
    data/ValueTesting/xsd-string-gt-result.rdf