Discussion:
Is it possible to infer new knowledge about an ontology only from a query in SPARQL?
Manuel Enrique Puebla Martinez
2018-12-05 16:15:33 UTC
Permalink
Hello:

Is it possible to infer new knowledge about an ontology only from a query in SPARQL?

I have a question about the use of the SPARQL language about ontologies. So far I have thought that SPARQL is the equivalent to the SQL language in the relational databases, that is to say, that with SPARQL it is only possible to consult the data that are explicitly in the ontology, without having access to the data that can be inferred , leaving the responsibility of the inference to the reasoners.

However, I have read documents from which I infer that SPARQL does have the capacity to infer implicit and non-explicit knowledge in the ontology. Is my inference true? That is, is it possible to infer knowledge through a SPARQL query without the need for a reasoner? If the answer is true, then what advantages does the use of a reasoner have over the use of SPARQL?



Greetings, Manuel Puebla.
Andy Seaborne
2018-12-05 17:13:49 UTC
Permalink
Hi there,

There are two ways (maybe more!)

1/ Query with SPARQL the inference model.

The Jena reasoners all provide an "inf model" which is the base data and
all the inferred triples.

Not all inference can be done this way (some cases of OWL-DL with
disjunction can't be turned into triples) but Jena reasoners don't
support that level of inference.

2/ Some things can be done in SPARQL:

SELECT * {
?x rdf:type/rdfs:subClassOf* ?Type
}

is all ?x and its types, including up the subClass hierarchy.

SELECT * { ?x ?p ?v . ?p rdfs:subPropertyOf* :property }

is subPropertyOf (and quite inefficient!)

Pre-computing the transitive rdfs:subClassOf* improves performance.

It is hard to write queries that cover multiple inference rules - e.g.
using mixed domain/range and also subClassOf - because they mutually
depend on each other.


3/ And you can create data with assignments:

SELECT ?s ?w { ?s :p ?v . BIND( ?v +1 AS ?w) }

That's more like a simple business rule than ontology.

Andy
Post by Manuel Enrique Puebla Martinez
Is it possible to infer new knowledge about an ontology only from a query in SPARQL?
I have a question about the use of the SPARQL language about ontologies. So far I have thought that SPARQL is the equivalent to the SQL language in the relational databases, that is to say, that with SPARQL it is only possible to consult the data that are explicitly in the ontology, without having access to the data that can be inferred , leaving the responsibility of the inference to the reasoners.
However, I have read documents from which I infer that SPARQL does have the capacity to infer implicit and non-explicit knowledge in the ontology. Is my inference true? That is, is it possible to infer knowledge through a SPARQL query without the need for a reasoner? If the answer is true, then what advantages does the use of a reasoner have over the use of SPARQL?
Greetings, Manuel Puebla.
Dan Davis
2018-12-06 00:39:32 UTC
Permalink
Hi, the ability for RDF frameworks like Jena and triple-stores to do
inference is one of the particular features of RDF and SPARQL over graph
databases like Neo4j.

The inference done by triple stores is first-order logic, rather than
statistical inference, but it is still powerful. It means that you can
discovery surprising things about your data simply using your ontology
(which describes how classes relate to each other).

On Wed, Dec 5, 2018 at 11:16 AM Manuel Enrique Puebla Martinez <
Post by Manuel Enrique Puebla Martinez
Is it possible to infer new knowledge about an ontology only from a query in SPARQL?
I have a question about the use of the SPARQL language about ontologies.
So far I have thought that SPARQL is the equivalent to the SQL language in
the relational databases, that is to say, that with SPARQL it is only
possible to consult the data that are explicitly in the ontology, without
having access to the data that can be inferred , leaving the responsibility
of the inference to the reasoners.
However, I have read documents from which I infer that SPARQL does have
the capacity to infer implicit and non-explicit knowledge in the ontology.
Is my inference true? That is, is it possible to infer knowledge through a
SPARQL query without the need for a reasoner? If the answer is true, then
what advantages does the use of a reasoner have over the use of SPARQL?
Greetings, Manuel Puebla.
Loading...