Code Used to connect is as below
DigestAuthContext dcf= new DatabaseClientFactory.DigestAuthContext("admin", "admin");
DatabaseClient client = DatabaseClientFactory.newClient(
"localhost", 8000, "GraphTest",dcf);
MarkLogicDatasetGraph dg = MarkLogicDatasetGraphFactory.createDatasetGraph(client);
String queryString = "SELECT ?person " +
"WHERE { ?person <http://schema.test.com/ns/place#livesin> < https://data.test.com/loc-structure/London#this>}";
QueryExecution eq = QueryExecutionFactory.create(queryString,dg.toDataset());
ResultSet results = eq.execSelect();
while(results.hasNext()) {
QuerySolution qs = results.next();
}
Jar used: marklogic-client-api-4.0.3 and marklogic-jena-3.0.5 Error:
- The type org.apache.jena.query.Dataset cannot be resolved. It is indirectly referenced from required .class files
- The method toDataset() from the type MarkLogicDatasetGraph refers to the missing type Dataset