From 29aae31c95787a973430b395ad9a13999ff9eb4e Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Wed, 14 Dec 2022 16:38:36 +0100 Subject: [PATCH] another useful template for AAT enrichment --- .../04_insert_AAT_enrichment_template.sparql | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/04_insert_AAT_enrichment_template.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/04_insert_AAT_enrichment_template.sparql index 978c046..32ce1ce 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/04_insert_AAT_enrichment_template.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/04_insert_AAT_enrichment_template.sparql @@ -73,6 +73,52 @@ USING : } }; + #if you need to match on the skos:prefLabel, ignoring language + +PREFIX aocat: +PREFIX skos: + +INSERT { +GRAPH ::aatplus> { + ?record aocat:has_derived_subject ?aat_subject . +} +} +USING ::aat> +USING ::> +WHERE { + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:prefLabel ?nativeLabel . + ?match_subject skos:prefLabel ?matchedLabel . + ?match_subject skos:exactMatch ?aat_subject . + filter(str(?nativeLabel) = str(?matchedLabel)) + } +union + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:prefLabel ?nativeLabel . + ?match_subject skos:prefLabel ?matchedLabel . + ?match_subject skos:broadMatch ?aat_subject . + filter(str(?nativeLabel) = str(?matchedLabel)) + } +union + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:prefLabel ?nativeLabel . + ?match_subject skos:prefLabel ?matchedLabel . + ?match_subject skos:closeMatch ?aat_subject . + filter(str(?nativeLabel) = str(?matchedLabel)) + } +union + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:prefLabel ?nativeLabel . + ?match_subject skos:prefLabel ?matchedLabel . + ?match_subject skos:narrowMatch ?aat_subject . + filter(str(?nativeLabel) = str(?matchedLabel)) + } + }; + #if you need to copy triples from the data graph to the aat/aatplus graph: PREFIX aocat: PREFIX skos: