[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [office-collab] Change Tracking on the RDF itself: Someinitial thoughts...
?subj ?pred ?object ?mycontext
?subj ?pred ?object ?ctctx1 ?ctctx1 <uri:context> ?mycontext
$ cat buildctctx.sh #!/bin/bash rm -f ctctxtest*db rdfproc -c ctctxtest -- add "bnode1" "http://www.w3.org/2003/01/geo/wgs84_pos#lat" "51.47026" "uri:cn1" rdfproc -c ctctxtest -- add "bnode1" "http://www.w3.org/2003/01/geo/wgs84_pos#long" "-2.59466" "uri:cn2" rdfproc -c ctctxtest -- add "uri:gollum" "http://xmlns.com/foaf/0.1/name" "Gollum" "uri:cn3" rdfproc -c ctctxtest -- add "uri:gollum" "http://xmlns.com/foaf/0.1/phone" "tel:11 1322342" "uri:cn4" rdfproc -c ctctxtest -- add "uri:gollum" "http://xmlns.com/foaf/0.1/homepage" "http://en.wikipedia.org/wiki/gollum" "uri:cn5" rdfproc -c ctctxtest -- add "uri:cn1" "uri:delta-change-id" "1^^xsd:integer" rdfproc -c ctctxtest -- add "uri:cn2" "uri:delta-change-id" "1^^xsd:integer" rdfproc -c ctctxtest -- add "uri:cn3" "uri:delta-change-id" "1^^xsd:integer" rdfproc -c ctctxtest -- add "uri:cn4" "uri:delta-change-id" "1^^xsd:integer" rdfproc -c ctctxtest -- add "uri:cn5" "uri:delta-change-id" "1^^xsd:integer" # update Gollum's phone number rdfproc -c ctctxtest -- add "uri:gollum" "http://xmlns.com/foaf/0.1/phone" "tel:11 6665534" "uri:cn6" rdfproc -c ctctxtest -- add "uri:cn6" "uri:delta-change-id" "2^^xsd:integer" rdfproc -c ctctxtest -- add "uri:cn6" "uri:update" "uri:cn4" rdfproc -c ctctxtest -- add "uri:cn4" "uri:succeddedby" "uri:cn6" rdfproc -c ctctxtest -- add "uri:cn4" "uri:deleted-change-id" "2^^xsd:integer" # remove his home page. rdfproc -c ctctxtest -- add "uri:cn5" "uri:deleted-change-id" "3^^xsd:integer" # update Gollum's phone number rdfproc -c ctctxtest -- add "uri:gollum" "http://xmlns.com/foaf/0.1/phone" "tel:11 3232 6665534" "uri:cn8" rdfproc -c ctctxtest -- add "uri:cn8" "uri:delta-change-id" "4^^xsd:integer" rdfproc -c ctctxtest -- add "uri:cn8" "uri:update" "uri:cn6" rdfproc -c ctctxtest -- add "uri:cn6" "uri:succeddedby" "uri:cn8" rdfproc -c ctctxtest -- add "uri:cn6" "uri:deleted-change-id" "4^^xsd:integer" rdfproc -c ctctxtest -- add "uri:cn6" "uri:succeddedby" "uri:cn8"
$ cat ./ctctxcurrent.sparql #!/bin/bash rdfproc -c ctctxtest query - - ' prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?graph ?s ?p ?o ?gver where { graph ?graph { ?s ?p ?o . } . ?graph <uri:delta-change-id> ?gver . OPTIONAL { ?graph <uri:deleted-change-id> ?delid } FILTER ( ?gver <= "3^^xsd:integer" && ( !bound(?delid) || ?delid >= "3^^xsd:integer" )) } '
$ ./ctctxcurrent.sparql rdfproc: Query returned bindings results: result: [graph=<uri:cn1>, s=<bnode1>, p=<http://www.w3.org/2003/01/geo/wgs84_pos#lat>, o="51.47026", gver="1^^xsd:integer"] result: [graph=<uri:cn2>, s=<bnode1>, p=<http://www.w3.org/2003/01/geo/wgs84_pos#long>, o="-2.59466", gver="1^^xsd:integer"] result: [graph=<uri:cn3>, s=<uri:gollum>, p=<http://xmlns.com/foaf/0.1/name>, o="Gollum", gver="1^^xsd:integer"] result: [graph=<uri:cn5>, s=<uri:gollum>, p=<http://xmlns.com/foaf/0.1/homepage>, o=<http://en.wikipedia.org/wiki/gollum>, gver="1^^xsd:integer"] result: [graph=<uri:cn6>, s=<uri:gollum>, p=<http://xmlns.com/foaf/0.1/phone>, o="tel:11 6665534", gver="2^^xsd:integer"] rdfproc: Query returned 5 results
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]