0

如何在 4store sparql 中插入带有“where”条件的插入查询据我搜索,我知道我们必须使用 curl 命令。我尝试使用这个

         Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","curl -i -d 'update=INSERT+DATA+{+?subject2+<http://www.w3.org/2002/07/owl/sameAs>+?subject3+.+}+WHERE+{+?subject2+<http://localhost:2020/vocab/Schema_feature>+\""+first[0]+"\"+.+?subject3+<http://localhost:2020/vocab/Schema_feature>+\""+first[1]+"\"+.+}' http://localhost:8000/update/"});

但它说“WHERE”不应该在那里。我做错了什么?有没有其他方法可以做到这一点使用简单的插入命令我无法在 sparql 中工作

它正在工作,但对于 ?subject3 它正在输入空值。我不知道为什么。当我检查三元组的 where 条件时,它们正在显示值

4

1 回答 1

2

你不

insert data { ... } where { ... }

您可以使用以下方法插入常量数据:

insert data { ... }

或者您可以计算要插入的数据

insert { ... } where { ... }

看起来后一个是你想要的。

于 2015-06-20T15:50:43.667 回答