[stardog 2.2] Reasoning problem from Java : Example with InverseProperty

2 views
Skip to first unread message

Florian Orpeliere

unread,
Jul 28, 2014, 11:49:26 AM7/28/14
to sta...@clarkparsia.com
Hi all,

We detected a problem when using a model with inverse properties (owl:inverseOf) from Java.
We have the following model : 

#    Object Properties

test:function rdf:type owl:ObjectProperty ;
          
          owl:inverseOf test:inverseFunction .

test:inverseFunction rdf:type owl:ObjectProperty .

#    Individuals

test:x rdf:type owl:NamedIndividual .

test:y rdf:type owl:NamedIndividual ;
   
   test:function test:x .

When quering from Web Interface and CLI, we have what we expect : (Reasoning QL, RL, SL)

Query: select ?a ?b where {?a test:inverseFunction ?b.}

a=test:x
b=test:y

But, in our java project, when we use the same query, the result is empty.

Connection reasConn = ConnectionConfiguration.to("TestForJava")

.server("http://192.168.2.47:5820")

.credentials("admin", "admin")

.connect();


reasConn.begin();

String request = "Select * WHERE { ?x test:inverseFunction ?y.}";

SelectQuery query = reasConn.select(request).reasoning(ReasoningType.SL);

tuple = query.execute();

System.out.println(tuple.hasNext()); //===> false expected true


We tested with ReasoningConnection class and with all ReasoningType, without success.

We share the model in this ticket.

Thanks in advance for your help.

Sinceraly,

Florian Orpelière

testReasoning.ttl

Anton Anikin

unread,
Jul 28, 2014, 1:54:25 PM7/28/14
to sta...@clarkparsia.com
Maybe you are passing the Reasoning type in headers?
It worked before, but now it should be passed in the GET request, not in request headers...


Best Regards,
Anton Anikin


--
-- --
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

To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.



Florian Orpeliere

unread,
Jul 29, 2014, 3:50:03 AM7/29/14
to sta...@clarkparsia.com
Hi,

Thanks for your reply.
I think you are right, but i use Stardog Java API and i don't make request by myself.
The java code available works with the previous version (2.1.3)  of the Java API.
So, i think the problem comes with the version 2.2.

Sinceraly,

Florian Orpelière

Rob Vesse

unread,
Jul 29, 2014, 4:23:09 AM7/29/14
to Stardog Mailing List
2.2 was when the change was made, so if you are using the newer client API with the older server then that would explain why reasoning is not working because as Anton suggests the underlying HTTP API (that the Java API uses to communicate when using a HTTP connection string) has changed

Are you sure you are using the very latest API and server?

Rob

Florian Orpeliere

unread,
Jul 29, 2014, 4:33:52 AM7/29/14
to sta...@clarkparsia.com
Hi,

Thanks for your reply.
I well understand that HTTP API is the problem.
But, I download the lastest version (2.2) of Stardog from official website.
In this package, i use in client folder JARs for create a ReasoningConnection like : https://gist.github.com/mhgrove/1045578#file-createreasoningconn-java
So, I use well the version 2.2 of server and the version 2.2 of Java API.

Héctor Pérez-Urbina

unread,
Jul 29, 2014, 6:21:23 AM7/29/14
to sta...@clarkparsia.com
Thank you, Florian. I'll try to reproduce the issue today. I'll get back to you in the course of the day.
--
Best,
Héctor

Héctor Pérez-Urbina

unread,
Jul 30, 2014, 1:18:03 PM7/30/14
to sta...@clarkparsia.com
Dear Florian,

I was unable to try this yesterday, my apologies.

We were able to reproduce your issue. We will take a closer look and let you know what we find asap.


--
Best,
Héctor

Florian Orpeliere

unread,
Jul 30, 2014, 1:48:44 PM7/30/14
to sta...@clarkparsia.com
Dear Héctor,

It does not matter, do not apologize.
Thank you for looking at the problem. 
So I wait your return. In the meantime, I'm working with version 2.1.3.

Thank you again.

Sinceraly,

Florian


--
Best,
Héctor



--
Best,
Héctor

Mike Grove

unread,
Aug 1, 2014, 11:36:35 AM8/1/14
to stardog
Florian,

After looking at the issue for a bit, we realized what's happening is you're opening a connection without reasoning, starting a transaction, and then trying to query within that transaction using reasoning.  There cannot be a mismatch like that in the reasoning level, ie NONE vs SL, QL vs EL, etc.  If you remove the call to begin from your code, it will work as expected.  Similarly, if you simply create the connection with the reasoning level you prefer, you could leave the code as is.

Cheers,

Mike

Florian Orpeliere

unread,
Aug 2, 2014, 3:54:23 PM8/2/14
to sta...@clarkparsia.com
Hi Michael,

Thanks for your reply.
It's works !
Sorry for the stupidity. 
As this code worked in 2.1.3, I did not pay attention. 
Thank you again for your help. 

Best regards,

Florian
Reply all
Reply to author
Forward
0 new messages