Different SPARQL query engines give differing results for DESCRIBE Query

eastdog

I tried one SPARQL query in two different engines:

  1. Protege 4.3 - SPARQL query tab
  2. Jena 2.11.0

While the query is the same the results returned by these two tools are different.

I tried a DESCRIBE query like the following:

DESCRIBE ?x
WHERE { ?x :someproperty "somevalue"}

Results from protege give me tuples that take ?x as subject/object; while the ones from jena are that take ?x as subject only.

My questions are:

  1. Is the syntax of SPARQL uniform?
  2. If I want DESCRIBE to work as in protege, what should I do in Jena?
RobV

To answer your first question yes the SPARQL syntax is uniform since you've used the same query in both tools. However what I think you are actually asking is should the results for the two tools be different or not? i.e. are the semantics of SPARQL uniform

In the case of DESCRIBE then yes the results are explicitly allowed to be different by the SPARQL specification i.e. no the semantics of SPARQL are not uniform but this is only in the case of DESCRIBE.

See Section 16.4 DESCRIBE (Informative) of the SPARQL Specification which states the following:

The query pattern is used to create a result set. The DESCRIBE form takes each of the resources identified in a solution, together with any resources directly named by IRI, and assembles a single RDF graph by taking a "description" which can come from any information available including the target RDF Dataset. The description is determined by the query service

The important part of this is the last couple of sentences that say the description is determined by the query service. This means that both Protege's and Jena's answers are correct since they are allowed to choose how they form the description.

Changing Jena DESCRIBE handling

To answer the second part of your question you can change how Jena processes DESCRIBE queries by implementing a custom DescribeHandler and an associated DescribeHandlerFactory. You then need to register your factory like so:

DescribeHandlerRegistry.get().set(new YourDescribeHandlerFactory());

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SPARQL query doesn't give any results

From Dev

The same query on Sparql gives different results

From Dev

The same query on Sparql gives different results

From Dev

Sparql query not showing results

From Dev

Sparql query not showing results

From Dev

Rank results of a sparql query

From Dev

get grouped results with sparql query

From Dev

Aggregating results from SPARQL query

From Dev

Problems showing the results of a sparql query

From Dev

Problems showing the results of a sparql query

From Dev

sparql DESCRIBE query to get data about linked objects

From Dev

Order SPARQL query results by length of a string?

From Dev

Why is this SPARQL query not returning any results?

From Dev

SPARQL - query a property and return results for a related property

From Dev

SPARQL query in DBpedia Sorql return no results

From Dev

Get URI in results of dbpedia SPARQL query

From Dev

SPARQL query in DBpedia Sorql return no results

From Dev

Simple SPARQL query does not return any results

From Dev

List Comprehension, For-Loop give differing results

From Dev

"if" in a SPARQL query

From Dev

"or" in a SPARQL query

From Dev

Elasticsearch term query does not give any results

From Dev

Why does this query give different results depending on how I arrange my DateTime arithmetic?

From Dev

SQLite query gives different results

From Dev

Query Document with different struct for results

From Dev

Write a query that give different class of ip

From Dev

SQLite query give different result from mysql

From Dev

MongoDB different query styles with different results

From Dev

Exclude results from DBpedia SPARQL query based on URI prefix

Related Related

HotTag

Archive