Added a cleanup query to find the triples that involve entities of type Bestuurseenheid either as subject or object, and are shared between the shared and administrative unit graphs, and then remove them from the administrative unit graph

This commit is contained in:
Panos Alexopoulos
2025-10-24 09:57:15 +02:00
parent d07c9156f5
commit 3d7d56d9da
2 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1 @@
http://mu.semte.ch/graphs/public

View File

@@ -0,0 +1,58 @@
@prefix cleanup: <http://mu.semte.ch/vocabularies/ext/cleanup/> .
@prefix mu: <http://mu.semte.ch/vocabularies/core/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
<http://data.lblod.info/id/cleanup-job/48ffd9f11-db25-430d-a66a-31fc8b393d5f> a cleanup:Job ;
mu:uuid "8ffd9f11-db25-430d-a66a-31fc8b393d5f" ;
dcterms:title "Insert missing province uris for addresses of administrative units" ;
cleanup:randomQuery """
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
DELETE {
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?s ?p ?o .
}
}
WHERE {
VALUES (?g1 ?g2) {
(<http://mu.semte.ch/graphs/shared> <http://mu.semte.ch/graphs/administrative-unit>)
}
{
# Subject is a Bestuurseenheid
GRAPH ?g1 {
?s a besluit:Bestuurseenheid ;
?p ?o .
FILTER(?p != rdf:type)
}
GRAPH ?g2 {
?s a besluit:Bestuurseenheid ;
?p ?o .
FILTER(?p != rdf:type)
}
}
UNION
{
# Object is a Bestuurseenheid
GRAPH ?g1 {
?s ?p ?o .
?o a besluit:Bestuurseenheid .
FILTER(?p != rdf:type)
}
GRAPH ?g2 {
?s ?p ?o .
?o a besluit:Bestuurseenheid .
FILTER(?p != rdf:type)
}
}
}
ORDER BY ?s ?p ?o
""" .