Jena throwing java.lang.IllegalArgumentException

0 views
Skip to first unread message

karel....@gmail.com

unread,
Jun 18, 2014, 3:17:12 AM6/18/14
to sta...@clarkparsia.com

 Hello,

I've just extended Semantic XWiki[1][2] to support Stardog too. Unfortunately SemXWiki is based on Jena and so I hit this probably unsolvable issue:
https://groups.google.com/a/clarkparsia.com/forum/#!topic/stardog/gBHSew7YUYs

more concretely my issue is:

java.lang.IllegalArgumentException: Not a valid (absolute) URI: Benchmark.BenchPage_100
        at com.complexible.common.rdf.model.StardogURI.<init>(StardogURI.java:28)
        at com.complexible.common.rdf.model.StardogValueFactory.createURI(StardogValueFactory.java:163)
        at com.complexible.stardog.jena.JenaSesameUtils.uri(JenaSesameUtils.java:211)
        at com.complexible.stardog.jena.JenaSesameUtils.resource(JenaSesameUtils.java:199)
        at com.complexible.stardog.jena.StardogJenaGraph.graphBaseFind(StardogJenaGraph.java:118)
        at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:268)
        at com.hp.hpl.jena.graph.impl.GraphBase.graphBaseFind(GraphBase.java:290)
        at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:287)
        at com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:477)
        at com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:483)
        at com.hp.hpl.jena.rdf.model.impl.ModelCom.getProperty(ModelCom.java:1249)
        at com.hp.hpl.jena.rdf.model.impl.ResourceImpl.getProperty(ResourceImpl.java:174)


which is basically probably the same. For XWiki content portability and for semantics content portability it's necessary to use XWiki's own URI/URL which is Benchmark.BenchPage_100 instead of real URL: http://localhost:8080/xwiki/bin/view/Benchmark/BenchPage_100

Anyway what's perhaps interesting is that the current Semantic XWiki supports Jena's memory morel, SDB, TDB and OpenLinkSW's Virtuoso 7. Neither of them were complaining like Stardog is... Sure, Stardog  may be the most strict one or most correct one and I can't complain about it but if it's just a slight chance to fix that, that would be great! By fix I also mean some workaround set by some documented property or something like that.

Thanks,
Karel
[1]: http://extensions.xwiki.org/xwiki/bin/view/Extension/Semantic+XWiki
[2]: https://github.com/kgardas/semxwiki

Mike Grove

unread,
Jun 18, 2014, 7:19:50 AM6/18/14
to stardog
You're correct that Benchmark.BenchPage_100 is a valid URI (at least as far as java.net.URI is concerned).  We have the current behavior as a legacy from originally using Sesame's default ValueFactory, which does the same URI check which is mostly done to avoid the more heavyweight java.net.URI parsing.

The issue is that Benchmark.BenchPage_100 is a valid *relative*  URL.  We can modify our internals to accept that, but when it's written as RDF, it's going to be resolved relative to the base of the document you're writing.  Similarly, if you're trying to read in RDF that uses that relative URI, it's going to be resolved against the base of the input document.  So for either input or output, it's going to get resolved into an absolute URI.  Same goes for SPARQL query parsing, as that is also parsed relative to a base URI.

So we can modify this to let in relative URIs, but you will have to be diligent when reading and writing that to use the correct base URI so you get the expected RDF serialization.

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