On 23/04/14 14:17, ameni ameni wrote:
it is possible to use SQWRL from jena api instead of using SPARQL?
Yes, like I said:
"You can then query for these triples using the API or SPARQL in the
normal way."
As explained there is no specific support for SWRL in jena but if you
plug in a reasoner like Pellet that supports in that the inference
results just "appear" in the model and either the Jena API or SPARQL
should see them.
Dave
2014-04-23 13:40 GMT+02:00 ameni ameni <[email protected]>:
Sorry
2014-04-23 9:28 GMT+02:00 Dave Reynolds <[email protected]>:
On 23/04/14 00:22, ameni ameni wrote:
How can i get accesed to the conclusion of SWRL rules from Jena API ?
Asking the same question multiple different ways, especially when it has
already been answered, is not good practice and doesn't encourage people to
try to help you. Please don't.
To summarize and explain the responses you've had so far:
1. Pellet includes some support for SWRL but is not part of the Jena
project. For all help on how to configure it and debug it you are better
off asking on the pellet support list.
2. From Jena's point of view the reasoner simply makes additional
inferred triples available in the model. You can then query for these
triples using the API or SPARQL in the normal way.
3. Your specific example was of the form:
blah -> adult(?x)
In terms of the RDF model this will, if it fires, create inferred triples
of the form:
x rdf:type ex:Adult
So a query like:
SELECT ?x WHERE { ?x a ex:Adult }
is appropriate.
We can't tell you what ex: is, that's in your data. If you can't figure
it out then you could try to run a query like:
SELECT DISTINCT ?type WHERE { [] a ?type }
over your inferred model and see what ?types are present.
Or if your data is not too big:
SELECT * WHERE { ?x a ?type }
to find the type of everything.
If there is nothing related to Adult in there then perhaps your rule
hasn't fired.
Dave