I am working on a project that primarily uses Blazegraph as a back-end, and from what I understand, that locks me into a relatively old Sesame (2.7.12).
The project has another component that can use an embedded Sesame, or a free-standing Sesame OR RDF4J. I have a free-standing RDF4J already set up, so I'd prefer to use that.
I can connect to the embedded Sesame with the following Scala code. If I change serverUrl
to point to the free-standing RDF4J 2.2, I get the error below.
Is it possible to access RDF4J servers with the Sesame API?
val serverUrl = "http://address.domain:8080/rdf4j-server"
val manager = new RemoteRepositoryManager(serverUrl)
manager.initialize()
val repositoryId = "repo_id"
val repository = manager.getRepository(repositoryId)
val con = repository.getConnection()
val queryString = "SELECT ?x ?y WHERE { ?x ?p ?y } "
val tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
val result = tupleQuery.evaluate()
[main] WARN org.openrdf.http.client.SesameSession - Server reports problem: org.eclipse.rdf4j.repository.config.RepositoryConfigException: Repository implementation for repository missing Exception in thread "main" java.lang.ExceptionInInitializerError at UuidRefresh.main(UuidRefresh.scala) Caused by: org.openrdf.repository.http.HTTPQueryEvaluationException: org.eclipse.rdf4j.repository.config.RepositoryConfigException: Repository implementation for repository missing at org.openrdf.repository.http.HTTPTupleQuery.evaluate(HTTPTupleQuery.java:64) at UuidRefresh$.(UuidRefresh.scala:54) at UuidRefresh$.(UuidRefresh.scala) ... 1 more Caused by: org.openrdf.repository.RepositoryException: org.eclipse.rdf4j.repository.config.RepositoryConfigException: Repository implementation for repository missing at org.openrdf.http.client.SparqlSession.execute(SparqlSession.java:1100) at org.openrdf.http.client.SparqlSession.executeOK(SparqlSession.java:1028) at org.openrdf.http.client.SparqlSession.sendTupleQueryViaHttp(SparqlSession.java:807) at org.openrdf.http.client.SparqlSession.getBackgroundTupleQueryResult(SparqlSession.java:704) at org.openrdf.http.client.SparqlSession.sendTupleQuery(SparqlSession.java:363) at org.openrdf.repository.http.HTTPTupleQuery.evaluate(HTTPTupleQuery.java:58) ... 3 more