AriadnePlus/dnet-ariadneplus-graphdb-pu.../src/main/resources/eu/dnetlib/ariadneplus/sparql/enrich/OEAW/ordered_sparql_insert_colle...

78 lines
3.1 KiB
SPARQL

PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::arche::oai> {
?s aocat:has_type <https://ariadne-infrastructure.eu/aocat/Concept/AO_Type/collection> .
<https://ariadne-infrastructure.eu/aocat/Concept/AO_Type/collection> rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Concept> .
<https://ariadne-infrastructure.eu/aocat/Concept/AO_Type/collection> skos:prefLabel "collection"
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::arche::oai> {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
MINUS {
?s rdf:type <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/AO_Collection> .
?s aocat:has_type ?t .
}
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
DELETE WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::arche::oai> {
?x aocat:from "" .
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
DELETE WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::arche::oai> {
?x aocat:until "" .
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX ariadneplus: <https://ariadne-infrastructure.eu/aocat/>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::arche::aatplus> {
?record aocat:has_derived_subject ?aat .
}
}
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::arche::aat>
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::arche::oai>
WHERE {
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:prefLabel ?native_label .
?match skos:prefLabel ?matchLabel .
?match skos:exactMatch ?aat .
FILTER(str(?matchLabel) = ?native_label)
}
union
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:prefLabel ?native_label .
?match skos:prefLabel ?matchLabel .
?match skos:broadMatch ?aat .
FILTER(str(?matchLabel) = ?native_label)
}
union
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:prefLabel ?native_label .
?match skos:prefLabel ?matchLabel .
?match skos:closeMatch ?aat .
FILTER(str(?matchLabel) = ?native_label)
}
union
{
?record aocat:has_native_subject ?native_subject .
?native_subject skos:prefLabel ?native_label .
?match skos:prefLabel ?matchLabel .
?match skos:narrowMatch ?aat .
FILTER(str(?matchLabel) = ?native_label)
}
};