2
我想更改一個Jena TriplePath(org.apache.jena.sparql.core.TriplePath)的節點,但我還沒有找到任何方式。想象一下,我有這樣的代碼:如何更改Jena中TriplePath的節點?
TriplePath tp = null;
....
//tp has been defined and 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 I set a Node (domain/predicate/range) of tp?
的問題是,我怎麼能設置與newNode的TriplePath TP的任一節點(域/謂語/範圍),我創建了?有什麼方法嗎?