drlivingston/kr

pb with parsing Ntriples

Opened this issue · 4 comments

Hi,

I have a problem using (load-rdf-stream kb stream :ntriple)

If i use lein to run my project i don't have any dependencies problem, but when i try to run my program using java -jar ...
I have the following error while (load-rdf-stream kb stream :ntriple) :

org.openrdf.rio.UnsupportedRDFormatException: No parser factory available for RDF format N-Triples (mimeTypes=text/plain; ext=nt)
    at org.openrdf.rio.Rio.createParser(Rio.java:173)
    at org.openrdf.rio.Rio.createParser(Rio.java:188)
    at org.openrdf.repository.base.RepositoryConnectionBase.addInputStreamOrReader(RepositoryConnectionBase.java:391)
    at org.openrdf.repository.base.RepositoryConnectionBase.add(RepositoryConnectionBase.java:295)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
    at edu.ucdenver.ccp.kr.sesame.rdf$sesame_load_rdf_stream.invoke(rdf.clj:272)
    at edu.ucdenver.ccp.kr.sesame.kb.SesameKB.load_rdf_stream(kb.clj:126)

I don't know how to resolve this and don't know if you're concern by this ?
The jar include correctly sesame-rio-ntriples-2.6.10.jar
And i use (:import
(org.openrdf.rio.ntriples.NTriplesParser)) in my clj file

Do you have an idea ?

Many thanks

Samuel

if i change to (load-rdf-stream kb stream :turtle) it works
but i don't understand why it does work with lein and not with java -jar ?

If it works with lein (I use mostly maven, but they both manage the classpath for you), but not java -jar it sound like you have a classpath problem. What classpath are you using? and can you compare that to the classpath produced by lein? (I think you can see that with lein classpath)

the classpath produce by lein contain the right jar i think
/Users/ouvasam/.m2/repository/org/openrdf/sesame/sesame-rio-ntriples/2.6.10/sesame-rio-ntriples-2.6.10.jar
And i use lein uberjar to produce the jar so i think everything must be included ?
thanks,

Sorry this has sat for quite a while, trying to clean up old issues. Are you still having trouble? If so can we build a minimal test case to replicate this? If not, I'd like to close the issue.