我想清除 selectBuilder 对象中的 where 子句值,但我无法让它工作。
import org.apache.jena.arq.querybuilder.SelectBuilder;
public class TestClearWhere {
public static void main(String[] args) {
SelectBuilder sb = new SelectBuilder();
sb.addVar("r").addVar("unit").addVar("time").addVar("value").addVar("interest");
sb.addWhere("?r", "a", "sao:Point");
System.out.println("Before clear\n" + sb.toString());
sb.clearWhereValues(); // ?
sb.clearValues(); // ? clearValues neither works
System.out.println("After clear\n" + sb.buildString());
}
}
输出
Before clear
SELECT ?r ?unit ?time ?value ?interest
WHERE
{ ?r a "sao:Point"}
After clear
SELECT ?r ?unit ?time ?value ?interest
WHERE
{ ?r a "sao:Point"}
请让我知道我做错了什么。