You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AriadnePlus/dnet-ariadneplus-graphdb-pu.../src/main/resources/eu/dnetlib/ariadneplus/sparql/05_insert_periodo_enrichmen...

94 lines
3.5 KiB
SPARQL

#PERIODO ENRICHMENT
# WHEN THE OLD ARIADNE PERIODO COLLECTION IS INVOLVED DO THIS FIRST TO PUT THE TRIPLES IN THE PROPER NAMED GRAPH
PREFIX dcterms: <http://purl.org/dc/terms/>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::<provider>::periodo> {
?periodO ?pred ?o .
?o ?pred2 ?o2 .
?o2 ?pred3 ?o3 .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/ariadne/periodo> {
?periodO dcterms:spatial <http://www.wikidata.org/entity/SPATIALCODE> .
?periodO ?pred ?o .
optional {
?o ?pred2 ?o2 .
optional {
?o2 ?pred3 ?o3 .
}
}
}
};
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX time: <http://www.w3.org/2006/time#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::<provider>::periodoplus> {
?temporal aocat:has_period ?periodO .
?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::<provider>::<coll>> {
?temporal aocat:has_native_period ?native_period .
?native_period skos:prefLabel ?native_label .
optional {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::<provider>::periodo> {
?periodO skos:altLabel ?native_label .
?periodO skos:inScheme <PROVIDER_PERIODO_SCHEME_URL> .
?periodO time:intervalStartedBy ?intervalStartedBy .
?intervalStartedBy skos:prefLabel ?temporalFrom .
?periodO time:intervalFinishedBy ?intervalFinishedBy .
?intervalFinishedBy skos:prefLabel ?temporalUntil .
}
}
}
};
# if there is no periodO, but you have the dates then you want to put them in the temporal index fields.
# Add from/until and native period in the periodo graphs:
<https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodoplus> :
?temporal aocat:has_period ?periodOURI .
?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil .
<https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodo>
?periodOURI skos:prefLabel ?origTemporalPeriodName .
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodoplus> {
?temporal aocat:has_period ?nativePeriod .
?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%coll> {
?temporal aocat:has_native_period ?nativePeriod .
?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil .
}
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodo> {
?nativePeriod skos:prefLabel ?periodLabel .
}
}
WHERE {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%coll> {
?temporal aocat:has_native_period ?nativePeriod .
?nativePeriod rdfs:label ?periodLabel .
}
};