java - how to change the Node of a TriplePath in Jena? -
i want change node of jena triplepath (org.apache.jena.sparql.core.triplepath), haven't found manner. imagine have code:
triplepath tp = null; .... //tp has been defined , not null node domain = tp.getsubject(); node predicate = tp.getpredicate(); node range = tp.getobject(); node newnode = nodefactory.createuri("http://www.example.com/example/example"); //and now? how can set node (domain/predicate/range) of tp?
the question is, how can set node (domain/predicate/range) of triplepath tp newnode i've created? there manner?
you need create new path , assign tp
. triplepath
s immutable, rest of sparql algebra in jena (any ways defeat should not used!).
for more complex setups, have template variables , use:
triplepath substitute.substitute(triplepath triplepath, binding binding)
Comments
Post a Comment