From cd76bbbd9eb9676c6a1fd356f92a5212c3729a3b Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Thu, 13 Apr 2023 17:53:46 +0200 Subject: [PATCH] updated enrichment queries for SEAD UMEA --- .../ordered_sparql_insert_SEAD_coll.sparql | 70 +++- .../ordered_sparql_insert_SEAD_sites.sparql | 300 +++++++++++++----- 2 files changed, 297 insertions(+), 73 deletions(-) diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql index 539f4cf..89e9348 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql @@ -1,3 +1,70 @@ +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_type . + rdf:type . + skos:prefLabel "collection" + } + } + WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_type ?t . + } + } +}; + +PREFIX aocat: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_creator . + aocat:has_name "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Collection . + MINUS { + ?s aocat:has_creator ?creator . + } + } +}; + +PREFIX aocat: +PREFIX rdfs: +INSERT { + GRAPH { + ?record aocat:was_modified "2023-04-13"^^xsd:date + } +} +USING +WHERE { + ?record rdf:type aocat:AO_Collection . + MINUS{ + ?record aocat:was_modified ?date + } +}; + +PREFIX aocat: +PREFIX rdfs: +INSERT { + GRAPH { + ?record aocat:was_issued "2023-04-13"^^xsd:date + } +} +USING +WHERE { + ?record rdf:type aocat:AO_Collection . + MINUS{ + ?record aocat:was_issued ?date + } +}; + PREFIX aocat: PREFIX rdf: PREFIX skos: @@ -27,4 +94,5 @@ INSERT { ?coll aocat:has_derived_subject ?derivedSubject . ?derivedSubject skos:prefLabel ?prefLabel . } -}; \ No newline at end of file +}; + diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql index 7eebcd2..1f604aa 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql @@ -1,9 +1,6 @@ -#inherit from the collection the publisher, contributor, owner, responsible, ARIADNEsubject, native subject, derived_subject (it is in the mapping), - #access policy and access rights - PREFIX aocat: PREFIX rdf: -PREFIX skos: +PREFIX skos: INSERT { GRAPH { ?s aocat:has_type . @@ -16,38 +13,169 @@ WHERE { } }; -PREFIX aocat: - INSERT { - GRAPH { - ?record aocat:was_issued ?x . - } - } - USING - USING - WHERE { - ?record aocat:is_part_of ?collection . - ?collection aocat:was_issued ?x . - MINUS{ - ?record aocat:was_issued ?date - } - }; - PREFIX aocat: INSERT { - GRAPH { - ?record aocat:was_modified ?x . - } + GRAPH { + ?record aocat:has_native_subject ?x . + ?x ?p ?o . + } } USING USING WHERE { - ?record aocat:is_part_of ?collection . - ?collection aocat:was_modified ?x . - MINUS{ - ?record aocat:was_modified ?date - } + ?record aocat:is_part_of ?collection . + ?collection aocat:has_native_subject ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_native_subject ?ns + } }; +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_publisher ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_publisher ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_publisher ?p + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_contributor ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_contributor ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_contributor ?p + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_owner ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_owner ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_owner ?p + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_creator ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_creator ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_creator ?p + } +}; + +PREFIX aocat: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_creator . + aocat:has_name "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_creator ?creator . + } + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_responsible ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_responsible ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_responsible ?p + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_ARIADNE_subject ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_ARIADNE_subject ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_ARIADNE_subject ?as + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_native_subject ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_native_subject ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_native_subject ?as + } +}; + + PREFIX aocat: INSERT { GRAPH { @@ -64,30 +192,53 @@ WHERE { } }; - PREFIX aocat: -PREFIX skos: -PREFIX time: +INSERT { + GRAPH { + ?record aocat:has_access_policy ?x . + ?x ?p ?o . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_access_policy ?x . + ?x ?p ?o . + MINUS{ + ?record aocat:has_access_policy ?ap + } +}; + +PREFIX aocat: INSERT { GRAPH { - ?temporal aocat:has_period ?aat . + ?temporal aocat:has_period ?nativePeriod . ?temporal aocat:from ?temporalFrom . ?temporal aocat:until ?temporalUntil . } } - USING - USING WHERE { + GRAPH { ?temporal aocat:has_native_period ?nativePeriod . - ?nativePeriod skos:prefLabel ?nativeLabel . - ?aat skos:inScheme . - ?aat skos:altLabel ?nativeLabel . - ?aat time:intervalStartedBy ?intervalStartedBy . - ?intervalStartedBy time:hasDateTimeDescription ?sdesc . - ?sdesc time:year ?temporalFrom . - ?aat time:intervalFinishedBy ?intervalFinishedBy . - ?intervalFinishedBy time:hasDateTimeDescription ?fdesc . - ?fdesc time:year ?temporalUntil + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . + } + }; + + PREFIX aocat: + PREFIX rdfs: + PREFIX skos: + INSERT { + GRAPH { + ?nativePeriod skos:prefLabel ?periodLabel . + } + } + WHERE { + GRAPH { + ?temporal aocat:has_native_period ?nativePeriod . + ?nativePeriod rdfs:label ?periodLabel . + } }; @@ -99,34 +250,39 @@ PREFIX time: ?record aocat:has_derived_subject ?aat_subject . } } -USING +USING USING WHERE { - { - ?record aocat:has_native_subject ?native_subject . - ?aat_native_subject skos:exactMatch ?aat_subject . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_native_subject) - } - union - { - ?record aocat:has_native_subject ?native_subject . - ?aat_native_subject skos:broadMatch ?aat_subject . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_native_subject) - } - union - { - ?record aocat:has_native_subject ?native_subject . - ?aat_native_subject skos:closeMatch ?aat_subject . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_native_subject) - } - union - { - ?record aocat:has_native_subject ?native_subject . - ?aat_native_subject skos:narrowMatch ?aat_subject . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_native_subject) - } - }; \ No newline at end of file + ?record aocat:is_part_of ?collection . + ?collection aocat:has_derived_subject ?x . + }; + +PREFIX aocat: +PREFIX rdfs: +INSERT { + GRAPH { + ?record aocat:was_issued "2023-04-13"^^xsd:date + } +} +USING +WHERE { + ?record rdf:type aocat:AO_Individual_Data_Resource . + MINUS{ + ?record aocat:was_issued ?date + } +}; + +PREFIX aocat: +PREFIX rdfs: +INSERT { + GRAPH { + ?record aocat:was_modified "2023-04-13"^^xsd:date + } +} +USING +WHERE { + ?record rdf:type aocat:AO_Individual_Data_Resource . + MINUS{ + ?record aocat:was_modified ?date + } +}; \ No newline at end of file