Skip to content

Commit 439ccf8

Browse files
committed
Fix deletion queries returning all values
When the deletions graph contains deleted properties that have multiple values, ALL of those values are returned in the deletion queries, instead of just the ones that were deleted. It turns out that in the deletion BGPs the values are always unbound because of the anonymous variable `[]`. This brings in all values when the final BGP for returning optional labels matches on all of them, because of this loose binding. In order to avoid this, simply use the named variable that is already used in the last BGP. Doing this should have no side-effects.
1 parent c625723 commit 439ccf8

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

dqgen/resources/query_templates/count_property_deletions.rq

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ WHERE {
6969
}
7070
# get all deleted property values
7171
GRAPH ?deletionsGraph {
72-
?instance ?property [] .
72+
?instance ?property ?value .
7373
}
7474
# ... which were not attached to some (other) instance now
7575
FILTER NOT EXISTS {
7676
GRAPH ?insertionsGraph {
77-
?instance ?property [] .
77+
?instance ?property ?value .
7878
}
7979
}
8080
GRAPH ?oldVersionGraph {

dqgen/resources/query_templates/count_reified_properties_deletions.rq

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ WHERE {
7171
# get all deleted reified structures
7272
GRAPH ?deletionsGraph {
7373
?instance ?property ?object .
74-
?object ?objProperty [] .
74+
?object ?objProperty ?value .
7575
}
7676
# ... which were not attached to some (other) instance now
7777
FILTER NOT EXISTS {
7878
GRAPH ?insertionsGraph {
7979
?instance ?property ?object .
80-
?object ?objProperty [].
80+
?object ?objProperty ?value .
8181
}
8282
}
8383
FILTER NOT EXISTS {

dqgen/resources/query_templates/property_deletions.rq

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ WHERE {
6969
}
7070
# get all deleted property values
7171
GRAPH ?deletionsGraph {
72-
?instance ?property [] .
72+
?instance ?property ?value .
7373
}
7474
# ... which were not attached to some (other) instance now
7575
FILTER NOT EXISTS {
7676
GRAPH ?insertionsGraph {
77-
?instance ?property [] .
77+
?instance ?property ?value .
7878
}
7979
}
8080
GRAPH ?oldVersionGraph {

dqgen/resources/query_templates/reified_properties_deletions.rq

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ WHERE {
7171
# get all deleted reified structures
7272
GRAPH ?deletionsGraph {
7373
?instance ?property ?object .
74-
?object ?objProperty [] .
74+
?object ?objProperty ?value .
7575
}
7676
# ... which were not attached to some (other) instance now
7777
FILTER NOT EXISTS {
7878
GRAPH ?insertionsGraph {
7979
?instance ?property ?object .
80-
?object ?objProperty [].
80+
?object ?objProperty ?value .
8181
}
8282
}
8383
FILTER NOT EXISTS {

0 commit comments

Comments
 (0)