Exception when using ReasoningConnection

21 views
Skip to first unread message

Valentino Hudhra

unread,
May 4, 2015, 2:09:10 PM5/4/15
to sta...@clarkparsia.com
Hi all, 

I am having trouble to establish a reasoning connection. I have added all client jar files in the Eclipse project but I am getting this exception:

Exception in thread "main" com.complexible.stardog.StardogException: Could not find an appropriate view implementation of this connection for 'com.complexible.stardog.api.reasoning.ReasoningConnection'.

at com.complexible.stardog.api.impl.AbstractConnection.as(AbstractConnection.java:126)...

I create the connection like this:

ReasoningConnection aReasoningConn = ConnectionConfiguration
 
.to("myDB")
 
.credentials("admin", "admin")
 
.server("snarl://127.0.0.1:5820")
 
.reasoning(false).connect().as(ReasoningConnection.class);

The database was created with RDFS reasoning type.

Any ideas how to resolve this?

Cheers,

Valentino

Michael Grove

unread,
May 4, 2015, 2:14:24 PM5/4/15
to stardog
On Mon, May 4, 2015 at 2:09 PM, Valentino Hudhra <valev...@gmail.com> wrote:
Hi all, 

I am having trouble to establish a reasoning connection. I have added all client jar files in the Eclipse project but I am getting this exception:

You missed a jar file, you're getting that exception because one of the client jars is missing from the path.

Cheers,

Mike
 

Exception in thread "main" com.complexible.stardog.StardogException: Could not find an appropriate view implementation of this connection for 'com.complexible.stardog.api.reasoning.ReasoningConnection'.

at com.complexible.stardog.api.impl.AbstractConnection.as(AbstractConnection.java:126)...

I create the connection like this:

ReasoningConnection aReasoningConn = ConnectionConfiguration
 
.to("myDB")
 
.credentials("admin", "admin")
 
.server("snarl://127.0.0.1:5820")
 
.reasoning(false).connect().as(ReasoningConnection.class);

The database was created with RDFS reasoning type. 

Any ideas how to resolve this?

Cheers,

Valentino

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

Valentino Hudhra

unread,
May 4, 2015, 2:20:43 PM5/4/15
to sta...@clarkparsia.com
Are all the jars needed in the client folder of the distribution?

I read in another post that the jar which is related to this issue is stardog-reasoning-snarl-client-*.jar. I cannot find this in Stardog 3.0.1.

Thanks,

Valentino

Michael Grove

unread,
May 4, 2015, 2:27:30 PM5/4/15
to stardog
On Mon, May 4, 2015 at 2:20 PM, Valentino Hudhra <valev...@gmail.com> wrote:
Are all the jars needed in the client folder of the distribution?

For the most part, yes.  You don't need the jars in the `http` folder if you don't plan on using the HTTP protocol.  Similarly, you don't need the jars in the `jena` folder if you don't use jena.

But you need everything in `api` and `snarl` at a minimum if you want to use the client libraries in your application.

Cheers,

Mike

Valentino Hudhra

unread,
May 4, 2015, 2:36:18 PM5/4/15
to sta...@clarkparsia.com
Great, thanks. I have included all of them but I still I get the same issue..

What's more I get a NullPointerException notification in the webconsole when querying with reasoning enabled. I have pasted the stardog.log below. I am not sure if this is related with the above.

May 04, 2015 7:30:39 PM com.complexible.stardog.protocols.server.SPECServerFunction query


SEVERE
: There was an error executing query: prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix owl
: <http://www.w3.org/2002/07/owl#>

prefix xsd
: <http://www.w3.org/2001/XMLSchema#>

prefix rdfs
: <http://www.w3.org/2000/01/rdf-schema#>

prefix foaf
: <http://xmlns.com/foaf/0.1>




sELECT
* where {?a a foaf:Person} limit 50 offset 0

com
.complexible.stardog.StardogException: java.lang.NullPointerException

at com
.complexible.stardog.StardogKernel.getConnection(StardogKernel.java:916)

at com
.complexible.stardog.protocols.server.KernelServerFunction.getConnection(KernelServerFunction.java:67)

at com
.complexible.stardog.protocols.server.SPECServerFunction.query(SPECServerFunction.java:463)

at com
.complexible.stardog.protocols.server.SPECServerFunction.handleMessage(SPECServerFunction.java:138)

at com
.complexible.stardog.protocols.http.annex.QueryPanelEndpoint.handleMessage(QueryPanelEndpoint.java:89)

at com
.complexible.common.protocols.server.rpc.ServerHandler.handleMessage(ServerHandler.java:264)

at com
.complexible.common.protocols.server.rpc.ServerHandler.channelRead(ServerHandler.java:147)

at io
.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)

at io
.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)

at io
.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:299)

at io
.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)

at io
.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)

at io
.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)

at java
.lang.Thread.run(Thread.java:745)

Caused by: com.complexible.stardog.db.DatabaseException: java.lang.NullPointerException

at com
.complexible.stardog.db.DatabaseImpl.connect(DatabaseImpl.java:1054)

at com
.complexible.stardog.db.DatabaseImpl.openConnection(DatabaseImpl.java:969)

at com
.complexible.stardog.StardogKernel.getConnection(StardogKernel.java:879)

... 13 more

Caused by: java.lang.NullPointerException

at com
.google.common.base.Preconditions.checkNotNull(Preconditions.java:213)

at com
.google.common.collect.SingletonImmutableList.<init>(SingletonImmutableList.java:40)

at com
.google.common.collect.ImmutableList.of(ImmutableList.java:89)

at com
.clarkparsia.pellet.api.term.TermFactory.functionEval(TermFactory.java:614)

at com
.clarkparsia.pellet.api.term.builtins.FunctionAtomRewriter.rewrite(FunctionAtomRewriter.java:117)

at com
.clarkparsia.blackout.OrtizTermFactory.datatypeAssertion(OrtizTermFactory.java:150)

at com
.clarkparsia.blackout.OrtizTermFactory.negativeDatatypeAssertion(OrtizTermFactory.java:139)

at com
.clarkparsia.blackout.ClausificationVisitor.visit(ClausificationVisitor.java:277)

at com
.clarkparsia.pellet.api.term.impl.axiom.DataPropertyRangeImpl.accept(DataPropertyRangeImpl.java:27)

at com
.clarkparsia.blackout.ClausificationVisitor.clausify(ClausificationVisitor.java:131)

at com
.clarkparsia.blackout.BlackoutUtilities$Clausifier.handle(BlackoutUtilities.java:100)

at com
.clarkparsia.blackout.NormalizationVisitor.addNormalizedAxiom(NormalizationVisitor.java:107)

at com
.clarkparsia.blackout.NormalizationVisitor.visit(NormalizationVisitor.java:411)

at com
.clarkparsia.pellet.api.term.impl.axiom.DataPropertyRangeImpl.accept(DataPropertyRangeImpl.java:27)

at com
.clarkparsia.blackout.NormalizationVisitor.normalize(NormalizationVisitor.java:103)

at com
.clarkparsia.blackout.BlackoutUtilities$Clausifier.clausify(BlackoutUtilities.java:90)

at com
.clarkparsia.blackout.BlackoutUtilities$Clausifier.access$100(BlackoutUtilities.java:79)

at com
.clarkparsia.blackout.BlackoutUtilities.clausify(BlackoutUtilities.java:76)

at com
.complexible.stardog.reasoning.blackout.BlackoutReasoner.computeState(BlackoutReasoner.java:381)

at com
.complexible.stardog.reasoning.blackout.BlackoutReasoner.getState(BlackoutReasoner.java:285)

at com
.complexible.stardog.reasoning.blackout.BlackoutReasoner.openConnection(BlackoutReasoner.java:180)

at com
.complexible.stardog.reasoning.ConnectableReasoner.openConnection(ConnectableReasoner.java:137)

at com
.complexible.stardog.reasoning.ConnectableReasoner.openConnection(ConnectableReasoner.java:35)

at com
.complexible.stardog.db.DatabaseImpl.connect(DatabaseImpl.java:1044)

... 15 more



Evren Sirin

unread,
May 4, 2015, 3:11:48 PM5/4/15
to Stardog
This error is unrelated to the classpath issue. It looks like a data
property range axiom in your ontology is causing a problem but it is
not clear why. Can you send us the ontology so we can look into this?

Thanks,
Evren

Valentino Hudhra

unread,
May 4, 2015, 3:19:34 PM5/4/15
to sta...@clarkparsia.com

I am using just FOAF. It's causing some warnings due to non being RDFS but I would excpect to ignore non-RDFS axioms, like in 2.* versions.

Evren Sirin

unread,
May 4, 2015, 3:47:27 PM5/4/15
to Stardog
In 2.x versions Stardog completely ignored data property ranges and
user-defined datatypes regardless of the reasoning level. Now Stardog
supports these constructs but turns out there is a bug in processing
axioms in the form "p rdfs:range rdfs:Literal". We'll fix this in the
next release.

Best,
Evren

Valentino Hudhra

unread,
May 5, 2015, 4:59:30 AM5/5/15
to sta...@clarkparsia.com
Thanks, Evren. I guess I can do without those axioms for now. 

Any help regarding my original issue? I am still getting 

Exception in thread "main" com.complexible.stardog.StardogException: Could not find an appropriate view implementation of this connection for 'com.complexible.stardog.api.reasoning.ReasoningConnection'.

at com.complexible.stardog.api.impl.AbstractConnection.as(AbstractConnection.java:126)


although I have added ALL the client jars probably 20 times now. Can you please at least  say which are the jars that cause this exception, so I can eyeball it?

Thanks,

Valentino

Michael Grove

unread,
May 5, 2015, 8:17:04 AM5/5/15
to stardog
On Tue, May 5, 2015 at 4:59 AM, Valentino Hudhra <v.hu...@gmail.com> wrote:
Thanks, Evren. I guess I can do without those axioms for now. 

Any help regarding my original issue? I am still getting 

Exception in thread "main" com.complexible.stardog.StardogException: Could not find an appropriate view implementation of this connection for 'com.complexible.stardog.api.reasoning.ReasoningConnection'.

at com.complexible.stardog.api.impl.AbstractConnection.as(AbstractConnection.java:126)


although I have added ALL the client jars probably 20 times now. Can you please at least  say which are the jars that cause this exception, so I can eyeball it?

You need all of the jars that start with "stardog-reasoning"

Cheers,

Mike

Piotr

unread,
Nov 17, 2016, 1:45:31 PM11/17/16
to Stardog
Hi,

I'm getting the same error using version 4.2: "com.complexible.stardog.

StardogException: Could not find an appropriate view implementation of this connection for 'com.complexible.stardog.api.reasoning.ReasoningConnection'."



Here's the list of "stardog-reasoning*" jars from my build folder:
 

stardog-reasoning-api-4.2.jar

stardog-reasoning-shared-4.2.jar

stardog-reasoning-protocols-http-client-4.2.jar

stardog-reasoning-protocols-shared-4.2.jar

stardog-reasoning-cli-4.2.jar

stardog-reasoning-core-4.2.jar

stardog-reasoning-protocols-http-server-4.2.jar

stardog-reasoning-protocols-snarl-server-4.2.jar

stardog-reasoning-protocols-snarl-shared-4.2.jar

Could you tell me what is missing? I think I got all "stardog-reasoning*" jars from 4.2 distribution.

Thanks,
Piotr

Michael Grove

unread,
Nov 18, 2016, 7:21:52 AM11/18/16
to stardog
What protocol are you using?

What dependency are you using to resolve the jars?

Cheers,

Mike

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

Piotr Nowara

unread,
Nov 18, 2016, 11:29:49 AM11/18/16
to sta...@clarkparsia.com
Hi,

I'm using http protocol.

I don't use any dependency management tool. I just copied the jars form the release to a library folder in my IDE and built my app as usual. This works well until I've started to use ReasoningConnection - now the build finishes without errors but my app crashes on startup.

Thanks,
Piotr

---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.

Zachary Whitley

unread,
Nov 18, 2016, 11:43:43 AM11/18/16
to Stardog
I don't know how you're running your application but are you sure the jars on on the classpath when you go to run your application?

Piotr Nowara

unread,
Nov 21, 2016, 6:25:19 AM11/21/16
to sta...@clarkparsia.com
Yes. I'm sure they are there.

Maybe there's too many of them and there is some kind of jar conflict?

Piotr Nowara

unread,
Nov 22, 2016, 5:51:12 AM11/22/16
to sta...@clarkparsia.com
Could someone tell me what jar is supposed to contain the "appropriate view implementation"?

2016-11-21 6:25 GMT-05:00 Piotr Nowara <piotr...@gmail.com>:
Yes. I'm sure they are there.

Maybe there's too many of them and there is some kind of jar conflict?
Reply all
Reply to author
Forward
0 new messages