From 7f39bbf4e93312260b49a45f4cc655e8d7f552e0 Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Wed, 16 Nov 2022 17:47:43 +0100 Subject: [PATCH] clean up enrichment graphs for specific ADS collections --- ...ADS_getty_enrichment_for_collection.sparql | 44 +++++++++++++++++++ ...S_periodo_enrichment_for_collection.sparql | 34 ++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_getty_enrichment_for_collection.sparql create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_periodo_enrichment_for_collection.sparql diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_getty_enrichment_for_collection.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_getty_enrichment_for_collection.sparql new file mode 100644 index 0000000..9ae645f --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_getty_enrichment_for_collection.sparql @@ -0,0 +1,44 @@ +#First count how many triples are there +PREFIX aocat: +PREFIX ariadneplus: +PREFIX skos: +SELECT ?resource ?aat WHERE { + + GRAPH { + ?resource ?p ?o . +} + GRAPH { + ?resource aocat:has_derived_subject ?aat . + } +} + +#let's delete them from the aatplus graph for the individual records + +PREFIX aocat: +PREFIX rdf: +WITH +DELETE { + ?resource aocat:has_derived_subject ?aat . +} +USING +USING +WHERE { + ?resource rdf:type aocat:AO_Individual_Data_Resource . + ?resource aocat:has_derived_subject ?aat . +} + +#and now the collection + +PREFIX aocat: +PREFIX rdf: +WITH +DELETE { + ?resource aocat:has_derived_subject ?aat . +} +USING +USING +WHERE { + + ?resource rdf:type aocat:AO_Collection . + ?resource aocat:has_derived_subject ?aat . +} diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_periodo_enrichment_for_collection.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_periodo_enrichment_for_collection.sparql new file mode 100644 index 0000000..cb01190 --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/delete_ADS_periodo_enrichment_for_collection.sparql @@ -0,0 +1,34 @@ +#First count how many triples are there +PREFIX aocat: +PREFIX ariadneplus: +SELECT * WHERE { + + GRAPH { + ?resource aocat:has_temporal_coverage ?temporal . +} + GRAPH { + ?temporal aocat:has_period ?period . + optional {?temporal aocat:from ?temporalFrom .} + optional {?temporal aocat:until ?temporalUntil .} + + } + +} + +#let's delete them from the periodoplus graph + +PREFIX aocat: +WITH +DELETE { + ?temporal aocat:has_period ?periodOURI . + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . +} +USING +USING +WHERE { + ?resource aocat:has_temporal_coverage ?temporal . + ?temporal aocat:has_period ?periodOURI . + optional {?temporal aocat:from ?temporalFrom .} + optional {?temporal aocat:until ?temporalUntil .} +}