From 512a731527901306be73a73982fc7e0bfc92243b Mon Sep 17 00:00:00 2001 From: Enrico Ottonello Date: Mon, 8 Feb 2021 10:21:31 +0100 Subject: [PATCH] propagation of informations from deep entities --- .../ARUP/ordered_sparql_insert_arup.sparql | 331 ++++++++++++------ 1 file changed, 233 insertions(+), 98 deletions(-) diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup.sparql index ee66b95..a7e2835 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/ARUP/ordered_sparql_insert_arup.sparql @@ -1,11 +1,11 @@ PREFIX aocat: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_temporal_coverage ?t . } } -USING +USING WHERE { ?s aocat:is_about ?about . ?about (aocat:has_time_interval | aocat:happens_at) ?t . @@ -14,11 +14,26 @@ WHERE { PREFIX aocat: PREFIX rdf: INSERT { - GRAPH { + GRAPH { + ?record aocat:has_temporal_coverage ?temporal_k . + } +} +USING +WHERE { + ?record_k aocat:happens_at ?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 { ?s aocat:has_spatial_coverage ?occursIn . } } -USING +USING WHERE { ?s aocat:is_about ?about . ?about aocat:occurs_in ?occursIn . @@ -27,11 +42,127 @@ WHERE { PREFIX aocat: PREFIX rdf: INSERT { - GRAPH { + 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 skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_issued ?created_on . + ?s aocat:was_modified ?created_on . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Collection . + ?s aocat:was_created_on ?created_on . + MINUS { + ?s rdf:type aocat:AO_Collection . + ?s aocat:was_issued ?issued . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_issued ?created_on . + ?s aocat:was_modified ?created_on . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Collection . + ?s aocat:was_created_on ?created_on . + MINUS { + ?s rdf:type aocat:AO_Collection . + ?s aocat:was_issued ?issued . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_modified ?issued . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Collection . + ?s aocat:was_issued ?issued . + MINUS { + ?s rdf:type aocat:AO_Collection . + ?s aocat:was_modified ?modified . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_issued ?created_on . + ?s aocat:was_modified ?created_on . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:was_created_on ?created_on . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:was_issued ?issued . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:was_modified ?issued . + } +} +USING +WHERE { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:was_created_on ?created_on . + ?s aocat:was_issued ?issued . + MINUS { + ?s rdf:type aocat:AO_Individual_Data_Resource . + ?s aocat:was_created_on ?created_on . + ?s aocat:was_issued ?issued . + ?s aocat:was_modified ?modified . + } +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { ?s aocat:has_description ?description . } } -USING +USING WHERE { ?s aocat:is_about ?about . ?about aocat:has_description ?description . @@ -41,7 +172,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_temporal_coverage . rdf:type . rdfs:label "Not provided" . @@ -49,7 +180,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -63,14 +194,14 @@ PREFIX rdf: PREFIX rdfs: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?s aocat:has_type . rdf:type . skos:prefLabel "collection" } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -82,12 +213,12 @@ INSERT { PREFIX aocat: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_access_rights "Not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -100,13 +231,13 @@ PREFIX aocat: PREFIX skos: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_ARIADNE_subject . skos:prefLabel "Not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -119,7 +250,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_publisher . rdf:type . rdfs:label "Not provided" . @@ -127,7 +258,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -140,7 +271,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_owner . rdf:type . rdfs:label "Not provided" . @@ -148,7 +279,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -161,7 +292,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_responsible . rdf:type . rdfs:label "Not provided" . @@ -169,7 +300,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -182,7 +313,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_contributor . rdf:type . rdfs:label "Not provided" . @@ -190,7 +321,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -202,7 +333,7 @@ WHERE { PREFIX skos: DELETE WHERE { -GRAPH { +GRAPH { skos:prefLabel ?l . } }; @@ -211,12 +342,12 @@ PREFIX aocat: PREFIX skos: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?isoLangRef skos:prefLabel "cs" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . ?s aocat:has_language ?isoLangRef . MINUS { @@ -231,13 +362,13 @@ PREFIX aocat: PREFIX skos: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_language . skos:prefLabel "und" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -250,12 +381,12 @@ PREFIX aocat: PREFIX skos: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_original_id "Original Id not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -267,12 +398,12 @@ WHERE { PREFIX aocat: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_title "Title not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -284,11 +415,11 @@ WHERE { PREFIX aocat: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_native_subject ?ns . } } -USING +USING WHERE { ?s aocat:is_about ?about . ?about aocat:has_type ?ns . @@ -299,13 +430,13 @@ PREFIX aocat: PREFIX rdf: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?s aocat:has_native_subject . skos:prefLabel "Not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -318,13 +449,13 @@ PREFIX aocat: PREFIX rdf: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?s aocat:has_language . skos:prefLabel "und" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -337,13 +468,13 @@ PREFIX aocat: PREFIX rdf: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?s aocat:has_creator . aocat:has_name "Not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -357,12 +488,12 @@ PREFIX aocat: PREFIX rdf: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?s aocat:has_title "Title not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -374,12 +505,12 @@ WHERE { PREFIX aocat: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_access_rights "Not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -392,13 +523,13 @@ PREFIX aocat: PREFIX skos: PREFIX rdf: INSERT { - GRAPH { + GRAPH { ?s aocat:has_ARIADNE_subject . skos:prefLabel "Not provided" . } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -411,7 +542,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_publisher . rdf:type . rdfs:label "Not provided" . @@ -419,7 +550,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -432,7 +563,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_owner . rdf:type . rdfs:label "Not provided" . @@ -440,7 +571,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -453,7 +584,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_responsible . rdf:type . rdfs:label "Not provided" . @@ -461,7 +592,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -474,7 +605,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_contributor . rdf:type . rdfs:label "Not provided" . @@ -482,7 +613,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -496,7 +627,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:has_spatial_coverage . rdf:type . rdfs:label "Name not provided" . @@ -504,7 +635,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -519,14 +650,14 @@ PREFIX rdf: PREFIX rdfs: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?s aocat:has_type . rdf:type . skos:prefLabel "provided record" } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -539,7 +670,7 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { + GRAPH { ?s aocat:is_part_of . rdf:type . rdfs:label "Not provided" . @@ -547,7 +678,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -562,38 +693,42 @@ PREFIX aocat: PREFIX skos: INSERT { GRAPH { - ?s aocat:has_derived_subject ?aat . + ?record aocat:has_derived_subject ?aat . } } -USING WHERE { - ?s 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 . + 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 aocat: - PREFIX time: +PREFIX skos: +PREFIX ariadneplus: +PREFIX aocat: +PREFIX time: +PREFIX dcterms: +PREFIX bibo: INSERT { GRAPH { ?temporal aocat:has_period ?periodO . @@ -602,18 +737,18 @@ WHERE { } } WHERE { - GRAPH { - ?temporal aocat:has_native_period ?native_period . - ?native_period skos:prefLabel ?native_label . - optional { - GRAPH { - ?periodO skos:altLabel ?native_label . - ?periodO skos:inScheme . - ?periodO time:intervalStartedBy ?intervalStartedBy . - ?intervalStartedBy skos:prefLabel ?temporalFrom . - ?periodO time:intervalFinishedBy ?intervalFinishedBy . - ?intervalFinishedBy skos:prefLabel ?temporalUntil . - } - } - } + 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) + } }; \ No newline at end of file