Hi,
On 12/02/16 17:02, Valerio Belcastro wrote:
Thank you Dave,
So, just another question: If I have to query a remote Jena dataset which
has been created by someone else, is there a way (e.g. graph naming
conventions) to know if base statements and inferred statements are stored
separately?
Not that I'm aware of. That's true whether the endpoint is Jena or
anything else. SPARQL provides the notion of datasets which allows you
to pick which graphs you access but doesn't have any notion of selective
query with inference and leaves it completely open to the data provider
what those graphs mean (including whether the default graph has any
relation to the named graphs).
Sparql service descriptions do allow an endpoint to declare what
entailments it provides. However, if an endpoint does provide inference
then as far as I know the standards don't include a notion of asking it
to not give out those entailments for some particular query.
Dave
[1] https://www.w3.org/TR/sparql11-service-description/#sd-EntailmentRegime
2016-02-12 14:47 GMT+01:00 Dave Reynolds <[email protected]>:
Hi,
On 12/02/16 13:27, Valerio Belcastro wrote:
Hi guys,
I'm using Jena(v3.0.1) to build a sematic web application.
Suppose I need to query a Dataset
<
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/Dataset.html
(which
can be stored in memory, on disk, or on a remote server). This dataset can
contain models with inferred statements. I know that it is possible to
retrieve statements from that dataset using QueryExecution
<
https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/QueryExecution.html
class,
but it also includes inferred statements.
My question is: is there a way to exclude inferred statements when
querying
a Jena Dataset?
Depends on how you got those inferred statements in there.
In Jena inference only takes place over models not entire datasets. An
InfModel is a wrapper around some base model, which makes the inferences
"appear". So if you want to query without seeing inferences then you just
query the base model instead of the InfModel.
In moving to datasets then it is up to the application how it creates
those.
What people sometimes do is create a Dataset where some graphs contain
base statements and others contain inferences that they have materialized.
In that case you simply choose which graph you query.
Other times people just store the data along with all the materialized
inferences in a single graph. In that case you no longer know which are
which.
Dave