From 54458be7f5a4524266047dd9d37ae8be332e4252 Mon Sep 17 00:00:00 2001 From: Enrico Ottonello Date: Wed, 29 Jul 2020 16:37:22 +0200 Subject: [PATCH] order in sparql insert execution is important, this query contains all sparql insert in the correct order --- .../sparql/ordered_sparql_insert_270.sparql | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/ordered_sparql_insert_270.sparql diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/ordered_sparql_insert_270.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/ordered_sparql_insert_270.sparql new file mode 100644 index 0000000..4584375 --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/ordered_sparql_insert_270.sparql @@ -0,0 +1,121 @@ +PREFIX aocat: +PREFIX skos: +PREFIX time: +PREFIX ariadneplus: +PREFIX rdf: +INSERT { + GRAPH { + ?temporal aocat:has_period ?periodO . + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . + } +} +WHERE { + ?temporal aocat:has_native_period ?native_period . + ?native_period skos:prefLabel ?native_label . + optional { + ?periodO skos:altLabel ?native_label . + ?periodO skos:inScheme . + ?periodO time:intervalStartedBy ?intervalStartedBy . + ?intervalStartedBy skos:prefLabel ?temporalFrom . + ?periodO time:intervalFinishedBy ?intervalFinishedBy . + ?intervalFinishedBy skos:prefLabel ?temporalUntil . + } +} +; +PREFIX aocat: +PREFIX skos: +PREFIX time: +PREFIX ariadneplus: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_derived_subject ?aat . + } +} +USING +USING +WHERE { + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:exactMatch ?aat . + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:broadMatch ?aat . + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:closeMatch ?aat . + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?native_subject skos:narrowMatch ?aat . + } +} +; +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +INSERT { + GRAPH { + ?collection aocat:has_ARIADNE_subject ?archeologicalResourceType . + ?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName . + } +} +WHERE { + ?collection rdf:type . + ?collection aocat:has_ARIADNE_subject ?archeologicalResourceType . + ?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName . + ?collection aocat:has_original_id "1000270" . +} +; +PREFIX aocat: +PREFIX skos: +PREFIX time: +PREFIX ariadneplus: +INSERT { + GRAPH { + ?record aocat:was_issued ?issued . + ?record aocat:was_modified ?modified . + ?record aocat:has_contributor ?contributor . + ?record aocat:has_responsible ?legalResponsible . + ?record aocat:has_owner ?owner . + ?record aocat:has_publisher ?publisher . + ?record aocat:has_access_rights ?accessRights . + ?record aocat:has_ARIADNE_subject ?archeologicalResourceType . + } +} +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:was_issued ?issued . + ?collection aocat:was_modified ?modified . + ?collection aocat:has_contributor ?contributor . + ?contributor aocat:has_name ?contributorName . + ?collection aocat:has_responsible ?legalResponsible . + ?legalResponsible aocat:has_name ?legalResponsibleName . + ?collection aocat:has_owner ?owner . + ?owner aocat:has_name ?ownerName . + ?collection aocat:has_publisher ?publisher . + ?publisher aocat:has_name ?publisherName . + ?collection aocat:has_access_rights ?accessRights . + ?collection aocat:has_ARIADNE_subject ?archeologicalResourceType . + ?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName . + optional { + ?contributor aocat:has_email ?contributorEmail . + } + optional { + ?legalResponsible aocat:has_email ?legalResponsibleEmail . + } + optional { + ?owner aocat:has_email ?ownerEmail . + } + optional { + ?publisher aocat:has_email ?publisherEmail . + } +} +; \ No newline at end of file