2

I would like to know if SPARQL, by default, adopts the open world assumption or if this depends on the triple stores that execute the SPARQL queries.

And what are the implications of this assumption in queries.

Best regards.

Juan
  • 95
  • 2
  • 5

2 Answers2

4

Well....

I wonder whether this is really a good question for this site. I think not, but I'm gonna throw a few cents into the bucket anyway.

To start with -- does it matter whether SPARQL "adopts" (and what does that mean, to you?) OWA, and, if so, why?

Then, to address @AKSW's comment -- W3 differs with @AKSW's assertion, in at least the RDF 1.0 Spec (granted, that has since been revised to RDF 1.1, and the key statement has now been left out; regrettably, "What's new in RDF 1.1" doesn't mention this omission), and a draft of the Government Linked Data WG Glossary (again, later omitted without explanation I could find). Wikipedia and various others concur, that RDF does base itself on OWA.

OWA basically says, if I don't have a statement (or its inverse) explicitly providing its truth or falsity, the answer to "is this statement true?" is neither "yes" nor "no," but "I don't know."

In similarly overly-simplified terms, SPARQL looks in a given Graph for matches to a Basic Graph Pattern. If the match is not found, the answer is not TRUE ... but does this mean that the pattern is therefore FALSE? I suggest, no.

But again -- so what? What's your use case? Are you working with sparse data, or solid data? Far too much of your question is left open; still, it's easy to answer based on a closed world assumption...

TallTed
  • 9,069
  • 2
  • 22
  • 37
  • I didn't know that RDF really follows the OWA, thank's for letting me know. But to be honest, there is no reasoning procedure that would be affected by this, right? I mean, in OWL there are things like `allValuesFrom` or `maxCardinality` which indeed let a reasoner lead to unexpected entailment queries for people that are not aware of the OWA nature of OWL. But I'm not aware of any RDF/RDFS reasoning algorithm that doesn't return FALSE once some data is missing. – UninformedUser Sep 12 '17 at 06:14
  • And I guess you agree with me, that negation in SPARQL works the same way as in databases (maybe it's different under entailment regimes). Anyways, thanks for the correction of my comment. – UninformedUser Sep 12 '17 at 06:14
  • @AKSW - Explicit statements typically win over inference. (Some specific usage scenarios change that.) OWL does indeed include *guidance* such as `range` and `domain` — but these are not *constraints* in RDF in the same way that schema definitions are in SQL — alongside explicit statements that OWL follows OWA. This was a primary driver in recent development of [SHACL](https://www.w3.org/TR/shacl/) and related things -- which let you check whether a given dataset fits your immediate working requirements. – TallTed Sep 12 '17 at 15:17
  • I always had the intuition that `sparql` and `rdfs`, as designed for the semantic web: using OWA in the www means that it is near to impossible to say if a bit of information is complete: "if a formula φ is not entailed by our knowledge base, then we cannot assume its negation as in CWA." This is the strength and the weakness of this representation. I understand that recent products more geared to an enterprise focus are adopting CWA. This also matches with my intuition: due to the far limited scope (i.e. the enterprise), CWA appears to be more useful. Glad to hear other opinions! – Enzo Dec 11 '17 at 14:33
4

SPARQL follows the Closed World Assumption and assumes RDF data to be complete. This does not affect positive queries, but SPARQL queries with negation make only sense under closed world semantics.

Leslie Sikos
  • 529
  • 2
  • 7
  • This doesn't match with my research (nor with @TallTed answer). Can you quote some source? I think it is reasonable to ask you this as your post contradicts the previous one, which has appropriate references. – Enzo Dec 11 '17 at 14:37
  • 2
    Darari, F., Razniewski, S., Nutt, W. (2014) Bridging the semantic gap between RDF and SPARQL using completeness statements. In: Horridge, M., Rospocher, M., van Ossenbruggen, J. (eds.) Proceedings of the ISWC 2014 Posters & Demonstrations Track, pp. 269-272. http://ceur-ws.org/Vol-1272/paper_50.pdf – Leslie Sikos Dec 13 '17 at 01:03