Hello,
As mentioned in another ticket, we are using Stardog 2.2.4 (community edition) in the context o
our bachelor thesis and think we stumbled upon some bug when trying
to reach a conclusion based on SWRL-rules.
Hereinafter a simplified version of the situation.
We defined the dataProperty
requires
with a certain range, which is a list of strings
{"a", "b", "c"}
Furthermore we defined the dataProperties
foos
bars
which are of boolean value, e.g.
{"true", "false"}
Based on these dataProperties, we defined the following rules
Rule: requires(?x, "a") -> foos(?x, "true")
Rule: requires(?x, "b") -> bars(?x, "true")
We then created two individuals (e.g. "x" and "y" within the same class (e.g. "Thing")
and set the dataProperties:
x requires "a"
y requires "b"
If we query the database for those properties, we can see the enriched data, e.g.:
x foos true
y bars true
When we perform a query which invokes _both_ of the properties, e.g.
SELECT
*
WHERE {
?obj :foos true.
?obj :bars true.
}
We get both objects (x and y) as result.
This should, in our humble opinion, not happen, as SPARQL performs a conjunction
on the conditions and there is no object which satisfies the condition to have both
properties set to true.
We then deleted the rules and assigned the properties directly. If we perform
the above query now, no result is returned, which is correct. If we comment one
or the other condition out, we receive the corresponding object.
We
did all the modeling (including the definition of rules and so on)
within Stanford Protégé (5.0.0 build beta-15 resp. build beta-16),
exported the ontology as RDF/XML
and imported it within Stardog. We dropped and re-created the database every time.
The
expected conclusion, as described in the first scenario, is reached
within Protégé, in which we use Pellet for reasoning as well. Therefeore
we assume it has to be an issue within Stardog, and not the reasoning.
I attached our current ontology as OWL-file. The original query (the one using the rules) is:
SELECT
*
WHERE {
?obj :action true.
?obj :wellness true.
}
The query for querying the attributes directly (without using the rules) is:
SELECT
*
WHERE {
?obj :foos true.
?obj :bars true.
}
Any help is kindly appreciated. If you have any questions or if we shall provide further data, we are at disposal at any time.
Yours faithfully,
Sven Osterwalder