Sparql - delete queries stop working after update

荒凉一梦 提交于 2019-12-06 15:33:26

The reason this no longer works is that your DELETE clause contains a variable (?sessionID) that is never bound to a value anywhere, so during the evaluation of the operation, this translates to an incomplete triple pattern and is ignored.

In earlier versions of Sesame, an unbound variable in the DELETE clause was interpreted to mean a wildcard. However, this is in conflict with the SPARQL specification, and was therefore fixed as a bug in Sesame release 2.6.7. See http://www.openrdf.org/issues/browse/SES-1047 for details.

You should modify your DELETE operation slightly, by adding the ?sessionID patern to your WHERE-clause, like so:

PREFIX oporg: <http://sesame.company.org/OPropertiesOrg#>

WITH <users:>
DELETE {
   ?userID oporg:sessionID ?sessionID
}
INSERT {
   ?userID oporg:sessionID "qafnsi9p1172c0dprf9e4bhm23"
}
WHERE{
   ?userID oporg:name "admin" ; 
           oporg:sessionID ?sessionID .
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!