0

When I use a (complex) SPARQL query to infer something (e.g., a is in some relation to b that is only given through the query), is the execution of the query / retrieving the information considered to be a form of reasoning?

So only through the expert knowledge that let me define the query, I am able to get a relation between two things: a and b which are connected via a lot of relationships. Also, my SPARQL query uses OR operators and AND operators. The knowledge is already modelled in the knowledge graph/ontology/knowledge base. But it is not known that it is in the relationship I retrieve through my SPARQL query. So I think it needs to be some form of reasoning.

Are there any sources about this and how this is called in the literature?

user3352632
  • 617
  • 6
  • 18
  • inference is getting implicit knowledge out of explicit knowledge - if your query does that, then you can consider it as some kind of inference. Some people also tend to implemend inference rules in form of SPARQL `CONSTRUCT` queries to generate new triples out of the existing ones – UninformedUser Feb 21 '23 at 07:30
  • @UninformedUser but why it is not reasoning? What differentiates reasoning from that? – user3352632 Mar 05 '23 at 16:34
  • I never said that this is not reasoning - for me both expressions are more or less the same, call it "reasoning" or "inferencing" or "computing inferences" or whatever - it doesn't matter. – UninformedUser Mar 07 '23 at 10:10

1 Answers1

0

Great question. It's going to depend on the graph database. Some do, and others don't. It's important to recognize that there are two main strategies for reasoning.

  1. Forward chaining
  2. Backward chaining

When a company creates a graph database with SPARQL support-they need to choose which strategy to use.

Take for example, Stardog. From their description of how their platform handles reasoning...

Stardog performs reasoning in a lazy and late-binding fashion: it does not materialize inferences; but, rather, reasoning is performed at query time according to a user-specified “reasoning type”

In this case, Stardog performs reasoning at query time. So in the context of your answer-yes. Reasoning is done through SPARQL.

Take the case of GraphDB however, and you'll see that

GraphDB’s reasoning strategy is one of Total materialization, where the inference rules are applied repeatedly to the asserted (explicit) statements until no further inferred (implicit) statements are produced.

GraphDB performs reasoning when you upload your data to the graph. It creates the triples right then and there (materialization). When you perform your SPARQL query-traditional reasoning doesn't need to take place because the triples have already been materialized.

There are tradeoffs between forward and backward chaining. For example, your resource footprint will on average be larger with forward chaining (you have to store more triples)-but your query time may be faster (because there's no reasoning to do).

Thomas
  • 720
  • 9
  • 22