the bug meant that when sending a GET request on an empty revision (with no child changes) you would get the metadata for every change in the database.
this was because the optional query in 'get-revison' in cb.clj would fail when a revision has no changes:
[:optional [[revision-uri :dh/hasChange '?change]
this means that the variable '?change is unassigned.
a later optional query:
[:optional ['?change :dh/revisionSnapshotCSV '?snapshot]]
works fine if '?change has been assigned to a change. However when unassigned it simply retrieves every triple with the revisionSnapshotCSV predicate
my suggested fix is to include the latter query in the same optional block. SPARLQ will only execute the second part if the first part succeeds:
the bug meant that when sending a GET request on an empty revision (with no child changes) you would get the metadata for every change in the database.
this was because the optional query in 'get-revison' in cb.clj would fail when a revision has no changes: [:optional [[revision-uri :dh/hasChange '?change]
this means that the variable '?change is unassigned.
a later optional query: [:optional ['?change :dh/revisionSnapshotCSV '?snapshot]] works fine if '?change has been assigned to a change. However when unassigned it simply retrieves every triple with the revisionSnapshotCSV predicate
my suggested fix is to include the latter query in the same optional block. SPARLQ will only execute the second part if the first part succeeds:
[:optional [[revision-uri :dh/hasChange '?change] ['?change :dh/revisionSnapshotCSV '?snapshot]]]