Skip to content

sparql construct: unbound variables in blank node notation #3866

@justin2004

Description

@justin2004

Version

6.0.0

Question

If any such instantiation produces a triple containing an unbound variable or an illegal RDF construct, such as a literal in subject or predicate position, then that triple is not included in the output RDF graph.

https://www.w3.org/TR/sparql11-query/#construct

Executing this:

prefix u: <uri:>
construct {
  u:thingA u:a [ u:time ?then ] .
  u:thingB u:time ?then .
  [ u:timeB ?then ]
}
where {
  bind(now() as ?now)
}

With an empty a.ttl...

$ /path/apache-jena-6.0.0/bin/sparql --data=a.ttl --query=./a.rq
PREFIX u: <uri:>

u:thingA  u:a   []  .

Based on reading the SPARQL 1.1 doc I don't expect any triples to be produced.
Applying the rule from the inside out...

  • ?then is not bound
    • therefore don't produce [ u:time ?then ]
      • if [ u:time ?then ] isn't produced
        • then u:thingA u:a [ u:time ?then ] shouldn't be produced

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions