From a86f13114387b1746ff153f992d356a9123a4c27 Mon Sep 17 00:00:00 2001 From: Alessia Bardi Date: Mon, 3 Apr 2023 16:16:45 +0200 Subject: [PATCH] queries for Oslo and UMEA/SEAD --- .../ordered_sparql_insert_OSLO_coll.sparql | 69 +++++---- .../ordered_sparql_insert_OSLO_museum.sparql | 129 +++++++++++++++++ .../ordered_sparql_insert_OSLO_test.sparql | 129 +++++++++++++++++ .../ordered_sparql_insert_SEAD_coll.sparql | 30 ++++ .../ordered_sparql_insert_SEAD_sites.sparql | 132 ++++++++++++++++++ 5 files changed, 452 insertions(+), 37 deletions(-) create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_museum.sparql create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_test.sparql create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_coll.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_coll.sparql index 41ae7bc..7f765df 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_coll.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_coll.sparql @@ -2,14 +2,14 @@ PREFIX aocat: PREFIX rdf: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?s aocat:has_type . rdf:type . skos:prefLabel "collection" } } WHERE { - GRAPH { + GRAPH { ?s rdf:type . MINUS { ?s rdf:type . @@ -20,14 +20,14 @@ INSERT { PREFIX aocat: INSERT { - GRAPH { + GRAPH { ?temporal aocat:has_period ?nativePeriod . ?temporal aocat:from ?temporalFrom . ?temporal aocat:until ?temporalUntil . } } WHERE { - GRAPH { + GRAPH { ?temporal aocat:has_native_period ?nativePeriod . ?temporal aocat:from ?temporalFrom . ?temporal aocat:until ?temporalUntil . @@ -38,45 +38,40 @@ PREFIX aocat: PREFIX rdfs: PREFIX skos: INSERT { - GRAPH { + GRAPH { ?nativePeriod skos:prefLabel ?periodLabel . } } WHERE { - GRAPH { + GRAPH { ?temporal aocat:has_native_period ?nativePeriod . - ?nativePeriod rdfs:label ?periodLabel . + ?nativePeriod skos:prefLabel ?periodLabel . } }; - PREFIX aocat: - PREFIX skos: - PREFIX rdf: - INSERT { - GRAPH { - ?record aocat:has_derived_subject ?aat . - } +PREFIX aocat: +PREFIX skos: +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 . - } - }; \ No newline at end of file +} +USING +WHERE { + ?record aocat:has_derived_subject ?aat . +}; + +PREFIX aocat: +PREFIX skos: +PREFIX rdf: +INSERT { + GRAPH { + ?aat skos:prefLabel ?prefLabel . + } +} +USING +WHERE { + ?record aocat:has_derived_subject ?aat . + ?aat skos:prefLabel ?prefLabel . +}; \ No newline at end of file diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_museum.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_museum.sparql new file mode 100644 index 0000000..baebea4 --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_museum.sparql @@ -0,0 +1,129 @@ +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_type . + skos:prefLabel "provided record" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + } +}; + +PREFIX aocat: + INSERT { + GRAPH { + ?record aocat:was_issued ?x . + } + } + USING + USING + WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:was_issued ?x . + MINUS{ + ?record aocat:was_issued ?date + } + }; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:was_modified ?x . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:was_modified ?x . + MINUS{ + ?record aocat:was_modified ?date + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_access_rights ?x . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_access_rights ?x . + MINUS{ + ?record aocat:has_access_rights ?ar + } +}; + + +PREFIX aocat: +PREFIX skos: +PREFIX time: + INSERT { + GRAPH { + ?temporal aocat:has_period ?aat . + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . + } + } + USING + USING + WHERE { + ?temporal aocat:has_native_period ?nativePeriod . + ?nativePeriod skos:prefLabel ?nativeLabel . + ?aat skos:inScheme . + ?aat skos:altLabel ?nativeLabel . + ?aat time:intervalStartedBy ?intervalStartedBy . + ?intervalStartedBy time:hasDateTimeDescription ?sdesc . + ?sdesc time:year ?temporalFrom . + ?aat time:intervalFinishedBy ?intervalFinishedBy . + ?intervalFinishedBy time:hasDateTimeDescription ?fdesc . + ?fdesc time:year ?temporalUntil + }; + + + PREFIX aocat: + PREFIX skos: + + INSERT { + GRAPH { + ?record aocat:has_derived_subject ?aat_subject . + } + } +USING +USING + WHERE { + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:exactMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:broadMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:closeMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:narrowMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + }; \ No newline at end of file diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_test.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_test.sparql new file mode 100644 index 0000000..1c8aaba --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OSLO/ordered_sparql_insert_OSLO_test.sparql @@ -0,0 +1,129 @@ +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_type . + skos:prefLabel "provided record" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + } +}; + +PREFIX aocat: + INSERT { + GRAPH { + ?record aocat:was_issued ?x . + } + } + USING + USING + WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:was_issued ?x . + MINUS{ + ?record aocat:was_issued ?date + } + }; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:was_modified ?x . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:was_modified ?x . + MINUS{ + ?record aocat:was_modified ?date + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_access_rights ?x . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_access_rights ?x . + MINUS{ + ?record aocat:has_access_rights ?ar + } +}; + + +PREFIX aocat: +PREFIX skos: +PREFIX time: + INSERT { + GRAPH { + ?temporal aocat:has_period ?aat . + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . + } + } + USING + USING + WHERE { + ?temporal aocat:has_native_period ?nativePeriod . + ?nativePeriod skos:prefLabel ?nativeLabel . + ?aat skos:inScheme . + ?aat skos:altLabel ?nativeLabel . + ?aat time:intervalStartedBy ?intervalStartedBy . + ?intervalStartedBy time:hasDateTimeDescription ?sdesc . + ?sdesc time:year ?temporalFrom . + ?aat time:intervalFinishedBy ?intervalFinishedBy . + ?intervalFinishedBy time:hasDateTimeDescription ?fdesc . + ?fdesc time:year ?temporalUntil + }; + + + PREFIX aocat: + PREFIX skos: + + INSERT { + GRAPH { + ?record aocat:has_derived_subject ?aat_subject . + } + } +USING +USING + WHERE { + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:exactMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:broadMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:closeMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:narrowMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/OSLO/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + }; \ No newline at end of file diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql new file mode 100644 index 0000000..539f4cf --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_coll.sparql @@ -0,0 +1,30 @@ +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?coll aocat:has_derived_subject ?derivedSubject . + } + } + WHERE { + GRAPH { + ?coll rdf:type . + ?coll aocat:has_derived_subject ?derivedSubject . + } +}; + +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?derivedSubject skos:prefLabel ?prefLabel . + } + } + WHERE { + GRAPH { + ?coll rdf:type . + ?coll aocat:has_derived_subject ?derivedSubject . + ?derivedSubject skos:prefLabel ?prefLabel . + } +}; \ No newline at end of file diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql new file mode 100644 index 0000000..7eebcd2 --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/SEAD-UMEA/ordered_sparql_insert_SEAD_sites.sparql @@ -0,0 +1,132 @@ +#inherit from the collection the publisher, contributor, owner, responsible, ARIADNEsubject, native subject, derived_subject (it is in the mapping), + #access policy and access rights + +PREFIX aocat: +PREFIX rdf: +PREFIX skos: +INSERT { + GRAPH { + ?s aocat:has_type . + skos:prefLabel "provided record" . + } +} +WHERE { + GRAPH { + ?s rdf:type aocat:AO_Individual_Data_Resource . + } +}; + +PREFIX aocat: + INSERT { + GRAPH { + ?record aocat:was_issued ?x . + } + } + USING + USING + WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:was_issued ?x . + MINUS{ + ?record aocat:was_issued ?date + } + }; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:was_modified ?x . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:was_modified ?x . + MINUS{ + ?record aocat:was_modified ?date + } +}; + +PREFIX aocat: +INSERT { + GRAPH { + ?record aocat:has_access_rights ?x . + } +} +USING +USING +WHERE { + ?record aocat:is_part_of ?collection . + ?collection aocat:has_access_rights ?x . + MINUS{ + ?record aocat:has_access_rights ?ar + } +}; + + +PREFIX aocat: +PREFIX skos: +PREFIX time: + INSERT { + GRAPH { + ?temporal aocat:has_period ?aat . + ?temporal aocat:from ?temporalFrom . + ?temporal aocat:until ?temporalUntil . + } + } + USING + USING + WHERE { + ?temporal aocat:has_native_period ?nativePeriod . + ?nativePeriod skos:prefLabel ?nativeLabel . + ?aat skos:inScheme . + ?aat skos:altLabel ?nativeLabel . + ?aat time:intervalStartedBy ?intervalStartedBy . + ?intervalStartedBy time:hasDateTimeDescription ?sdesc . + ?sdesc time:year ?temporalFrom . + ?aat time:intervalFinishedBy ?intervalFinishedBy . + ?intervalFinishedBy time:hasDateTimeDescription ?fdesc . + ?fdesc time:year ?temporalUntil + }; + + + PREFIX aocat: + PREFIX skos: + + INSERT { + GRAPH { + ?record aocat:has_derived_subject ?aat_subject . + } + } +USING +USING + WHERE { + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:exactMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:broadMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:closeMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + union + { + ?record aocat:has_native_subject ?native_subject . + ?aat_native_subject skos:narrowMatch ?aat_subject . + bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept/sead/", ucase(strafter(str(?native_subject),"UO/")))) as ?uppercase_native_subject) + filter(?uppercase_native_subject=?aat_native_subject) + } + }; \ No newline at end of file