From 699a6319dc34822229399f23b2e11799f72277ea Mon Sep 17 00:00:00 2001 From: Rashif Ray Rahman Date: Sat, 29 Nov 2025 00:15:49 +0600 Subject: [PATCH] refactor(queries): remove or rename some result columns - rename Property Group to Category - rename instance to resource - rename prefLabel to label (likewise prefLabelLang to labelLang) - remove redundant actionType - remove redundant Class column (the section already names it) --- dqgen/resources/asciidoc_templates/statistics.jinja2 | 2 +- dqgen/resources/html_templates/statistics.jinja2 | 2 +- dqgen/resources/query_templates/instance_additions.rq | 4 ++-- dqgen/resources/query_templates/instance_deletions.rq | 2 +- dqgen/resources/query_templates/movement_cross_instance.rq | 7 ++++--- dqgen/resources/query_templates/movement_cross_property.rq | 2 +- dqgen/resources/query_templates/property_additions.rq | 2 +- dqgen/resources/query_templates/property_deletions.rq | 2 +- dqgen/resources/query_templates/property_value_updates.rq | 3 +-- .../query_templates/reified_movement_cross_instance.rq | 6 ++++-- .../query_templates/reified_movement_cross_property.rq | 3 +-- .../query_templates/reified_properties_additions.rq | 2 +- .../query_templates/reified_properties_deletions.rq | 2 +- .../query_templates/reified_property_value_updates.rq | 2 +- .../rdfs/dsA/test_queries/added_instance_concept.rq | 2 +- .../rdfs/dsA/test_queries/deleted_instance_concept.rq | 2 +- 16 files changed, 23 insertions(+), 22 deletions(-) diff --git a/dqgen/resources/asciidoc_templates/statistics.jinja2 b/dqgen/resources/asciidoc_templates/statistics.jinja2 index 5993789..cad7909 100644 --- a/dqgen/resources/asciidoc_templates/statistics.jinja2 +++ b/dqgen/resources/asciidoc_templates/statistics.jinja2 @@ -27,7 +27,7 @@ [cols="1,1,1,1,1,1,1", options="header"] |=== -|Property group +|Category |Property |Added |Deleted diff --git a/dqgen/resources/html_templates/statistics.jinja2 b/dqgen/resources/html_templates/statistics.jinja2 index 29fc322..2053f2e 100644 --- a/dqgen/resources/html_templates/statistics.jinja2 +++ b/dqgen/resources/html_templates/statistics.jinja2 @@ -36,7 +36,7 @@ - + diff --git a/dqgen/resources/query_templates/instance_additions.rq b/dqgen/resources/query_templates/instance_additions.rq index 919283b..1f6ef34 100644 --- a/dqgen/resources/query_templates/instance_additions.rq +++ b/dqgen/resources/query_templates/instance_additions.rq @@ -37,9 +37,9 @@ PREFIX sh: PREFIX xhv: # identify added instances {% if cls == "owl:ObjectProperty" or cls == "owl:DatatypeProperty" %} -SELECT distinct ?class ?instance ?prefLabel ?prefLabelLang ?domain ?range ?minCardinality ?maxCardinality ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?domain ?range ?minCardinality ?maxCardinality {% else %} -SELECT distinct ?class ?instance ?prefLabel ?prefLabelLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) {% endif %} WHERE { GRAPH ?versionHistoryGraph { diff --git a/dqgen/resources/query_templates/instance_deletions.rq b/dqgen/resources/query_templates/instance_deletions.rq index 7f5929d..1516f60 100644 --- a/dqgen/resources/query_templates/instance_deletions.rq +++ b/dqgen/resources/query_templates/instance_deletions.rq @@ -42,7 +42,7 @@ PREFIX xhv: # as bad practice, because they still may be referenced elsewhere. # Cosider using owl:deprecated instead) -SELECT distinct ?class ?instance ?prefLabel ?prefLabelLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/movement_cross_instance.rq b/dqgen/resources/query_templates/movement_cross_instance.rq index 295b24a..1142581 100644 --- a/dqgen/resources/query_templates/movement_cross_instance.rq +++ b/dqgen/resources/query_templates/movement_cross_instance.rq @@ -27,9 +27,10 @@ PREFIX xsd: PREFIX shacl: # Show all movements cross instances -SELECT DISTINCT ?oldInstance ?class ?oldInstancePrefLabel ?oldInstancePrefLabelLang ?newInstance - ?newInstancePrefLabel - ?newInstancePrefLabelLang ?property ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT + (?oldInstance AS ?oldResource) (?oldInstancePrefLabel AS ?oldResourceLabel) (?oldInstancePrefLabelLang AS ?oldResourceLabelLang) + (?newInstance AS ?newResource) (?newInstancePrefLabel AS ?newResourceLabel) (?newInstancePrefLabelLang AS ?newResourceLabelLang) + ?property ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/movement_cross_property.rq b/dqgen/resources/query_templates/movement_cross_property.rq index 0cb0d6f..b0bc6b3 100644 --- a/dqgen/resources/query_templates/movement_cross_property.rq +++ b/dqgen/resources/query_templates/movement_cross_property.rq @@ -27,7 +27,7 @@ PREFIX xsd: PREFIX shacl: # Show all movements cross property -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?oldProperty ?newProperty ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?oldProperty ?newProperty ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/property_additions.rq b/dqgen/resources/query_templates/property_additions.rq index 42eaa97..dcd443c 100644 --- a/dqgen/resources/query_templates/property_additions.rq +++ b/dqgen/resources/query_templates/property_additions.rq @@ -37,7 +37,7 @@ PREFIX sh: PREFIX xhv: # Show all added instance/property -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?property ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?property ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/property_deletions.rq b/dqgen/resources/query_templates/property_deletions.rq index c804f9e..0acdd92 100644 --- a/dqgen/resources/query_templates/property_deletions.rq +++ b/dqgen/resources/query_templates/property_deletions.rq @@ -36,7 +36,7 @@ PREFIX sd: PREFIX sh: PREFIX xhv: # Show all deleted instance/property -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?property ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?property ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/property_value_updates.rq b/dqgen/resources/query_templates/property_value_updates.rq index 9ba59ae..a3202dc 100644 --- a/dqgen/resources/query_templates/property_value_updates.rq +++ b/dqgen/resources/query_templates/property_value_updates.rq @@ -37,8 +37,7 @@ PREFIX sh: PREFIX xhv: # Show all properties value updates -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?property ?oldValue ?oldValueLang ?newValue ?newValueLang - ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?property ?oldValue ?oldValueLang ?newValue ?newValueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/reified_movement_cross_instance.rq b/dqgen/resources/query_templates/reified_movement_cross_instance.rq index c23a443..2e4f932 100644 --- a/dqgen/resources/query_templates/reified_movement_cross_instance.rq +++ b/dqgen/resources/query_templates/reified_movement_cross_instance.rq @@ -37,8 +37,10 @@ PREFIX sh: PREFIX xhv: # Show all movements cross instance for reified structures -SELECT DISTINCT ?oldInstance ?class ?oldInstancePrefLabel ?oldInstancePrefLabelLang ?newInstance ?newInstancePrefLabel - ?newInstancePrefLabelLang ?property ?object ?objProperty ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT + (?oldInstance AS ?oldResource) (?oldInstancePrefLabel AS ?oldResourceLabel) (?oldInstancePrefLabelLang AS ?oldResourceLabelLang) + (?newInstance AS ?newResource) (?newInstancePrefLabel AS ?newResourceLabel) (?newInstancePrefLabelLang AS ?newResourceLabelLang) + ?property ?object ?objProperty ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/reified_movement_cross_property.rq b/dqgen/resources/query_templates/reified_movement_cross_property.rq index f4b779f..3591a7d 100644 --- a/dqgen/resources/query_templates/reified_movement_cross_property.rq +++ b/dqgen/resources/query_templates/reified_movement_cross_property.rq @@ -37,8 +37,7 @@ PREFIX sh: PREFIX xhv: # Show all movements cross reified properties -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?oldProperty ?oldObject ?newProperty ?newObject ?objProperty - ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?oldProperty ?oldObject ?newProperty ?newObject ?objProperty ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/reified_properties_additions.rq b/dqgen/resources/query_templates/reified_properties_additions.rq index 2302a2b..0692500 100644 --- a/dqgen/resources/query_templates/reified_properties_additions.rq +++ b/dqgen/resources/query_templates/reified_properties_additions.rq @@ -37,7 +37,7 @@ PREFIX sh: PREFIX xhv: # Show all added reified structures -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?property ?object ?objProperty ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?property ?object ?objProperty ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/reified_properties_deletions.rq b/dqgen/resources/query_templates/reified_properties_deletions.rq index 5bc6f00..d49575a 100644 --- a/dqgen/resources/query_templates/reified_properties_deletions.rq +++ b/dqgen/resources/query_templates/reified_properties_deletions.rq @@ -36,7 +36,7 @@ PREFIX sd: PREFIX sh: PREFIX xhv: # Show all deleted reified structures -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?property ?object ?objProperty ?value ?valueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?property ?object ?objProperty ?value ?valueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/dqgen/resources/query_templates/reified_property_value_updates.rq b/dqgen/resources/query_templates/reified_property_value_updates.rq index d90f224..cb4713c 100644 --- a/dqgen/resources/query_templates/reified_property_value_updates.rq +++ b/dqgen/resources/query_templates/reified_property_value_updates.rq @@ -37,7 +37,7 @@ PREFIX sh: PREFIX xhv: # Show reified structures updated values -SELECT DISTINCT ?instance ?class ?prefLabel ?prefLabelLang ?property ?object ?objProperty ?oldValue ?oldValueLang ?newValue ?newValueLang ("{{type_of_action}}" as ?actionType) +SELECT DISTINCT (?instance AS ?resource) (?prefLabel as ?label) (?prefLabelLang AS ?labelLang) ?property ?object ?objProperty ?oldValue ?oldValueLang ?newValue ?newValueLang WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/tests/test_data/rdfs/dsA/test_queries/added_instance_concept.rq b/tests/test_data/rdfs/dsA/test_queries/added_instance_concept.rq index 9479f8c..d3529b1 100644 --- a/tests/test_data/rdfs/dsA/test_queries/added_instance_concept.rq +++ b/tests/test_data/rdfs/dsA/test_queries/added_instance_concept.rq @@ -36,7 +36,7 @@ PREFIX xhv: # # identify added instances # -SELECT distinct ?class (?instance AS ?addedInstance) (?prefLabel AS ?addedInstanceLabel) +SELECT distinct (?instance AS ?addedInstance) (?prefLabel AS ?addedInstanceLabel) WHERE { GRAPH ?versionHistoryGraph { # parameters diff --git a/tests/test_data/rdfs/dsA/test_queries/deleted_instance_concept.rq b/tests/test_data/rdfs/dsA/test_queries/deleted_instance_concept.rq index 6df3c19..5bafa2f 100644 --- a/tests/test_data/rdfs/dsA/test_queries/deleted_instance_concept.rq +++ b/tests/test_data/rdfs/dsA/test_queries/deleted_instance_concept.rq @@ -40,7 +40,7 @@ PREFIX xhv: # as bad practice, because they still may be referenced elsewhere. # Cosider using owl:deprecated instead) # -SELECT distinct ?class (?instance AS ?deletedInstance) (?prefLabel AS ?deletedInstanceLabel) +SELECT distinct (?instance AS ?deletedInstance) (?prefLabel AS ?deletedInstanceLabel) WHERE { GRAPH ?versionHistoryGraph { # parameters
Property groupCategory Property Added Deleted