-
The title is the question ; ) |
Beta Was this translation helpful? Give feedback.
Answered by
ate47
Feb 9, 2023
Replies: 1 comment 1 reply
-
Hello, You need to put the HDT in a directory, here // create a SPARQL repository
SparqlRepository repository = CompiledSail.compiler()
// describe the files used to create/load the store:
// /path/to/the/hdt/dir : location of the directory containing the HDT
// /path/to/delta/dir : location of the directory containing the delta store
// (if none, a new one will be created)
// filename.hdt : name of the HDT file
.withEndpointFiles(new EndpointFiles(
Path.of("/path/to/the/hdt/dir"),
Path.of("/path/to/delta/dir"),
"filename.hdt"
))
// describe the spec used to load the HDT, can be ommited if none are required
.withHDTSpec("hdt_spec_config")
// create the repo
.compileToSparqlRepository();
try {
// run a simple SPO query as an example
Variable s = SparqlBuilder.var("s");
Variable p = SparqlBuilder.var("p");
Variable o = SparqlBuilder.var("o");
try (ClosableResult<TupleQueryResult> result =
repository.executeTupleQuery(
Queries.SELECT()
.select(s, p, o)
.where(s.has(p, o))
.getQueryString(),
10)
) {
result.getResult().forEach(b -> {
// print the (s,p,o) binding
System.out.println(
b.getBinding(s.getVarName()) + " "
+ b.getBinding(p.getVarName()) + " "
+ b.getBinding(o.getVarName())
);
});
}
} finally {
// shutdown the store, it is important to release the resources!!
repository.shutDown();
} one day it will probably be easier.... |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
D063520
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
You need to put the HDT in a directory, here
/path/to/the/hdt/dir
, then determine a directory for the delta store, here/path/to/delta/dir
, then run this: