LinkedDataFragments / Client.Java

A Triple Pattern Fragments client for Java (Jena)
MIT License
8 stars 10 forks source link

Client is broken #16

Closed RubenVerborgh closed 7 years ago

RubenVerborgh commented 7 years ago

The example in the README

LinkedDataFragmentGraph ldfg = new LinkedDataFragmentGraph("http://data.linkeddatafragments.org/dbpedia");
Model model = ModelFactory.createModelForGraph(ldfg);

fails with

Exception in thread "main" java.lang.NullPointerException
                at java.nio.CharBuffer.wrap(CharBuffer.java:487)
                at com.github.fge.uritemplate.parse.URITemplateParser.parse(URITemplateParser.java:55)
                at com.github.fge.uritemplate.URITemplate.<init>(URITemplate.java:52)
                at org.linkeddatafragments.model.LinkedDataFragment.setTemplate(LinkedDataFragment.java:140)
                at org.linkeddatafragments.model.LinkedDataFragment.hydraParse(LinkedDataFragment.java:85)
                at org.linkeddatafragments.model.LinkedDataFragment.<init>(LinkedDataFragment.java:77)
                at org.linkeddatafragments.model.LinkedDataFragmentFactory.create(LinkedDataFragmentFactory.java:18)
                at org.linkeddatafragments.client.LinkedDataFragmentsClient.getBaseFragment(LinkedDataFragmentsClient.java:60)
                at org.linkeddatafragments.model.LinkedDataFragmentGraph.graphBaseSize(LinkedDataFragmentGraph.java:102)
                at com.hp.hpl.jena.graph.impl.GraphBase.size(GraphBase.java:364)
                at org.linkeddatafragments.solver.ReorderTransformationLDF.<init>(ReorderTransformationLDF.java:41)
                at org.linkeddatafragments.model.LinkedDataFragmentGraph.<init>(LinkedDataFragmentGraph.java:37)
laurensdv commented 7 years ago

@RubenVerborgh

Try the following fix:

https://github.com/laurensdv/Client.Java/commit/18bb91749db5f6747e2372ac7da60197323e41c7

RubenVerborgh commented 7 years ago

@laurensdv While that fix is likely also necessary, applying it still gives the same error.

I also see:

 WARN [main] (ErrorHandlerFactory.java:77) - Only triples or default graph data expected : named graph data ignored

So I'm suspicious that the client actually gets back TriG or something instead of Turtle.

laurensdv commented 7 years ago

Issue might be more tricky than that then, actually Gerald fixed many issues in the java8 branch already.

Maybe consider to make this the default one?

RubenVerborgh commented 7 years ago

Certainly! It has not been pushed to GitHub though, and I couldn't find Gerald on public GitHub. Can you follow up on this one?

laurensdv commented 7 years ago

There is an open pull request on that.

RubenVerborgh commented 7 years ago

You're right, assigned you to #14.

RubenVerborgh commented 7 years ago

Fixed in #17.