How to do DL reasoning from Java

1 view
Skip to first unread message

john....@gmail.com

unread,
Aug 22, 2013, 11:42:49 AM8/22/13
to sta...@clarkparsia.com
Hi all,

(I have just started looking at Stardog, so please excuse me if the answer to this questin is available somewhere I didn't look :-)

From the documentation it seems that DL reasoning can only be achieved on the TBox part of of an ontology, and all ABox parts needs to be specified in a seperate graph. The ABox part (graph) can be then be queried using EL or RL reasoning.

(see: com.clarkparsia.stardog.StardogException: The reasoning type was set to "DL", but the query contains ABox or Hybrid BGPs. See the docs for a discussion of data, schema, and hybrid SPARQL queries. )

The Java examples given only show EL/RL reasoning (where the TBox and ABox axioms can be mixed in one graph)

Using the Java API how to I create a seperate "Schema" graph?
Using the Java API how can I perform DL reasoning?
I would be particularly interested in seeing how this could be done with the Jena API. 

Thanks,
John


Mike Grove

unread,
Aug 22, 2013, 11:55:49 AM8/22/13
to stardog
On Thu, Aug 22, 2013 at 11:42 AM, <john....@gmail.com> wrote:
Hi all,

(I have just started looking at Stardog, so please excuse me if the answer to this questin is available somewhere I didn't look :-)

Most of what you need is in our docs [1], but if there are parts you found to be incomplete or confusing, we do keep them on github [5], so we're happy to accept issues and pull requests for them =)


From the documentation it seems that DL reasoning can only be achieved on the TBox part of of an ontology, and all ABox parts needs to be specified in a seperate graph. The ABox part (graph) can be then be queried using EL or RL reasoning.

DL reasoning can only be performed over the TBox whereas EL, RL & QL will work over the entire database.  Your ABox does not need to be in a separate graph, nor does your TBox.  By default, Stardog will scan the contents of the database and extract the TBox for you.  If you wish to keep your TBox separate from your ABox to make your workflow easier, you can tell Stardog which named graph you're storing it in, and that will speed up extraction because then Stardog doesnt have to scan the entire database.  There's information about the configuration options for specifying this in our docs [1]
 

(see: com.clarkparsia.stardog.StardogException: The reasoning type was set to "DL", but the query contains ABox or Hybrid BGPs. See the docs for a discussion of data, schema, and hybrid SPARQL queries. )

Yes, you'll get this exception if you've specified DL reasoning and include query atoms which require ABox data.
 

The Java examples given only show EL/RL reasoning (where the TBox and ABox axioms can be mixed in one graph)

Again, they can be mixed, Stardog will extract and manage the TBox for you automatically.  I suspect some of your confusion is related to what query atoms we consider to be ABox atoms, this is explained in the reasoning guidelines [2] in the "Terminology" section.

The example we provide to show how to use Stardog's reasoning capabilities does not require modifications for DL reasoning, the queries just need to be restricted to the TBox.
 

Using the Java API how to I create a seperate "Schema" graph?

As I mentioned, you needn't create a separate graph for your TBox.  But if you are interested in doing this programmatically, you can refer to the docs about administering a database [3] and our Java API [4], particularly DatabaseBuilder which is what you'll use to configure & create a database
 
Using the Java API how can I perform DL reasoning?

Same way you perform any other type of reasoning, as illustrated in the examples.
 
I would be particularly interested in seeing how this could be done with the Jena API. 

You only need create an appropriate ConnectionConfiguration, then use the Jena bindings to create a Model or Dataset backed by Connection's created from that configuration, and then you can use Jena normally.  The Jena example in the distribution shows how to use our Jena bindings.

Cheers,

Mike
 

 

Thanks,
John


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Reply all
Reply to author
Forward
0 new messages