diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/CARARE/ordered_sparql_insert_carare_test.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/CARARE/ordered_sparql_insert_carare_test.sparql index d7b18bf..b8dc1be 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/CARARE/ordered_sparql_insert_carare_test.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/CARARE/ordered_sparql_insert_carare_test.sparql @@ -1,13 +1,116 @@ +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: +INSERT { + GRAPH { + ?s aocat:has_creator . + rdf:type . + rdfs:label "Not provided" . + aocat:has_name "Not provided" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Collection . + MINUS { + ?s rdf:type aocat:AO_Collection . + ?s aocat:has_creator ?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_Collection . + MINUS { + ?s rdf:type aocat:AO_Collection . + ?s aocat:has_contributor ?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_Collection . + MINUS { + ?s rdf:type aocat:AO_Collection . + ?s aocat:has_responsible ?agent . + } + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX ariadneplus: + +INSERT { + GRAPH { + ?record aocat:was_issued ?created . + } +} + GRAPH { +WHERE { + ?record rdf:type aocat:AO_Collection . + ?record aocat:was_created_on ?created . + MINUS{ + ?record aocat:was_issued ?issued . + } +}; + + PREFIX aocat: PREFIX skos: INSERT { - GRAPH { +GRAPH { ?s aocat:has_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 . @@ -16,53 +119,67 @@ WHERE { } }; -PREFIX aocat: -PREFIX rdf: -PREFIX rdfs: +PREFIX aocat: +PREFIX rdf: +PREFIX skos: INSERT { - GRAPH { - ?s aocat:has_owner . - rdf:type . - rdfs:label "Not provided" . - aocat:has_name "Not provided" . +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 . - ?s aocat:has_owner ?agent . + ?s aocat:has_native_subject ?ns . } } }; + +PREFIX aocat: +PREFIX skos: +PREFIX ariadneplus: + +INSERT { + GRAPH { + ?record aocat:was_modified ?XXXX . + } +} + GRAPH { +WHERE { + ?record rdf:type aocat:AO_Individual_Data_Resource . + ?record ?XXXXXXXXX + MINUS{ + ?record aocat:was_modified ?mod . + } +}; + +PREFIX aocat: +PREFIX skos: +PREFIX ariadneplus: + +INSERT { + GRAPH { + ?record aocat:was_issued ?XXXX . + } +} + GRAPH { +WHERE { + ?record rdf:type aocat:AO_Individual_Data_Resource . + ?record ?XXXXXXXXX + MINUS{ + ?record aocat:was_issued ?mod . + } +}; + 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 { + GRAPH { ?s aocat:has_contributor . rdf:type . rdfs:label "Not provided" . @@ -70,7 +187,7 @@ INSERT { } } WHERE { - GRAPH { + GRAPH { ?s rdf:type aocat:AO_Individual_Data_Resource . MINUS { ?s rdf:type aocat:AO_Individual_Data_Resource . @@ -83,206 +200,40 @@ PREFIX aocat: PREFIX rdf: PREFIX rdfs: INSERT { - GRAPH { - ?s aocat:has_creator . + GRAPH { + ?s aocat:has_responsible . rdf:type . rdfs:label "Not provided" . 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 . - ?s aocat:has_creator ?agent . + ?s aocat:has_responsible ?agent . } } }; -PREFIX aocat: - PREFIX skos: - PREFIX ariadneplus: - - INSERT { - GRAPH { - ?record aocat:has_publisher ?p . - ?p aocat:has_name ?pname . - } - } - USING - USING - WHERE { - ?record rdf:type aocat:AO_Individual_Data_Resource . - ?record aocat:is_part_of ?coll . - ?coll aocat:has_publisher ?p . - ?p aocat:has_name ?pname . - MINUS{ - ?record rdf:type aocat:AO_Individual_Data_Resource . - ?record aocat:has_publisher ?pub . - } - }; - PREFIX aocat: PREFIX rdf: - +PREFIX rdfs: 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: -PREFIX skos: -INSERT { - GRAPH { - ?s aocat:has_native_subject . - skos:prefLabel "Not provided" . + GRAPH { + ?s aocat:has_owner . + rdf:type . + rdfs:label "Not provided" . + 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 . - ?s aocat:has_native_subject ?ns . + ?s aocat:has_owner ?agent . } } }; - -PREFIX aocat: - PREFIX skos: - PREFIX ariadneplus: - - INSERT { - GRAPH { - ?record aocat:was_modified ?coll_mod . - } - } - USING - USING - WHERE { - ?record rdf:type aocat:AO_Individual_Data_Resource . - ?record aocat:is_part_of ?coll . - ?coll aocat:was_modified ?coll_mod . - MINUS{ - ?record rdf:type aocat:AO_Individual_Data_Resource . - ?record aocat:was_modified ?modified . - } - }; - - - -PREFIX aocat: -PREFIX skos: -PREFIX ariadneplus: - -INSERT { - GRAPH { - ?record aocat:was_issued ?coll_iss . - } -} - USING - USING -WHERE { - ?record rdf:type aocat:AO_Individual_Data_Resource . - ?record aocat:is_part_of ?coll . - ?coll aocat:was_issued ?coll_iss . - MINUS{ - ?record rdf:type aocat:AO_Individual_Data_Resource . - ?record aocat:was_issued ?issued . - } -}; - -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 . - } - } - } - }; - - PREFIX aocat: - PREFIX skos: - - INSERT { - GRAPH { - ?record aocat:has_derived_subject ?aat . - } - } - USING - USING - WHERE { - { - ?record aocat:has_native_subject ?native_subject . - ?aat_subject skos:closeMatch ?aat . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/HNM/", ucase(strafter(str(?native_subject),"HNM/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_subject) - } - union - { - ?record aocat:has_native_subject ?native_subject . - ?aat_subject skos:exactMatch ?aat . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/HNM/", ucase(strafter(str(?native_subject),"HNM/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_subject) - } - union - { - ?record aocat:has_native_subject ?native_subject . - ?aat_subject skos:broadMatch ?aat . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/HNM/", ucase(strafter(str(?native_subject),"HNM/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_subject) - } - union - { - ?record aocat:has_native_subject ?native_subject . - ?aat_subject skos:narrowMatch ?aat . - bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/HNM/", ucase(strafter(str(?native_subject),"HNM/")))) as ?uppercase_native_subject) - filter(?uppercase_native_subject=?aat_subject) - } - }; \ No newline at end of file