Closed MJRinne closed 10 years ago
Verified working 9.5.2014, output:
s,p,o http://instans.org/count,http://instans.org/value,0 http://instans.org/count,http://instans.org/value,1 http://instans.org/count,http://instans.org/value,2 http://instans.org/count,http://instans.org/value,3 http://instans.org/count,http://instans.org/value,10
I cannot find a way to update a value stored in a graph.
Steps to reproduce:
1) Query (issue6.rq):
PREFIX : http://instans.org/ PREFIX mem: http://instans.org/memory/
INSERT { GRAPH mem: { :count :value ?value } } WHERE { :init :value ?value } ; DELETE { :event :value ?val GRAPH mem: { :count :value ?sum } } INSERT { GRAPH mem: { :count :value ?newSum } } WHERE { :event :value ?val GRAPH mem: { :count :value ?sum } BIND ( ?sum + ?val AS ?newSum ) } ; SELECT * WHERE { GRAPH mem: { ?s ?p ?o } }
2) Data (issue6.ttl):
@prefix : http://instans.org/ . :init :value 0 . :event :value 1 . :event :value 1 . :some :thing :else . :event :value 1 . :event :value 7 .
3) Command line: $ instans -r issue6.rq -t issue6.ttl
What happens:
The following lines are printed: s,p,o http://instans.org/count,http://instans.org/value,0
After this execution continues eternally, no more output is produced.
The mem-value may get stuck in an eternal loop increasing the count-value, but this is not observed by the SELECT-query.
What was expected to happen:
The data in the "mem:"-graph was expected to count the sum of the input values (with value 1 the number of elements) like this: s,p,o http://instans.org/count,http://instans.org/value,0 http://instans.org/count,http://instans.org/value,1 http://instans.org/count,http://instans.org/value,2 http://instans.org/count,http://instans.org/value,3 http://instans.org/count,http://instans.org/value,10