Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property path patterns in SPARQL* #7

Closed
hartig opened this issue Oct 13, 2020 · 5 comments
Closed

Property path patterns in SPARQL* #7

hartig opened this issue Oct 13, 2020 · 5 comments
Labels
sparql-star About SPARQL-star

Comments

@hartig
Copy link
Collaborator

hartig commented Oct 13, 2020

I have added the definition of a SPARQL* property path pattern into the draft just for the sake of having such a definition. We need to think about whether it is useful to add this to SPARQL*, in which case we need to define the semantics of such SPARQL* property path patterns.

In fact, no matter what we decide, even for standard property path patterns, the semantics may have to be extended to use them over RDF* graphs.

@hartig
Copy link
Collaborator Author

hartig commented Dec 11, 2020

I have looked through this in detail now and I would say that we actually do not need to do anything here---at least, if we make two assumptions (which we may make explicit in the spec):

  1. We assume SA mode.
  2. We assume that every mention of the words "RDF term" and "term" in Sec.18.4 of the SPARQL 1.1 spec is meant to refer to our notion of an RDF* term.

The first assumption is necessary for the following reason.

In SA mode, every embedded triple t that is not also contained directly in the given RDF* graph G (i.e., t ∉ G) is not asserted and, thus, should be ignored during path pattern matching. Ignoring such an embedded triple t happens trivially with the current definitions of property path pattern evaluation in Sec.18.4 of the SPARQL 1.1 spec.

In contrast, an embedded triple t' that is also contained directly in the given RDF* graph G (i.e., t' ∈ G) is asserted and, thus, must not be ignored during path pattern matching. However, due to the fact that t' ∈ G, the triple is considered by the current definitions of property path pattern evaluation, as desired.

The second assumption is necessary to be able to consider nested RDF* triples (i.e., triples that have an embedded triple as their subject or their object) during path pattern matching. Then, a path that matches a property path expression may start from an embedded triple or may end in an embedded triple (or both). It is even possible that intermediate nodes along such a path are embedded triples.

As an example, consider the RDF* graph in the following snippet of Turtle*.

<<:s1 :p1 :o1>>  :q1  <<:s2 :p2 :o2>> .
<<:s2 :p2 :o2>>  :q2  :a .

...and consider the following SPARQL* query.

SELECT ?x ?y WHERE {
   ?x  :q1/:q2*  ?y 
}

The result of this query over the RDF* graph consists of two solution mappings:

  • μ1 = { ?x -> t1, ?y -> t2 } and
  • μ2 = { ?x -> t1, ?y -> :a },

where t1 is the triple (:s1,:p1,:o1) and t2 is the triple (:s2,:p2,:o2).

@afs
Copy link
Collaborator

afs commented Dec 18, 2020

See also #65.

pchampin added a commit that referenced this issue Feb 10, 2021
some of them were also imported from the text of issue #7,
which I also fixed
@pchampin
Copy link
Collaborator

pchampin commented Mar 4, 2021

I think this issue can now be closed. @hartig @afs do you concur?

@afs
Copy link
Collaborator

afs commented Mar 4, 2021

Concur

1 similar comment
@hartig
Copy link
Collaborator Author

hartig commented Mar 4, 2021

Concur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparql-star About SPARQL-star
Projects
None yet
Development

No branches or pull requests

3 participants