manifest

Generated from manifest.jsonld

Entries:

SPARQL-star - all graph triples (JSON results) 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-results-1.rq
PREFIX :       <http://example/>

SELECT * {
    ?s ?p ?o
}
Data: data-0.ttl
PREFIX : <http://example/>

<<:a :b :c>> :q :z .
:a :q <<:a :b :c>> .

:f :g << <<:x1 :y1 123 >> :p :o >> .

:f :g << :s :p <<:x2 :y3 123 >> >> .

<< :s1 :p1 :o1 >> :q << :s1 :p1 :o1 >> .

:a :b :c {| :q1 :z1 |} .


MUST result into
sparql-star-results-1.srj
{ "head": {
    "vars": [ "s" , "p" , "o" ]
  } ,
  "results": {
    "bindings": [
      { 
        "s": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/a" } ,
            "predicate": { "type": "uri" , "value": "http://example/b" } ,
            "object":   { "type": "uri" , "value": "http://example/c" }
          }
        } ,
        "p": { "type": "uri" , "value": "http://example/q1" } ,
        "o": { "type": "uri" , "value": "http://example/z1" }
      } ,
      { 
        "s": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/a" } ,
            "predicate": { "type": "uri" , "value": "http://example/b" } ,
            "object":   { "type": "uri" , "value": "http://example/c" }
          }
        } ,
        "p": { "type": "uri" , "value": "http://example/q" } ,
        "o": { "type": "uri" , "value": "http://example/z" }
      } ,
      { 
        "s": { "type": "uri" , "value": "http://example/a" } ,
        "p": { "type": "uri" , "value": "http://example/b" } ,
        "o": { "type": "uri" , "value": "http://example/c" }
      } ,
      { 
        "s": { "type": "uri" , "value": "http://example/a" } ,
        "p": { "type": "uri" , "value": "http://example/q" } ,
        "o": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/a" } ,
            "predicate": { "type": "uri" , "value": "http://example/b" } ,
            "object":   { "type": "uri" , "value": "http://example/c" }
          }
        }
      } ,
      { 
        "s": { "type": "uri" , "value": "http://example/f" } ,
        "p": { "type": "uri" , "value": "http://example/g" } ,
        "o": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/s" } ,
            "predicate": { "type": "uri" , "value": "http://example/p" } ,
            "object":   {
              "type": "triple" , 
              "value": {
                "subject":  { "type": "uri" , "value": "http://example/x2" } ,
                "predicate": { "type": "uri" , "value": "http://example/y3" } ,
                "object":   { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "value": "123" }
              }
            }
          }
        }
      } ,
      { 
        "s": { "type": "uri" , "value": "http://example/f" } ,
        "p": { "type": "uri" , "value": "http://example/g" } ,
        "o": {
          "type": "triple" , 
          "value": {
            "subject":  {
              "type": "triple" , 
              "value": {
                "subject":  { "type": "uri" , "value": "http://example/x1" } ,
                "predicate": { "type": "uri" , "value": "http://example/y1" } ,
                "object":   { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "value": "123" }
              }
            } ,
            "predicate": { "type": "uri" , "value": "http://example/p" } ,
            "object":   { "type": "uri" , "value": "http://example/o" }
          }
        }
      } ,
      { 
        "s": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/s1" } ,
            "predicate": { "type": "uri" , "value": "http://example/p1" } ,
            "object":   { "type": "uri" , "value": "http://example/o1" }
          }
        } ,
        "p": { "type": "uri" , "value": "http://example/q" } ,
        "o": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/s1" } ,
            "predicate": { "type": "uri" , "value": "http://example/p1" } ,
            "object":   { "type": "uri" , "value": "http://example/o1" }
          }
        }
      }
    ]
  }
}

SPARQL-star - all graph triples (XML results) 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-results-1.rq
PREFIX :       <http://example/>

SELECT * {
    ?s ?p ?o
}
Data: data-0.ttl
PREFIX : <http://example/>

<<:a :b :c>> :q :z .
:a :q <<:a :b :c>> .

:f :g << <<:x1 :y1 123 >> :p :o >> .

:f :g << :s :p <<:x2 :y3 123 >> >> .

<< :s1 :p1 :o1 >> :q << :s1 :p1 :o1 >> .

:a :b :c {| :q1 :z1 |} .


MUST result into
sparql-star-results-1.srx
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="s"/>
    <variable name="p"/>
    <variable name="o"/>
  </head>
  <results>
    <result>
      <binding name="s">
        <triple>
          <subject>
            <uri>http://example/a</uri>
          </subject>
          <predicate>
            <uri>http://example/b</uri>
          </predicate>
          <object>
            <uri>http://example/c</uri>
          </object>
        </triple>
      </binding>
      <binding name="p">
        <uri>http://example/q1</uri>
      </binding>
      <binding name="o">
        <uri>http://example/z1</uri>
      </binding>
    </result>
    <result>
      <binding name="s">
        <triple>
          <subject>
            <uri>http://example/a</uri>
          </subject>
          <predicate>
            <uri>http://example/b</uri>
          </predicate>
          <object>
            <uri>http://example/c</uri>
          </object>
        </triple>
      </binding>
      <binding name="p">
        <uri>http://example/q</uri>
      </binding>
      <binding name="o">
        <uri>http://example/z</uri>
      </binding>
    </result>
    <result>
      <binding name="s">
        <uri>http://example/a</uri>
      </binding>
      <binding name="p">
        <uri>http://example/b</uri>
      </binding>
      <binding name="o">
        <uri>http://example/c</uri>
      </binding>
    </result>
    <result>
      <binding name="s">
        <uri>http://example/a</uri>
      </binding>
      <binding name="p">
        <uri>http://example/q</uri>
      </binding>
      <binding name="o">
        <triple>
          <subject>
            <uri>http://example/a</uri>
          </subject>
          <predicate>
            <uri>http://example/b</uri>
          </predicate>
          <object>
            <uri>http://example/c</uri>
          </object>
        </triple>
      </binding>
    </result>
    <result>
      <binding name="s">
        <uri>http://example/f</uri>
      </binding>
      <binding name="p">
        <uri>http://example/g</uri>
      </binding>
      <binding name="o">
        <triple>
          <subject>
            <uri>http://example/s</uri>
          </subject>
          <predicate>
            <uri>http://example/p</uri>
          </predicate>
          <object>
            <triple>
              <subject>
                <uri>http://example/x2</uri>
              </subject>
              <predicate>
                <uri>http://example/y3</uri>
              </predicate>
              <object>
                <literal datatype="http://www.w3.org/2001/XMLSchema#integer">123</literal>
              </object>
            </triple>
          </object>
        </triple>
      </binding>
    </result>
    <result>
      <binding name="s">
        <uri>http://example/f</uri>
      </binding>
      <binding name="p">
        <uri>http://example/g</uri>
      </binding>
      <binding name="o">
        <triple>
          <subject>
            <triple>
              <subject>
                <uri>http://example/x1</uri>
              </subject>
              <predicate>
                <uri>http://example/y1</uri>
              </predicate>
              <object>
                <literal datatype="http://www.w3.org/2001/XMLSchema#integer">123</literal>
              </object>
            </triple>
          </subject>
          <predicate>
            <uri>http://example/p</uri>
          </predicate>
          <object>
            <uri>http://example/o</uri>
          </object>
        </triple>
      </binding>
    </result>
    <result>
      <binding name="s">
        <triple>
          <subject>
            <uri>http://example/s1</uri>
          </subject>
          <predicate>
            <uri>http://example/p1</uri>
          </predicate>
          <object>
            <uri>http://example/o1</uri>
          </object>
        </triple>
      </binding>
      <binding name="p">
        <uri>http://example/q</uri>
      </binding>
      <binding name="o">
        <triple>
          <subject>
            <uri>http://example/s1</uri>
          </subject>
          <predicate>
            <uri>http://example/p1</uri>
          </predicate>
          <object>
            <uri>http://example/o1</uri>
          </object>
        </triple>
      </binding>
    </result>
  </results>
</sparql>

SPARQL-star - match constant embedded triple 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-basic-2.rq
PREFIX :       <http://example/>

SELECT * {
    <<:a :b :c>> ?p ?o
}
Data: data-1.ttl
PREFIX : <http://example/>

<<:a :b :c>> :q :z .
MUST result into
sparql-star-basic-2.srj
{ "head": {
    "vars": [ "p" , "o" ]
  } ,
  "results": {
    "bindings": [
      { 
        "p": { "type": "uri" , "value": "http://example/q" } ,
        "o": { "type": "uri" , "value": "http://example/z" }
      }
    ]
  }
}

SPARQL-star - match embedded triple, var subject 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-basic-3.rq
PREFIX :       <http://example/>

SELECT * {
    <<?s :b :c>> ?p ?o
}
Data: data-1.ttl
PREFIX : <http://example/>

<<:a :b :c>> :q :z .
MUST result into
sparql-star-basic-3.srj
{ "head": {
    "vars": [ "s" , "p" , "o" ]
  } ,
  "results": {
    "bindings": [
      { 
        "s": { "type": "uri" , "value": "http://example/a" } ,
        "p": { "type": "uri" , "value": "http://example/q" } ,
        "o": { "type": "uri" , "value": "http://example/z" }
      }
    ]
  }
}

SPARQL-star - match embedded triple, var predicate 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-basic-4.rq
PREFIX :       <http://example/>

SELECT * {
    <<:a ?p :c>> ?q :z .
}
Data: data-1.ttl
PREFIX : <http://example/>

<<:a :b :c>> :q :z .
MUST result into
sparql-star-basic-4.srj
{ "head": {
    "vars": [ "p" , "q" ]
  } ,
  "results": {
    "bindings": [
      { 
        "p": { "type": "uri" , "value": "http://example/b" } ,
        "q": { "type": "uri" , "value": "http://example/q" }
      }
    ]
  }
}

SPARQL-star - match embedded triple, var object 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-basic-5.rq
PREFIX :       <http://example/>

SELECT * {
    <<:a :b ?o>> ?q :z .
}
Data: data-1.ttl
PREFIX : <http://example/>

<<:a :b :c>> :q :z .
MUST result into
sparql-star-basic-5.srj
{ "head": {
    "vars": [ "o" , "q" ]
  } ,
  "results": {
    "bindings": [
      { 
        "o": { "type": "uri" , "value": "http://example/c" } ,
        "q": { "type": "uri" , "value": "http://example/q" }
      }
    ]
  }
}

SPARQL-star - no match of embedded triple 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-basic-6.rq
PREFIX :       <http://example/>

SELECT * {
    <<?a ?b :nomatch >> ?q :z .
}
Data: data-1.ttl
PREFIX : <http://example/>

<<:a :b :c>> :q :z .
MUST result into
sparql-star-basic-6.srj
{ "head": {
    "vars": [ "a" , "b" , "q" ]
  } ,
  "results": {
    "bindings": [
      
    ]
  }
}

SPARQL-star - Asserted and embedded triple 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-01.rq
PREFIX :       <http://example/>

SELECT * {
 :s :p1 ?o .
 <<:s :p1 ?o>> ?q ?z .
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-01.srj
{ "head": {
    "vars": [ "o" , "q" , "z" ]
  } ,
  "results": {
    "bindings": [
      { 
        "o": { "type": "uri" , "value": "http://example/o" } ,
        "q": { "type": "uri" , "value": "http://example/b" } ,
        "z": { "type": "uri" , "value": "http://example/a2" }
      } ,
      { 
        "o": { "type": "uri" , "value": "http://example/o" } ,
        "q": { "type": "uri" , "value": "http://example/q" } ,
        "z": { "type": "uri" , "value": "http://example/z" }
      }
    ]
  }
}

SPARQL-star - Asserted and embedded triple 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-02.rq
PREFIX :       <http://example/>

SELECT * {
  <<:s :p1 ?o>> ?q ?z .
  :s :p1 ?o .
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-02.srj
{ "head": {
    "vars": [ "o" , "q" , "z" ]
  } ,
  "results": {
    "bindings": [
      { 
        "o": { "type": "uri" , "value": "http://example/o" } ,
        "q": { "type": "uri" , "value": "http://example/b" } ,
        "z": { "type": "uri" , "value": "http://example/a2" }
      } ,
      { 
        "o": { "type": "uri" , "value": "http://example/o" } ,
        "q": { "type": "uri" , "value": "http://example/q" } ,
        "z": { "type": "uri" , "value": "http://example/z" }
      }
    ]
  }
}

SPARQL-star - Pattern - Variable for embedded triple 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-03.rq
PREFIX :       <http://example/>

## Connected via triple term
SELECT * {
 ?s :b ?o .
 ?o :b ?z .
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-03.srj
{ "head": {
    "vars": [ "s" , "o" , "z" ]
  } ,
  "results": {
    "bindings": [
      { 
        "s": { "type": "uri" , "value": "http://example/a1" } ,
        "o": {
          "type": "triple" , 
          "value": {
            "subject":   { "type": "uri" , "value": "http://example/s" } ,
            "predicate": { "type": "uri" , "value": "http://example/p1" } ,
            "object":    { "type": "uri" , "value": "http://example/o" }
          }
        } ,
        "z": { "type": "uri" , "value": "http://example/a2" }
      }
    ]
  }
}

SPARQL-star - Pattern - No match 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-04.rq
PREFIX :       <http://example/>

## No match
SELECT * {
   ?s ?p << :s :p1 :zz >> .
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-04.srj
{ "head": {
    "vars": [ "s" , "p" ]
  } ,
  "results": {
    "bindings": [
      
    ]
  }
}

SPARQL-star - Pattern - match variables in triple terms 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-05.rq
PREFIX :       <http://example/>

# Matching Variables
SELECT * {
   <<?s ?p ?o>> ?Q <<?s ?p ?o>>
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-05.srj
{ "head": {
    "vars": [ "s" , "p" , "o" , "Q" ]
  } ,
  "results": {
    "bindings": [
      { 
        "s": { "type": "uri" , "value": "http://example/s" } ,
        "p": { "type": "uri" , "value": "http://example/p2" } ,
        "o": { "type": "uri" , "value": "http://example/o" } ,
        "Q": { "type": "uri" , "value": "http://example/sym" }
      }
    ]
  }
}

SPARQL-star - Pattern - Nesting 1 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-06.rq
PREFIX :       <http://example/>

# Nesting
SELECT * {
  << <<:s :p2 :o>> :p3 :z>> :q  ?q .
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-06.srj
{ "head": {
    "vars": [ "q" ]
  } ,
  "results": {
    "bindings": [
      { 
        "q": { "type": "uri" , "value": "http://example/o" }
      }
    ]
  }
}

SPARQL-star - Pattern - Nesting - 2 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-07.rq
PREFIX :       <http://example/>

# Nesting
SELECT * {
  << <<?s :p2 :o>> :p3 ?x>> :q ?q 
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-07.srj
{ "head": {
    "vars": [ "s" , "x" , "q" ]
  } ,
  "results": {
    "bindings": [
      { 
        "s": { "type": "uri" , "value": "http://example/s" } ,
        "x": { "type": "uri" , "value": "http://example/z" } ,
        "q": { "type": "uri" , "value": "http://example/o" }
      }
    ]
  }
}

SPARQL-star - Pattern - Match and nesting 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-08.rq
PREFIX :       <http://example/>

# Nesting via match
SELECT * {
  ?t :p3 :z .
  << ?t  :p3 :z >> :q :o . 
}
Data: data-2.ttl
PREFIX :       <http://example/>

:s :p1 :o .
<<:s :p1 :o>> :q :z .

# pattern-3
:a1 :b <<:s :p1 :o>>  .
<<:s :p1 :o>> :b :a2 .

# pattern-5
:s :p2 :o .
<<:s :p2 :o>> :sym <<:s :p2 :o>> .

# pattern-6
<<:s :p2 :o>> :p3 :z .
<< <<:s :p2 :o>> :p3 :z >> :q :o .
MUST result into
sparql-star-pattern-08.srj
{ "head": {
    "vars": [ "t" ]
  } ,
  "results": {
    "bindings": [
      { 
        "t": {
          "type": "triple" , 
          "value": {
            "subject":   { "type": "uri" , "value": "http://example/s" } ,
            "predicate": { "type": "uri" , "value": "http://example/p2" } ,
            "object":    { "type": "uri" , "value": "http://example/o" }
          }
        }
      }
    ]
  }
}

SPARQL-star - Pattern - Same variable 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-pattern-09.rq
PREFIX :       <http://example/>

SELECT * {
    { <<?s ?p :o>> ?p ?z }
    UNION
    { ?z ?p  <<?s ?p :o>> }
}
Data: data-5.ttl
PREFIX :       <http://example/>

<<:s1 :p :o>> :q :z .
<<:s2 :p :o>> :p "same-p" .
<<:s3 :p :o>> : "same-p" .


:z1 :q << :s1 :p :o >> .
:z2 :p << :s2 :p :o >> .

MUST result into
sparql-star-pattern-09.srj
{ "head": {
    "vars": [ "s" , "p" , "z" ]
  } ,
  "results": {
    "bindings": [
      { 
        "s": { "type": "uri" , "value": "http://example/s2" } ,
        "p": { "type": "uri" , "value": "http://example/p" } ,
        "z": { "type": "literal" , "value": "same-p" }
      } ,
      { 
        "s": { "type": "uri" , "value": "http://example/s2" } ,
        "p": { "type": "uri" , "value": "http://example/p" } ,
        "z": { "type": "uri" , "value": "http://example/z2" }
      }
    ]
  }
}

SPARQL-star - CONSTRUCT with constant template 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-construct-1.rq
PREFIX :       <http://example/>

CONSTRUCT {
  <<:a :b :c >> :q :z .
} WHERE { }
Data: data-3.ttl
PREFIX : <http://example/>

:a :b :c {| :q :z |} .
:s :p :o .
MUST result into
sparql-star-construct-1.ttl
PREFIX :      <http://example/>

<< :a :b :c >>  :q  :z .

SPARQL-star - CONSTRUCT WHERE with constant template 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-construct-2.rq
PREFIX :       <http://example/>

CONSTRUCT WHERE {
  <<:a :b :c >> :q :z .
}
Data: data-3.ttl
PREFIX : <http://example/>

:a :b :c {| :q :z |} .
:s :p :o .
MUST result into
sparql-star-construct-2.ttl
PREFIX :      <http://example/>

<< :a :b :c >>  :q  :z .

SPARQL-star - CONSTRUCT - about every triple 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-construct-3.rq
PREFIX :       <http://example/>

CONSTRUCT {
   << ?s ?p ?o >> :source :ABC .
} WHERE {
   ?s ?p ?o .
}
Data: data-3.ttl
PREFIX : <http://example/>

:a :b :c {| :q :z |} .
:s :p :o .
MUST result into
sparql-star-construct-3.ttl
PREFIX :      <http://example/>

<< << :a :b :c >> :q :z >>
        :source  :ABC .

<< :a :b :c >>  :source  :ABC .

<< :s :p :o >>  :source  :ABC .

SPARQL-star - CONSTRUCT with annotation syntax 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-construct-4.rq
PREFIX :       <http://example/>

CONSTRUCT {
   :a :b ?c {| :source :ABC |} .
} WHERE {
   :a :b ?c .
}
Data: data-3.ttl
PREFIX : <http://example/>

:a :b :c {| :q :z |} .
:s :p :o .
MUST result into
sparql-star-construct-4.ttl
PREFIX :      <http://example/>

:a      :b      :c .

<< :a :b :c >>  :source  :ABC .

SPARQL-star - CONSTRUCT WHERE with annotation syntax 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-construct-5.rq
PREFIX :       <http://example/>

CONSTRUCT WHERE {
   :a :b ?c {| ?q ?z |} .
}
Data: data-3.ttl
PREFIX : <http://example/>

:a :b :c {| :q :z |} .
:s :p :o .
MUST result into
sparql-star-construct-5.ttl
PREFIX :      <http://example/>

:a      :b      :c .

<< :a :b :c >>  :q  :z .

SPARQL-star - GRAPH 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-graphs-1.rq
PREFIX :       <http://example/>

SELECT * {
   :s :p ?o .
   GRAPH ?g { <<:s :p ?o>> ?q ?z }
}
Data: data-4.trig
PREFIX : <http://example/>

:s :p :o1 .

GRAPH :g {
     <<:s :p :o1 >> :q1 :z1 .
     <<:s :p :o2 >> :q2 :z2 .
}

GRAPH :g1 { _:b :r :o3 . _:b :r :o4 . }

GRAPH :g2 { << _:b :r :o3 >> :pb "abc" . }

MUST result into
sparql-star-graphs-1.srj
{ "head": {
    "vars": [ "o" , "q" , "z" , "g" ]
  } ,
  "results": {
    "bindings": [
      { 
        "o": { "type": "uri" , "value": "http://example/o1" } ,
        "q": { "type": "uri" , "value": "http://example/q1" } ,
        "z": { "type": "uri" , "value": "http://example/z1" } ,
        "g": { "type": "uri" , "value": "http://example/g" }
      }
    ]
  }
}

SPARQL-star - GRAPHs with blank node 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-graphs-2.rq
PREFIX :       <http://example/>

SELECT * {
   GRAPH ?g1 { ?s ?p ?o }
   GRAPH ?g2 { << ?s ?p ?o >> ?q ?z }
}
Data: data-4.trig
PREFIX : <http://example/>

:s :p :o1 .

GRAPH :g {
     <<:s :p :o1 >> :q1 :z1 .
     <<:s :p :o2 >> :q2 :z2 .
}

GRAPH :g1 { _:b :r :o3 . _:b :r :o4 . }

GRAPH :g2 { << _:b :r :o3 >> :pb "abc" . }

MUST result into
sparql-star-graphs-2.srj
{ "head": {
    "vars": [ "s" , "p" , "o" , "g1" , "q" , "z" , "g2" ]
  } ,
  "results": {
    "bindings": [
      { 
        "s": { "type": "bnode" , "value": "b0" } ,
        "p": { "type": "uri" , "value": "http://example/r" } ,
        "o": { "type": "uri" , "value": "http://example/o3" } ,
        "g1": { "type": "uri" , "value": "http://example/g1" } ,
        "q": { "type": "uri" , "value": "http://example/pb" } ,
        "z": { "type": "literal" , "value": "abc" } ,
        "g2": { "type": "uri" , "value": "http://example/g2" }
      }
    ]
  }
}

SPARQL-star - Embedded triple - BIND - CONSTRUCT 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-expr-01.rq
PREFIX : <http://example/>

CONSTRUCT {
  ?t :graph ?g .
} WHERE {
  GRAPH ?g {
    ?s ?p ?o .
    BIND(<<?s ?p  ?o>> AS ?t)
  }
}
Data: data-4.trig
PREFIX : <http://example/>

:s :p :o1 .

GRAPH :g {
     <<:s :p :o1 >> :q1 :z1 .
     <<:s :p :o2 >> :q2 :z2 .
}

GRAPH :g1 { _:b :r :o3 . _:b :r :o4 . }

GRAPH :g2 { << _:b :r :o3 >> :pb "abc" . }

MUST result into
sparql-star-expr-01.ttl
PREFIX :      <http://example/>

<< << :s :p :o2 >> :q2 :z2 >>
        :graph  :g .

<< _:b0 :r :o4 >>  :graph  :g1 .

<< _:b0 :r :o3 >>  :graph  :g1 .

<< << :s :p :o1 >> :q1 :z1 >>
        :graph  :g .

<< << _:b0 :r :o3 >> :pb "abc" >>
        :graph  :g2 .

SPARQL-star - Embedded triple - Functions 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-expr-02.rq
PREFIX :       <http://example/>

SELECT * {
  VALUES ?t {
         <<:s :p :o >>
         :x
          <<:s :p :o1 >>
          }
  FILTER(isTriple(?t))
  FILTER(SUBJECT(?t) = :s)
  FILTER(PREDICATE(?t) = :p)
  FILTER(OBJECT(?t) = :o)
}
Data: empty.nq

MUST result into
sparql-star-expr-02.srj
{ "head": {
    "vars": [ "t" ]
  } ,
  "results": {
    "bindings": [
      { 
        "t": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/s" } ,
            "predicate": { "type": "uri" , "value": "http://example/p" } ,
            "object":   { "type": "uri" , "value": "http://example/o" }
          }
        }
      }
    ]
  }
}

SPARQL-star - Embedded triple ORDER BY 🔗

status:proposed
type:QueryEvaluationTest
Query: sparql-star-order-1.rq
PREFIX : <http://example/>

SELECT * {
   :item :p ?v .
} ORDER BY ?v
Data: data-7.ttl
PREFIX : <http://example/>

# The different kinds of orderable items.
# (Not in collation order).

:item :p :x .

:item :p << :s :p :o >> .

:item :p "abc" .

:item :p _:b .

##     (Lowest) no value assigned to the variable or expression in this solution.
##     Blank nodes
##     IRIs
##     RDF literals
##     RDF-star embedded triple terms
MUST result into
sparql-star-order-1.srj
{ "head": {
    "vars": [ "v" ]
  } ,
  "results": {
    "bindings": [
      { 
        "v": { "type": "bnode" , "value": "b0" }
      } ,
      { 
        "v": { "type": "uri" , "value": "http://example/x" }
      } ,
      { 
        "v": { "type": "literal" , "value": "abc" }
      } ,
      { 
        "v": {
          "type": "triple" , 
          "value": {
            "subject":  { "type": "uri" , "value": "http://example/s" } ,
            "predicate": { "type": "uri" , "value": "http://example/p" } ,
            "object":   { "type": "uri" , "value": "http://example/o" }
          }
        }
      }
    ]
  }
}

SPARQL-star - Update 🔗

status:proposed
type:UpdateEvaluationTest
Request: sparql-star-update-1.ru
PREFIX :       <http://example/>

INSERT {
  << ?s ?p ?o >> :source ?g
} WHERE {
  GRAPH ?g { ?s ?p ?o }
}
Data: data-6.trig
PREFIX :       <http://example/>

GRAPH :g1 { :s1 :p1 :o1 }
GRAPH :g2 { :s2 :p2 :o2 }
MUST result into
update-result-1.trig
PREFIX :       <http://example/>

GRAPH :g1 { :s1 :p1 :o1 }
GRAPH :g2 { :s2 :p2 :o2 }

<< :s2 :p2 :o2 >> :source :g2 .
<< :s1 :p1 :o1 >> :source :g1 .

SPARQL-star - Update - annotation 🔗

status:proposed
type:UpdateEvaluationTest
Request: sparql-star-update-2.ru
PREFIX :       <http://example/>

DELETE { GRAPH ?g { ?s ?p ?o } }
INSERT { ?s ?p ?o {| :source ?g |} }
WHERE {
  GRAPH ?g { ?s ?p ?o }
}
Data: data-6.trig
PREFIX :       <http://example/>

GRAPH :g1 { :s1 :p1 :o1 }
GRAPH :g2 { :s2 :p2 :o2 }
MUST result into
update-result-2.trig
PREFIX : <http://example/>

:s1 :p1 :o1 .
:s2 :p2 :o2 .
<< :s1 :p1 :o1 >> :source :g1 .
<< :s2 :p2 :o2 >> :source :g2.

SPARQL-star - Update - data 🔗

status:proposed
type:UpdateEvaluationTest
Request: sparql-star-update-3.ru
PREFIX :       <http://example/>

INSERT DATA {
   :s :p :o {| :source :faraway |}
}
;
DELETE DATA { :s :p :o }
Data: empty.nq

MUST result into
update-result-3.trig
<< <http://example/s> <http://example/p> <http://example/o> >>
        <http://example/source>  <http://example/faraway> .