Yes, this error affects riot as well:

stain@biggie:~/Downloads/apache-jena-3.1.0$ bin/riot --syntax=jsonld
{"@context": "https://w3id.org/bundle/context";,
 "id": "http://example.com/fred";,
 "aggregates": "http://example.com/other";
}

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.http.impl.client.cache.CacheConfig.custom()Lorg/apache/http/impl/client/cache/CacheConfig$Builder;
    at 
com.github.jsonldjava.utils.JsonUtils.createDefaultHttpClient(JsonUtils.java:333)
    at 
com.github.jsonldjava.utils.JsonUtils.getDefaultHttpClient(JsonUtils.java:323)
    at 
com.github.jsonldjava.core.DocumentLoader.getHttpClient(DocumentLoader.java:84)
    at com.github.jsonldjava.core.DocumentLoader.fromURL(DocumentLoader.java:59)
    at 
com.github.jsonldjava.core.DocumentLoader.loadDocument(DocumentLoader.java:29)
    at com.github.jsonldjava.core.Context.parse(Context.java:169)
    at com.github.jsonldjava.core.Context.parse(Context.java:252)
    at com.github.jsonldjava.core.JsonLdApi.expand(JsonLdApi.java:534)
    at com.github.jsonldjava.core.JsonLdApi.expand(JsonLdApi.java:981)
    at 
com.github.jsonldjava.core.JsonLdProcessor.expand(JsonLdProcessor.java:146)
    at 
com.github.jsonldjava.core.JsonLdProcessor.toRDF(JsonLdProcessor.java:482)
    at org.apache.jena.riot.lang.JsonLDReader.read$(JsonLDReader.java:143)
    at org.apache.jena.riot.lang.JsonLDReader.read(JsonLDReader.java:83)
    at riotcmd.CmdLangParse.parseRIOT(CmdLangParse.java:286)
    at riotcmd.CmdLangParse.parseFile(CmdLangParse.java:202)
    at riotcmd.CmdLangParse.parseFile(CmdLangParse.java:184)
    at riotcmd.CmdLangParse.exec$(CmdLangParse.java:158)
    at riotcmd.CmdLangParse.exec(CmdLangParse.java:132)
    at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
    at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
    at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
    at riotcmd.riot.main(riot.java:34)

On 9 May 2016 at 12:16, François-Paul Servant
<[email protected]> wrote:
> Hi,
>
>> I get another JSON-LD error with using the @context
>> https://w3id.org/bundle/context that I need to check further what is
>> the cause of that (it works fine with JSON-LD Playground).
>>
>> org.apache.jena.riot.RiotException: loading remote context failed:
>> https://w3id.org/bundle/context
>>    at 
>> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.error(ErrorHandlerFactory.java:128)
>>    at org.apache.jena.riot.lang.JsonLDReader.read$(JsonLDReader.java:146)
>>    at org.apache.jena.riot.lang.JsonLDReader.read(JsonLDReader.java:83)
>>    at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
>>    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:259)
>>    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:245)
>>
>
> I don’t know whether it is the same thing, but I noticed (working with 
> 3.1.1-SNAPSHOT) that following test, that attempts to read a simple jsonld 
> document with an external context
>
> public class TestJsonLDReader {
>
>         @Test public final void test() {
>                 String jsonld = 
> "{\"@id\":\"_:b0\",\"@type\":\"http://schema.org/Person\",\"name\":\"John 
> Doe\",\"@context\":\"http://schema.org/\"}";;
>                 StringReader reader = new StringReader(jsonld);
>                 Model m = ModelFactory.createDefaultModel();
>                 m.read(reader, null, "JSON-LD");
>                 m.write(System.out, "TURTLE");
>         }
>
> }
>
> gives:
>
> java.lang.NoSuchMethodError: 
> org.apache.http.impl.client.cache.CacheConfig.custom()Lorg/apache/http/impl/client/cache/CacheConfig$Builder;
>         at 
> com.github.jsonldjava.utils.JsonUtils.createDefaultHttpClient(JsonUtils.java:333)
>         at 
> com.github.jsonldjava.utils.JsonUtils.getDefaultHttpClient(JsonUtils.java:323)
>         at 
> com.github.jsonldjava.core.DocumentLoader.getHttpClient(DocumentLoader.java:84)
>         at 
> com.github.jsonldjava.core.DocumentLoader.fromURL(DocumentLoader.java:59)
>         at 
> com.github.jsonldjava.core.DocumentLoader.loadDocument(DocumentLoader.java:29)
>         at com.github.jsonldjava.core.Context.parse(Context.java:169)
>         at com.github.jsonldjava.core.Context.parse(Context.java:252)
>         at com.github.jsonldjava.core.JsonLdApi.expand(JsonLdApi.java:534)
>         at com.github.jsonldjava.core.JsonLdApi.expand(JsonLdApi.java:981)
>         at 
> com.github.jsonldjava.core.JsonLdProcessor.expand(JsonLdProcessor.java:146)
>         at 
> com.github.jsonldjava.core.JsonLdProcessor.toRDF(JsonLdProcessor.java:482)
>         at org.apache.jena.riot.lang.JsonLDReader.read$(JsonLDReader.java:143)
>         at org.apache.jena.riot.lang.JsonLDReader.read(JsonLDReader.java:64)
>
> It seems that there is a conflict between the version of http-client cache 
> used by JSON-LD java 0.8.2 (4.5.1), and the one that wants jena (4.2.6). Jena 
> seems to really want to choose its version, cf pom/xml:
>
> +       /*
> +      <dependency>
> +        <groupId>com.github.jsonld-java</groupId>
> +        <artifactId>jsonld-java</artifactId>
> +        <version>${ver.jsonldjava}</version>
> +        <exclusions>
> +          <exclusion>
> +            <groupId>commons-logging</groupId>
> +            <artifactId>commons-logging</artifactId>
> +          </exclusion>
> +          <!-- Exclude so we use our choice of versions -->
> +          <exclusion>
> +            <groupId>org.apache.httpcomponents</groupId>
> +            <artifactId>httpclient-cache</artifactId>
> +          </exclusion>
> +          <exclusion>
> +            <groupId>org.apache.httpcomponents</groupId>
> +            <artifactId>httpclient</artifactId>
> +          </exclusion>
>
> Best,
>
> fps
>



-- 
Stian Soiland-Reyes
Apache Taverna (incubating), Apache Commons RDF (incubating)
http://orcid.org/0000-0001-9842-9718

Reply via email to