我想通过http向远程端点发送更新。我发现joseki充当了这样一个端点。
但是,如果我只知道端点的uri,如何向此端点发送更新查询?
// To do a select-query you can use this:
QueryExecution qe = QueryExecutionFactory.sparqlService(serviceURI, query);
// (Sidenote:) does the next line have the desired effect of setting the binding?
// After all, sparqlService has no alternative with initialBindang as parameter
qe.setInitialBinding(initialBinding);
result = qe.execSelect();
// But updates do not support this kind of sparqlService method
// Illegal:
// UpdateAction.sparqlServiceExecute(serviceURI, query);
// I can use the following:
UpdateAction.parseExecute(updateQuery, dataset, initialBinding);
// But dataset is a Dataset object, not the uri.
// I don't believe this is the correct way to overcome this:
Dataset dataset = DatasetFactory.create(serviceURI);否则,我想知道如何对只有URI已知的端点进行远程更新查询。
更新:最终求助于本地耶娜。这种RDF端点接受insert和delete语句。我没有成功地找到一个可以接受修改查询的远程RDF端点。
发布于 2010-08-18 07:58:22
否则,我想知道如何对只有URI已知的端点进行远程更新查询。
根据端点服务器的不同,处理方式略有不同。有一个sparql/更新协议草案。但由于这是草案和相当新的支持是一个小变体。
您可以编写sparql更新查询,就像编写SQL、insert或update语句一样。
update命令是修改、插入、删除、加载、清除,但不是所有这些都支持。
由于端点通常是公共的,在允许操作之前通常需要进行一些身份验证,因此在规范中没有定义这一点,实现特定的也是如此。
建议为update语句使用不同的URL,以便可以使用http身份验证。4存储,使用/sparql进行查询,/update用于更新查询。
W3C草案有一些关于如何构造sparql更新查询的示例。
发布于 2011-07-02 18:39:17
Joseki不支持远程更新。您可能应该看看它的后继者福塞基,它支持SPARQL。
https://stackoverflow.com/questions/3493238
复制相似问题