From a9749ffbf2c3061eabc0958ff5ed6c252a663ecf Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Fri, 9 Oct 2020 15:33:57 +0200 Subject: [PATCH] INSERT for SND zip API - preliminary --- .../SND/ordered_sparql_insert_zip.sparql | 269 ++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SND/ordered_sparql_insert_zip.sparql diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SND/ordered_sparql_insert_zip.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SND/ordered_sparql_insert_zip.sparql new file mode 100644 index 0000000..14d2bb8 --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SND/ordered_sparql_insert_zip.sparql @@ -0,0 +1,269 @@ + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?collection aocat:has_original_id ?id . + } +} +WHERE { + ?collection rdf:type . + ?collection aocat:has_landing_page ?id . +}; + + +PREFIX skos: +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_type . + rdf:type . + skos:prefLabel "Dataset Collection" + } + } + WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_type ?t . + } + } +}; + +PREFIX aocat: +PREFIX rdf: +INSERT { + GRAPH { + ?s aocat:has_ARIADNE_subject . + } +} +WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_ARIADNE_subject ?ariadneSubject . + } + } +}; +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 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 aocat: +PREFIX rdf: +PREFIX rdfs: +INSERT { + GRAPH { + ?s aocat:has_creator . + rdf:type . + rdfs:label "Not provided" . + aocat:has_name "Not provided" . + } + } + WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_creator ?agent . + } + } +}; +PREFIX skos: +PREFIX aocat: +PREFIX rdf: +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_language + } + } + WHERE { + GRAPH { + ?s rdf:type . + MINUS { + ?s rdf:type . + ?s aocat:has_language ?lang . + } + } +}; + +PREFIX aocat: +PREFIX skos: + + +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 dcterms: +INSERT { + GRAPH { + ?periodO ?pred ?o . + ?o ?pred2 ?o2 . + ?o2 ?pred3 ?o3 . + } + } + WHERE { + GRAPH { + ?periodO dcterms:spatial . + ?periodO ?pred ?o . + optional { + ?o ?pred2 ?o2 . + optional { + ?o2 ?pred3 ?o3 . + } + } + } + }; + + PREFIX skos: + PREFIX aocat: + PREFIX time: + PREFIX dcterms: + INSERT { + GRAPH { + ?temporal aocat:has_period ?periodO . + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . + } + } + WHERE { + GRAPH { + ?temporal aocat:has_native_period ?native_period . + ?native_period skos:prefLabel ?native_label . + optional { + GRAPH { + ?periodO skos:altLabel ?native_label . + ?periodO time:intervalStartedBy / time:hasDateTimeDescription / time:year ?temporalFrom . + ?periodO time:intervalFinishedBy / time:hasDateTimeDescription / time:year ?temporalUntil . + } + } + } + }; + + + + + +