SPARQL-star Syntax Tests

Generated from:manifest.jsonld
creator: RDF-star Interest Group within the W3C RDF-DEV Community Group
issued:2021-06-21
modified:2021-07-18
see also:https://w3c.github.io/rdf-tests/

Entries:

About this test suite

https://w3c.github.io/rdf-tests/

SPARQL-star - subject quoted triple 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-basic-01.rq
PREFIX : <http://example.com/ns#>

SELECT * {
    << :a :b :c >> :p1 :o1.
}
MUST be accepted

SPARQL-star - object quoted triple 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-basic-02.rq
PREFIX : <http://example.com/ns#>

SELECT * {
    :s :p << :a :b "c" >> .
}
MUST be accepted

SPARQL-star - subject quoted triple - vars 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-basic-03.rq
PREFIX : <http://example.com/ns#>

SELECT * {
    << ?s ?p ?o >> ?Y ?Z .
}
MUST be accepted

SPARQL-star - object quoted triple - vars 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-basic-04.rq
PREFIX : <http://example.com/ns#>

SELECT * {
    ?S ?P << ?a ?b ?c >> .
}
MUST be accepted

SPARQL-star - Embedded triple in VALUES 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-basic-05.rq
PREFIX : <http://example.com/ns#>

SELECT * {
    VALUES ?x {
        <<:s :p :o >>
        << <<:s :p :o >> :q :z >>
    }
    VALUES (?y ?z) { (<<:s :p :o >> 123 )
                      (123 <<:s :p :o >> ) }
}
MUST be accepted

SPARQL-star - Embedded triple in CONSTRUCT 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-basic-06.rq
PREFIX : <http://example.com/ns#>

CONSTRUCT { <<:s :p :o >> :q :z }
WHERE {}
MUST be accepted

SPARQL-star - Embedded triples in CONSTRUCT WHERE 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-basic-07.rq
PREFIX : <http://example.com/ns#>

CONSTRUCT WHERE {
   <<?s ?p ?o >> ?q ?z .
   ?a ?b <<?s ?p ?o >> .
}
MUST be accepted

SPARQL-star - quoted triple inside blankNodePropertyList 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-inside-01.rq
PREFIX : <http://example.com/ns#>

SELECT * {
    [ ?Q <<:s ?P :o>> ] :b :c .
}
MUST be accepted

SPARQL-star - quoted triple inside collection 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-inside-02.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ( <<?S1 :p :o1>> <<?S2 :p :o2>> )  :q 123 .
}
MUST be accepted

SPARQL-star - nested quoted triple, subject position 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-nested-01.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  <<?S :p :o >> :r :z .
  << <<?S :p :o >> :r :z >> :q 1 .
}
MUST be accepted

SPARQL-star - nested quoted triple, object position 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-nested-02.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  :a :q <<:s :p ?O >> .
  << :a :q <<:s :p ?O >>>> :r :z .
}
MUST be accepted

SPARQL-star - compound forms 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-compound.rq
PREFIX : <http://example.com/ns#>

SELECT * {

  <<:x ?R :z >> :p <<:a :b ?C >> .

  << <<:x ?R :z >> :p <<:a :b [] >> >>
     :q
  << <<[] ?R :z >> :p <<:a :b [] >> >> .
}
MUST be accepted

SPARQL-star - blank node subject 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-bnode-01.rq
PREFIX : <http://example.com/ns#>

SELECT * {
   <<_:a :p :o >> :q 456 .
}
MUST be accepted

SPARQL-star - blank node object 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-bnode-02.rq
PREFIX : <http://example.com/ns#>

SELECT * {
   <<:s :p _:a >> :q 456 .
}
MUST be accepted

SPARQL-star - blank node 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-bnode-03.rq
PREFIX : <http://example.com/ns#>

SELECT * {
    <<[] :p [] >> :q :z .
}
MUST be accepted

SPARQL-star - Annotation form 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-01.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o {| :r ?Z |} .
}
MUST be accepted

SPARQL-star - Annotation example 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-02.rq
PREFIX :        <http://example.com/ns#>
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>

SELECT * {
   :s :p :o {| :source [ :graph <http://host1/> ;
                         :date "2020-01-20"^^xsd:date
                       ] ;
               ?source [ :graph <http://host2/> ;
                         :date "2020-12-31"^^xsd:date
                       ]
             |}
}
MUST be accepted

SPARQL-star - Annotation example 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-03.rq
PREFIX :        <http://example.com/ns#>
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>

SELECT * {
   :s :p <<:a :b :c>> {| ?q ?z |}
}
MUST be accepted

SPARQL-star - Annotation with quoting 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-04.rq
PREFIX :        <http://example.com/ns#>
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>

SELECT * {
   :s :p <<:a :b :c>> {| ?q <<:s1 :p1 ?z>> |}
}
MUST be accepted

SPARQL-star - Annotation on triple with quoted object 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-05.rq
PREFIX :        <http://example.com/ns#>
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>

SELECT * {
   <<?s :p1 :o1>> ?p ?o {| :r ?Z |} .
}
MUST be accepted

SPARQL-star - Annotation with path 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-06.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o {| :r/:q 'ABC' |} .
}
MUST be accepted

SPARQL-star - Annotation with nested path 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-07.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o {| :r [ :p1|:p2 'ABC'] |} .
}
MUST be accepted

SPARQL-star - Annotation in CONSTRUCT 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-08.rq
PREFIX : <http://example.com/ns#>

CONSTRUCT {
      ?s ?p ?o {| :source ?g |}
}
WHERE { GRAPH ?g { ?s ?p ?o } }
MUST be accepted

SPARQL-star - Annotation in CONSTRUCT WHERE 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-annotation-09.rq
PREFIX : <http://example.com/ns#>

CONSTRUCT WHERE {
  ?s :p ?o {| :q1 ?z |} 
}
MUST be accepted

SPARQL-star - Expressions - Embedded triple 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-expr-01.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o .
  BIND(<<?s ?p ?o>> AS ?t)
}
MUST be accepted

SPARQL-star - Expressions - Embedded triple 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-expr-02.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o .
  BIND(<< <<?s ?p ?o>> :q :z >> AS ?t)
}
MUST be accepted

SPARQL-star - Expressions - Functions 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-expr-03.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o .
  BIND(TRIPLE(?s, ?p, ?o) AS ?t1)
}
MUST be accepted

SPARQL-star - Expressions - TRIPLE 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-expr-04.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o .
  BIND(TRIPLE(?s, ?p, str(?o)) AS ?t2)
}
MUST be accepted

SPARQL-star - Expressions - Functions 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-expr-05.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?t :source :g
  FILTER(isTriple(?t))
  FILTER(SUBJECT(?t) = :s)
  FILTER(PREDICATE(?t) = :p)
  FILTER(OBJECT(?t) = :o)
}
MUST be accepted

SPARQL-star - Expressions - BIND - CONSTRUCT 🔗

status:proposed
type:PositiveSyntaxTest11
sparql-star-syntax-expr-06.rq
PREFIX : <http://example.com/ns#>

CONSTRUCT {
  ?t :graph ?g .
} WHERE {
  GRAPH ?g {
    ?s ?p ?o .
    BIND(<<?s ?p  ?o>> AS ?t)
  }
}
MUST be accepted

SPARQL-star - bad - quoted triple as predicate 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-01.rq
PREFIX : <http://example.com/ns#>

SELECT * {
   :x <<:s :p :o>> 123 .
}
MUST be rejected

SPARQL-star - bad - quoted triple outside triple 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-02.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  <<?s ?p ?o>>
}
MUST be rejected

SPARQL-star - bad - collection list in quoted triple 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-03.rq
PREFIX : <http://example.com/ns#>

SELECT * {
   <<?s :p ("abc") >> :q 123 .
}
MUST be rejected

SPARQL-star - bad - literal in subject position of quoted triple 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-04.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  <<:s 3 :o >> :q ?z .
}
MUST be rejected

SPARQL-star - bad - blank node as predicate in quoted triple 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-05.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  <<:s [] :o>> :q 123 .
}
MUST be rejected

SPARQL-star - bad - compound blank node expression 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-06.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  <<:s :p [ :p1 :o1 ]  >> :q 123 .
}
MUST be rejected

SPARQL-star - bad - incomplete quoted triple 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-07.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  << :s :p >> :q :o .
}
MUST be rejected

SPARQL-star - bad - quad quoted triple 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-08.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  << :g :s :p :o >> :q :o .
}
MUST be rejected

SPARQL-star - bad - variable in quoted triple in VALUES 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-09.rq
PREFIX : <http://example.com/>

SELECT * {
    VALUES ?x { << :s :p ?o >> }
}
MUST be rejected

SPARQL-star - bad - blank node in quoted triple in VALUES 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-10.rq
PREFIX : <http://example.com/>

SELECT * {
    VALUES ?x { << :s :p [] >> }
}
MUST be rejected

SPARQL-star - bad - blank node in quoted triple in FILTER 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-11.rq
PREFIX : <http://example.com/>

SELECT * {
    ?s ?p ?o .
    BIND(<< [] ?p ?o >> AS ?t )
}
MUST be rejected

SPARQL-star - bad - blank node in quoted triple in BIND 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-12.rq
PREFIX : <http://example.com/>

SELECT * {
    ?s ?p ?o .
    FILTER ( isTRIPLE(<< ?s ?p [] >>) )
}
MUST be rejected

SPARQL-star - bad - empty annotation 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-1.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  :s :p :o {|  |} .
}

MUST be rejected

SPARQL-star - bad - triples in annotation 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-2.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  :a :b ?X {| :s :p ?O  |} .
}

MUST be rejected

SPARQL-star - bad - path - seq 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-path-1.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  :x :p/:q :o {| ?p ?o |}
}
MUST be rejected

SPARQL-star - bad - path - alt 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-path-2.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  :x (:p|:q) {| ?p ?o |}
}
MUST be rejected

SPARQL-star - bad - path - p* 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-path-3.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  :x :p* {| ?p ?o |}
}
MUST be rejected

SPARQL-star - bad - path - p+ 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-path-4.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  :x :p+ {| ?p ?o |}
}
MUST be rejected

SPARQL-star - bad - path - p? 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-path-5.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?X :p? {| ?p ?o |} 
}
MUST be rejected

SPARQL-star - bad - path in CONSTRUCT 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-path-6.rq
PREFIX : <http://example.com/ns#>

CONSTRUCT {
  ?s :p {| (:q1|:q2) :o |} 
} WHERE
  ?s :p ?o 
}
MUST be rejected

SPARQL-star - bad - path in CONSTRUCT 🔗

status:proposed
type:NegativeSyntaxTest11
sparql-star-syntax-bad-ann-path-7.rq
PREFIX : <http://example.com/ns#>

CONSTRUCT WHERE {
  ?s :p :z {| (:q1|:q2) ?o |} 
}
MUST be rejected

SPARQL-star - update 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-1.ru
PREFIX : <http://example.com/ns#>

INSERT DATA {
    << :a :b :c >> :p :o .
}
MUST result into

SPARQL-star - update 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-2.ru
PREFIX : <http://example.com/ns#>

INSERT DATA {
    :s :p :o {| :y :z |}
}
MUST result into

SPARQL-star - update 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-3.ru
PREFIX : <http://example.com/ns#>

INSERT {
    << :a :b :c >> ?P :o2  {| ?Y ?Z |}
} WHERE {
   << :a :b :c >> ?P :o1 {| ?Y ?Z |}
}

MUST result into

SPARQL-star - update with quoting 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-4.ru
PREFIX : <http://example.com/ns#>

INSERT {
    << :a :b :c >> ?P :o2  {| ?Y <<:s1 :p1 ?Z>> |}
} WHERE {
   << :a :b :c >> ?P :o1 {| ?Y <<:s1 :p1 ?Z>> |}
}

MUST result into

SPARQL-star - update with quoted object 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-5.ru
PREFIX : <http://example.com/ns#>

INSERT {
    ?S ?P << :a :b ?O >> {| ?Y ?Z |}
} WHERE {
   ?S ?P << :a :b ?O >> {| ?Y ?Z |}
}
MUST result into

SPARQL-star - update with annotation template 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-6.ru
PREFIX : <http://example.com/ns#>

INSERT {
    ?s :r ?o {| :added 'Property :r' |}
} WHERE {
   ?s :p/:q ?o .
}
MUST result into

SPARQL-star - update with annotation, template and pattern 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-7.ru
PREFIX : <http://example.com/ns#>

DELETE {
    ?s :r ?o {| :added 'Property :r' |}
} WHERE {
   ?s :p ?o {| :q1+ 'ABC' |}
}
MUST result into

SPARQL-star - update DATA with annotation 🔗

status:proposed
type:PositiveUpdateSyntaxTest11
sparql-star-syntax-update-8.ru
PREFIX : <http://example.com/ns#>

DELETE DATA  {
    :s :p :o1  {| :added 'Test' |}
}
;
INSERT DATA  {
    :s :p :o2  {| :added 'Test' |}
}


MUST result into

SPARQL-star - update - bad syntax 🔗

status:proposed
type:NegativeUpdateSyntaxTest11
sparql-star-syntax-bad-update-1.ru
PREFIX : <http://example.com/ns#>

INSERT DATA {
    << :a :b :c >> .
}
MUST NOT result into

SPARQL-star - update - bad syntax 🔗

status:proposed
type:NegativeUpdateSyntaxTest11
sparql-star-syntax-bad-update-2.ru
PREFIX : <http://example.com/ns#>

INSERT DATA {
    << :g :a :b :c >> :p :o .
}
MUST NOT result into

SPARQL-star - update - bad syntax 🔗

status:proposed
type:NegativeUpdateSyntaxTest11
sparql-star-syntax-bad-update-3.ru
PREFIX : <http://example.com/ns#>

INSERT DATA {
    :s :p :o {| :p/:q :z |}
}
MUST NOT result into

SPARQL-star - update - bad syntax 🔗

status:proposed
type:NegativeUpdateSyntaxTest11
sparql-star-syntax-bad-update-4.ru
PREFIX : <http://example.com/ns#>

INSERT DATA {
    {| :p :z |}
}
MUST NOT result into