[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Change Tracking on the RDF itself: Some initial thoughts...
#!/bin/bash rm -f test*db rdfproc test -- add bnode1 "http://www.w3.org/2003/01/geo/wgs84_pos#lat" "51.47026" rdfproc test -- add bnode1 "http://www.w3.org/2003/01/geo/wgs84_pos#long" "-2.59466" rdfproc test -- add "uri:gollum" "http://xmlns.com/foaf/0.1/name" "Gollum" rdfproc test -- add "uri:gollum" "http://xmlns.com/foaf/0.1/phone" "tel:11 1322342"
#!/bin/bash rm -f cttest*db rdfproc cttest -- add uri:r1 "uri:subject" "bnode1" rdfproc cttest -- add uri:r1 "uri:predicate" "http://www.w3.org/2003/01/geo/wgs84_pos#lat" rdfproc cttest -- add uri:r1 "uri:object" "51.47026" rdfproc cttest -- add uri:r2 "uri:subject" "bnode1" rdfproc cttest -- add uri:r2 "uri:predicate" "http://www.w3.org/2003/01/geo/wgs84_pos#long" rdfproc cttest -- add uri:r2 "uri:object" "-2.59466" rdfproc cttest -- add uri:r3 "uri:subject" "uri:gollum" rdfproc cttest -- add uri:r3 "uri:predicate" "http://xmlns.com/foaf/0.1/name" rdfproc cttest -- add uri:r3 "uri:object" "Gollum" rdfproc cttest -- add uri:r4 "uri:subject" "uri:gollum" rdfproc cttest -- add uri:r4 "uri:predicate" "http://xmlns.com/foaf/0.1/phone" rdfproc cttest -- add uri:r4 "uri:object" "tel:11 1322342" rdfproc cttest -- add uri:r5 "uri:subject" "uri:gollum" rdfproc cttest -- add uri:r5 "uri:predicate" "http://xmlns.com/foaf/0.1/homepage" rdfproc cttest -- add uri:r5 "uri:object" "http://en.wikipedia.org/wiki/gollum" rdfproc cttest -- add uri:r1 "uri:delta-change-id" "1^^xsd:integer" rdfproc cttest -- add uri:r2 "uri:delta-change-id" "1^^xsd:integer" rdfproc cttest -- add uri:r3 "uri:delta-change-id" "1^^xsd:integer" rdfproc cttest -- add uri:r4 "uri:delta-change-id" "1^^xsd:integer" rdfproc cttest -- add uri:r5 "uri:delta-change-id" "1^^xsd:integer" # update Gollum's phone number rdfproc cttest -- add uri:r6 "uri:subject" "uri:gollum" rdfproc cttest -- add uri:r6 "uri:predicate" "http://xmlns.com/foaf/0.1/phone" rdfproc cttest -- add uri:r6 "uri:object" "tel:11 6665534" rdfproc cttest -- add uri:r6 "uri:delta-change-id" "2^^xsd:integer" rdfproc cttest -- add uri:r6 "uri:update" "uri:r4" rdfproc cttest -- add uri:r4 "uri:succeddedby" "uri:r6" # remove his home page. rdfproc cttest -- add uri:r7 "uri:delta-change-id" "3^^xsd:integer" rdfproc cttest -- add uri:r7 "uri:delete" "uri:r5" rdfproc cttest -- add uri:r5 "uri:succeddedby" "uri:r7" # update Gollum's phone number rdfproc cttest -- add uri:r8 "uri:subject" "uri:gollum" rdfproc cttest -- add uri:r8 "uri:predicate" "http://xmlns.com/foaf/0.1/phone" rdfproc cttest -- add uri:r8 "uri:object" "tel:11 3232 6665534" rdfproc cttest -- add uri:r8 "uri:delta-change-id" "4^^xsd:integer" rdfproc cttest -- add uri:r8 "uri:update" "uri:r6" rdfproc cttest -- add uri:r6 "uri:succeddedby" "uri:r8"
#!/bin/bash rdfproc cttest query - - ' select ?s ?p ?o where { ?s ?p ?o . ?s <uri:delta-change-id> ?ver optional { ?s <uri:succeddedby> ?sucver . ?sucver <uri:delta-change-id> ?nestedver . FILTER ( ?nestedver <= "3^^xsd:integer" && ?nestedver > ?ver ) } . filter( !bound(?nestedver) && ?ver <= "3^^xsd:integer" ) } '
rdfproc: Query returned bindings results: result: [s=<uri:r1>, p=<uri:object>, o="51.47026"] result: [s=<uri:r1>, p=<uri:subject>, o="bnode1"] result: [s=<uri:r1>, p=<uri:predicate>, o=<http://www.w3.org/2003/01/geo/wgs84_pos#lat>] result: [s=<uri:r1>, p=<uri:delta-change-id>, o="1^^xsd:integer"] result: [s=<uri:r2>, p=<uri:object>, o="-2.59466"] result: [s=<uri:r2>, p=<uri:subject>, o="bnode1"] result: [s=<uri:r2>, p=<uri:predicate>, o=<http://www.w3.org/2003/01/geo/wgs84_pos#long>] result: [s=<uri:r2>, p=<uri:delta-change-id>, o="1^^xsd:integer"] result: [s=<uri:r3>, p=<uri:object>, o="Gollum"] result: [s=<uri:r3>, p=<uri:subject>, o=<uri:gollum>] result: [s=<uri:r3>, p=<uri:predicate>, o=<http://xmlns.com/foaf/0.1/name>] result: [s=<uri:r3>, p=<uri:delta-change-id>, o="1^^xsd:integer"] result: [s=<uri:r6>, p=<uri:object>, o="tel:11 6665534"] result: [s=<uri:r6>, p=<uri:update>, o=<uri:r4>] result: [s=<uri:r6>, p=<uri:subject>, o=<uri:gollum>] result: [s=<uri:r6>, p=<uri:predicate>, o=<http://xmlns.com/foaf/0.1/phone>] result: [s=<uri:r6>, p=<uri:succeddedby>, o=<uri:r8>] result: [s=<uri:r6>, p=<uri:delta-change-id>, o="2^^xsd:integer"] result: [s=<uri:r7>, p=<uri:delete>, o=<uri:r5>] result: [s=<uri:r7>, p=<uri:delta-change-id>, o="3^^xsd:integer"]
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]