From 38e1ca98903b7260867db1e7b67945683ab6093a Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Wed, 25 Oct 2023 11:57:00 +0300 Subject: [PATCH] Make update queries somewhat faster --- .../relegate-updated-labels-to-candidate-status.ru | 2 +- src/sparql/rm-original-translation.ru | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/sparql/relegate-updated-labels-to-candidate-status.ru b/src/sparql/relegate-updated-labels-to-candidate-status.ru index 749d19c1..08e2ce79 100644 --- a/src/sparql/relegate-updated-labels-to-candidate-status.ru +++ b/src/sparql/relegate-updated-labels-to-candidate-status.ru @@ -17,7 +17,7 @@ INSERT { #SELECT ?term ?property ?translation_lang WHERE { - VALUES ?property { rdfs:label definition: exact_synonym: } + VALUES ?property { rdfs:label definition: } ?term ?property ?value . ?ax a owl:Axiom ; diff --git a/src/sparql/rm-original-translation.ru b/src/sparql/rm-original-translation.ru index f3dd06ff..5157284c 100644 --- a/src/sparql/rm-original-translation.ru +++ b/src/sparql/rm-original-translation.ru @@ -2,6 +2,7 @@ PREFIX owl: PREFIX rdf: PREFIX rdfs: PREFIX babelon: +PREFIX definition: DELETE { ?term ?property ?value . @@ -9,24 +10,15 @@ DELETE { #SELECT ?term ?property ?translation_lang WHERE { + VALUES ?property { rdfs:label definition: } ?term ?property ?value . ?ax a owl:Axiom ; owl:annotatedProperty ?property ; owl:annotatedSource ?term ; owl:annotatedTarget ?translation ; - babelon:source_language ?source_language ; - babelon:source_value ?source_value ; - babelon:translation_language ?language_tag . + babelon:source_value ?source_value . - OPTIONAL { - ?ax babelon:translation_status ?translation_status . - } - - OPTIONAL { - ?term ?property ?translation . - } - FILTER(str(?value)=str(?source_value)) FILTER(str(?value)!=str(?translation)) }