From a9369c243bd3e1263f24b5bd3c2105b1a2a4c5e2 Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Thu, 20 Oct 2022 10:41:45 +0200 Subject: [PATCH] enrich query to test improved 3M mappings for ARUP AMCR --- .../ordered_sparql_insert_arup-TEST.sparql | 954 ++++++++++++++++++ 1 file changed, 954 insertions(+) create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup-TEST.sparql diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup-TEST.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup-TEST.sparql new file mode 100644 index 0000000..85db177 --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup-TEST.sparql @@ -0,0 +1,954 @@ +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_temporal_coverage ?t . + } +} +USING +WHERE { + ?s aocat:is_about ?about . + ?about aocat:has_time_interval ?t . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_temporal_coverage ?temporal_k . + } +} +USING +WHERE { + ?record_k aocat:happens_during ?temporal_k . + ?record_k aocat:occurs_in ?region. + ?region aocat:is_spatial_region_of ?event . + ?record aocat:is_about ?event . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_temporal_coverage ?temporal_k . + } +} +USING +WHERE { + ?record_k aocat:happens_during ?temporal_k . + ?record_k aocat:occurs_in ?region. + ?region aocat:is_space_region_of ?site . + ?record aocat:is_about ?site . +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX crm: +INSERT { + GRAPH { + ?record aocat:has_temporal_coverage ?activity_t . + } +} +USING +WHERE { + ?activity aocat:happens_during ?activity_t . + ?activity aocat:is_subject_of ?document_part . + ?document_part crm:P148i_is_component_of ?document . + ?record aocat:is_about ?document . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_spatial_coverage ?occursIn . + } +} +USING +WHERE { + ?s aocat:is_about ?about . + ?about aocat:occurs_in ?occursIn . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_spatial_coverage ?spatial . + } +} +USING +WHERE { + ?region aocat:is_spatial_region_of ?event . + ?region aocat:is_subject_of ?spatial_ref . + ?spatial_ref aocat:has_spatial_coverage ?spatial . + ?record aocat:is_about ?event . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_spatial_coverage ?spatial . + } +} +USING +WHERE { + ?region aocat:is_subject_of ?spatial_ref . + ?spatial_ref aocat:has_spatial_coverage ?spatial . + ?region aocat:is_space_region_of ?site . + ?record aocat:is_about ?site . +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_issued ?created_on . + } +} +USING +WHERE { + ?s aocat:was_created_on ?created_on . + MINUS { + ?s aocat:was_issued ?issued . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_modified ?created_on . + + } +} +USING +WHERE { + ?s aocat:was_created_on ?created_on . + MINUS { + ?s aocat:was_modified ?modified . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_issued ?issued . + } +} +USING +USING +WHERE { + ?c rdf:type aocat:AO_Collection . + ?s aocat:is_part_of ?c . + ?c aocat:was_issued ?issued . + MINUS { + ?s aocat:was_issued ?x . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_modified ?issued . + } +} +USING +USING +WHERE { + ?c rdf:type aocat:AO_Collection . + ?s aocat:is_part_of ?c . + ?c aocat:was_modified ?issued . + MINUS { + ?s aocat:was_modified ?x . + } +}; + + + + + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_description ?description . + } +} +USING +WHERE { + ?s aocat:is_about ?about . + ?about aocat:has_description ?description . +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_temporal_coverage . + rdf:type . + rdfs:label "Not provided" . + + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_temporal_coverage ?tc . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +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 rdf: +INSERT { + GRAPH { + ?s aocat:has_access_rights "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_access_rights ?ar . + } + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_ARIADNE_subject . + skos:prefLabel "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_ARIADNE_subject ?ariadneSubject . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_publisher . + rdf:type . + rdfs:label "Not provided" . + aocat:has_name "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_publisher ?agent . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_owner . + rdf:type . + rdfs:label "Not provided" . + aocat:has_name "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_owner ?agent . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_responsible . + rdf:type . + rdfs:label "Not provided" . + aocat:has_name "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_responsible ?agent . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_contributor . + rdf:type . + rdfs:label "Not provided" . + aocat:has_name "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_contributor ?agent . + } + } +}; + +PREFIX skos: +DELETE +WHERE { +GRAPH { + skos:prefLabel ?l . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +INSERT { + GRAPH { + ?isoLangRef skos:prefLabel "cs" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_language ?isoLangRef . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_language ?isoLangRef . + ?isoLangRef skos:prefLabel ?p . + } + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_language . + skos:prefLabel "und" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_language ?ns . + } + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_original_id "Original Id not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_original_id ?id . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_title "Title not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_title ?title . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_native_subject ?ns . + } +} +USING +WHERE { + ?s aocat:is_about ?about . + ?about aocat:has_type ?ns . + ?ns rdf:type aocat:AO_Concept . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_native_subject ?ns . + } +} +USING +WHERE { + ?record_k aocat:has_type ?ns . + ?ns rdf:type aocat:AO_Concept . + ?record_k aocat:occurs_in ?region. + ?region aocat:is_space_region_of | aocat:is_spatial_region_of ?event . + ?record aocat:is_about ?event . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_native_subject ?ns . + } +} +USING +WHERE { + ?record_k aocat:has_type ?ns . + ?ns rdf:type aocat:AO_Concept . + ?record_k aocat:occurs_in ?region. + ?region aocat:is_space_region_of ?site . + ?record aocat:is_about ?site . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_native_subject ?ns . + } +} +USING +WHERE { + ?record_k aocat:occured_in_the_presence_of ?activityArea . + ?activityArea aocat:has_type ?ns . + ?ns rdf:type aocat:AO_Concept . + ?record_k aocat:occurs_in ?region. + ?region aocat:is_space_region_of ?site . + ?record aocat:is_about ?site . +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX crm: +INSERT { + GRAPH { + ?record aocat:has_native_subject ?ns . + } +} +USING +WHERE { + ?activity aocat:has_type ?ns . + ?activity aocat:is_subject_of ?document_part . + ?document_part crm:P148i_is_component_of ?document . + ?record aocat:is_about ?document . +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?record aocat:has_creator ?creator . + } +} +USING +WHERE { + ?record aocat:is_about ?about . + ?about rdf:type aocat:AO_Document . + ?about aocat:has_creator ?creator . +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_native_subject . + skos:prefLabel "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_native_subject ?ns . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_language . + skos:prefLabel "und" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_language ?ns . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +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: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_title "Title not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_title ?title . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_access_rights "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_access_rights ?ar . + } + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_ARIADNE_subject . + skos:prefLabel "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_ARIADNE_subject ?ariadneSubject . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_publisher . + rdf:type . + rdfs:label "Not provided" . + 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_publisher ?agent . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_owner . + rdf:type . + rdfs:label "Not provided" . + 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_owner ?agent . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_responsible . + rdf:type . + rdfs:label "Not provided" . + 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_responsible ?agent . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_contributor . + rdf:type . + rdfs:label "Not provided" . + 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_contributor ?agent . + } + } +}; + + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_spatial_coverage . + rdf:type . + rdfs:label "Name not provided" . + aocat:has_place_name "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_spatial_coverage ?spatialRegion . + ?spatialRegion aocat:has_place_name ?placeName . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_type . + rdf:type . + skos:prefLabel "provided record" + } + } + WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:has_type ?t . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:is_part_of . + rdf:type . + rdfs:label "Not provided" . + 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:is_part_of ?coll . + } + } +}; + +PREFIX aocat: +PREFIX skos: +INSERT { + GRAPH { + ?s owl:sameAs ?patched_ns . + } +} +WHERE { + GRAPH { + ?s owl:sameAs ?ns . + } + bind(iri(replace(str(?ns),"AMCR","AIS%20CR")) as ?patched_ns) +}; + +PREFIX aocat: +PREFIX skos: +INSERT { + GRAPH { + ?concept owl:sameAs ?patched_ns_aat . + } +} +WHERE { + GRAPH { + ?concept owl:sameAs ?ns_aat . + } + bind(IRI(replace(str(?ns_aat),'%2F','/')) as ?patched_ns_aat) + filter(contains(str(?ns_aat),'%2F')) +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX rdfs: +PREFIX owl: +PREFIX skos: +delete { + GRAPH { + ?concept owl:sameAs ?ns_aat . + } +} +where { + GRAPH { + ?concept owl:sameAs ?ns_aat . + } + filter(contains(str(?ns_aat),'%2F')) +}; + +PREFIX aocat: +PREFIX skos: +INSERT { + GRAPH { + ?record aocat:has_derived_subject ?aat . + } +} +WHERE { + GRAPH { + ?record aocat:has_native_subject ?ns. + GRAPH { + { + ?SUB owl:sameAs ?ns . + ?SUB skos:closeMatch ?aat . + } + union + { + ?SUB owl:sameAs ?ns . + ?SUB skos:exactMatch ?aat . + } + union + { + ?SUB owl:sameAs ?ns . + ?SUB skos:narrowMatch ?aat . + } + union + { + ?SUB owl:sameAs ?ns . + ?SUB skos:broadMatch ?aat . + } + } + } +}; + +PREFIX skos: +PREFIX ariadneplus: +PREFIX aocat: +PREFIX time: +PREFIX dcterms: +PREFIX bibo: + INSERT { + GRAPH { + ?temporal aocat:has_period ?periodO . + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . + } + } + WHERE { + optional { + ?periodO_source bibo:locator ?periodO_source_label_str . + ?periodO dcterms:source ?periodO_source . + ?periodO skos:inScheme . + ?periodO time:intervalStartedBy ?intervalStartedBy . + ?intervalStartedBy skos:prefLabel ?temporalFrom . + ?periodO time:intervalFinishedBy ?intervalFinishedBy . + ?intervalFinishedBy skos:prefLabel ?temporalUntil . + } + GRAPH { + ?temporal aocat:has_native_period ?native_period . + ?native_period skos:prefLabel ?periodO_source_label . + bind (str(?periodO_source_label) as ?periodO_source_label_str) + } + }; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_issued "0000-01-01"^^xsd:date . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s aocat:was_issued ?issued . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_modified "0000-01-01"^^xsd:date . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Individual_Data_Resource . + MINUS { + ?s aocat:was_modified ?issued . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_original_id ?label . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s rdfs:label ?label . + MINUS { + ?s aocat:has_original_id ?x + } +}; +