Closed hansidm closed 8 years ago
Just to add, the error I get in Jena is 500 Server error.
And the SolRDF used at the CreateHTTP method: http://127.0.0.1:8983/solr/store/rdf-graph-store
Hi @hansidm, that sounds really strange. The integration test suite is currently using the SolRDF Client API, which basically do the same. I've tried to run your code (using a different file, one of those used in the test suite) and everything works:
public static void main(String[] args) throws Exception {
Model model = ModelFactory.createDefaultModel();
DatasetAccessor accessor = DatasetAccessorFactory.createHTTP("http://127.0.0.1:8080/solr/store/rdf-graph-store");
model.read(new File("....").toURI().toString(), "N-TRIPLES");
accessor.add(model);
}
After that,
> curl "http://127.0.0.1:8080/solr/store/solr-query?q=*:*&indent=true"
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
</lst>
<result name="response" numFound="40" start="0">
<doc>
<str name="c">_</str>
<str name="s"><http://example.org/book2></str>
<str name="p"><http://example.org/ns#reviewed></str>
<str name="id">c8ad7d73-970e-321f-9905-3030a6e9fa0c</str>
<str name="o">"true"^^http://www.w3.org/2001/XMLSchema#boolean</str>
<long name="_version_">1527433009339301888</long></doc>
<doc>
<str name="c">_</str>
<str name="s"><http://example.org/book2></str>
<str name="p"><http://example.org/ns#downloads></str>
<str name="id">e7c6cffc-8640-3c09-9abe-c5567b61fe91</str>
<str name="o">"442"^^http://www.w3.org/2001/XMLSchema#integer</str>
<long name="_version_">1527433009388584960</long></doc>
<doc>
<str name="c">_</str>
<str name="s"><http://example.org/book2></str>
<str name="p"><http://example.org/ns#price></str>
<str name="id">1d17d424-979f-36be-990f-a12d98f9eaf5</str>
<str name="o">"23.95"^^http://www.w3.org/2001/XMLSchema#double</str>
<long name="_version_">1527433009389633536</long></doc>
<doc>
<str name="c">_</str>
...
I suspect your (client) module is not filled. Check here
model.read(filePath, getLang(contentType));
It is not a path, that must be a valid URI (check my sample code above). I guess your issue has something to do with that, because again, my example above is working perfectly.
I meant your local Model.
Hi @agazzarini,
I have created a new project with just that
public static void main(String args[]) {
Model model = ModelFactory.createDefaultModel();
DatasetAccessor accessor = DatasetAccessorFactory.createHTTP("http://127.0.0.1:8983/solr/store/rdf-graph-store");
model.read(".....", "TTL");
model.write(System.out, "TTL");
accessor.add(model);
}
The model is written to the console correctly. But when I can accessor.add, I get the following: Exception in thread "main" org.apache.jena.atlas.web.HttpException: 500 - Server Error
at org.apache.jena.riot.web.HttpOp.exec(HttpOp.java:1107)
at org.apache.jena.riot.web.HttpOp.execHttpPost(HttpOp.java:718)
at org.apache.jena.riot.web.HttpOp.execHttpPost(HttpOp.java:686)
at org.apache.jena.web.DatasetGraphAccessorHTTP.doPost(DatasetGraphAccessorHTTP.java:209)
at org.apache.jena.web.DatasetGraphAccessorHTTP.httpPost(DatasetGraphAccessorHTTP.java:199)
at org.apache.jena.web.DatasetAdapter.add(DatasetAdapter.java:91)
at solrTest.Main.main(Main.java:29)
I'm using Jena 3.0.1. The stack trace on Solr is the same that I previously pasted here.
UPDATE: I recompiled SolRDF master branch (all integration tests successful). Same error. Also, I have tried with the sample dataset bsbm-generated-dataset.nt. Same error.
I am using Solr 5.3.2.
UPDATE: The issue has to do with the use of the JTS Topology Suite libraries. My Solr instance contains not only SolRDF collections, but also regular Solr collections that have one or more fields of the type solr.SpatialRecursivePrefixTreeFieldType. For that field type to work, JTS libs need to copied over to server/lib/ext directory inside Solr installation (they don't work when copied to the lib dir in the collection).
When the JTS lib is loaded by Solr, the RDF graph operations request to SolRDF start returning HTTP Error 500, with the internal exception and stack trace posted above.
@handsim can we close this issue? I guess it has little to do with SolRDF.
What do you think?
How do you solve the HttpException: 500 ?
Hi, that error is just a generic failure signal, you should check the system logs in order to understand what is the actual cause
Best, Andrea
On 5 Oct 2017 01:25, "Andre Valdestilhas" notifications@github.com wrote:
How do you solve the HttpException: 500 ?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/spaziocodice/SolRDF/issues/122#issuecomment-334317752, or mute the thread https://github.com/notifications/unsubscribe-auth/AHOA4FROqqJbiJp1sbv3quLZzHJOsQVjks5spBPogaJpZM4HkFM_ .
I am getting the following stracktrace when trying to load some ontologies that locally stored on my machine programmatically using Jena:
And here it goes my code that tries to upload the ontologies:
And some of the ontologies I'm trying to load: http://hadatac.org/ont/hasneto# http://ecoinformatics.org/oboe/oboe.1.0/oboe-standards.owl# http://www.w3.org/ns/prov#