From b4208f0d0a25a46b114eacd457f5cb6e57c9e38c Mon Sep 17 00:00:00 2001 From: Oscar Rodriguez Villalobos Date: Thu, 21 Dec 2023 15:42:44 +0100 Subject: [PATCH 1/3] Fix duplicate lang strings --- ...31221132600-fix-duplicate-lang-strings.sparql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql diff --git a/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql b/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql new file mode 100644 index 0000000..3634f8c --- /dev/null +++ b/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql @@ -0,0 +1,16 @@ +DELETE +{ + GRAPH ?g { + ?s ?p ?oLang. + } +} +WHERE { + GRAPH ?g { + ?s ?p ?oLang. + ?a ?b ?o . + } + + BIND(LANG(?oLang) as ?lang) + FILTER(STRLEN(STR(?lang)) > 0) + FILTER(STR(?oLang) = ?o) +} \ No newline at end of file From 8573d7bd1449eb8a7e275cba5d84ec98e8a06d6d Mon Sep 17 00:00:00 2001 From: Oscar Rodriguez Villalobos Date: Wed, 17 Jan 2024 15:14:55 +0100 Subject: [PATCH 2/3] make predicate also match --- .../2023/20231221132600-fix-duplicate-lang-strings.sparql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql b/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql index 3634f8c..949ecef 100644 --- a/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql +++ b/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql @@ -7,7 +7,7 @@ DELETE WHERE { GRAPH ?g { ?s ?p ?oLang. - ?a ?b ?o . + ?a ?p ?o . } BIND(LANG(?oLang) as ?lang) From 6d47523e155f8908ea99fc13847a8192d7531599 Mon Sep 17 00:00:00 2001 From: Oscar Rodriguez Villalobos Date: Fri, 19 Jan 2024 12:55:46 +0100 Subject: [PATCH 3/3] make also subject match --- .../2023/20231221132600-fix-duplicate-lang-strings.sparql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql b/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql index 949ecef..95088fa 100644 --- a/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql +++ b/config/migrations/2023/20231221132600-fix-duplicate-lang-strings.sparql @@ -7,7 +7,7 @@ DELETE WHERE { GRAPH ?g { ?s ?p ?oLang. - ?a ?p ?o . + ?s ?p ?o . } BIND(LANG(?oLang) as ?lang)