optimized query using named graph

This commit is contained in:
Enrico Ottonello 2021-04-22 16:51:44 +02:00
parent ce8bca3a44
commit 49d698a532
1 changed files with 53 additions and 18 deletions

View File

@ -68,12 +68,8 @@ CONSTRUCT {
%record aoprop:description ?description .
%record aoprop:language ?language .
}
from <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::aat>
from <https://ariadne-infrastructure.eu/ariadneplus::%datasource::aatplus>
from <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodo>
from <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodoplus>
from <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId>
where {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
%record aocat:has_language / skos:prefLabel ?language .
%record aocat:has_original_id ?originalId .
%record aocat:is_part_of ?partOf .
@ -81,12 +77,6 @@ where {
?creator aocat:has_name ?creatorName .
%record aocat:has_title ?title .
%record aocat:has_type / skos:prefLabel ?resourceType .
%record aocat:has_native_subject ?nativeSubject .
?nativeSubject skos:prefLabel ?nativeSubjectPrefLabel .
optional {
%record aocat:has_derived_subject ?derivedSubject .
?derivedSubject skos:prefLabel ?derivedSubjectPrefLabel .
}
optional {
?creator aocat:has_email ?creatorEmail .
}
@ -99,23 +89,40 @@ where {
optional {
%record aocat:has_landing_page / rdfs:label ?landingPage .
}
optional {
}
optional {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
%record aocat:has_temporal_coverage ?temporalNative .
?temporalNative aocat:has_native_period / skos:prefLabel ?temporalNativePeriodName .
?temporalNative aocat:has_native_period ?nativeLabel .
?nativeLabel skos:prefLabel ?temporalNativePeriodName .
}
graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodoplus> {
optional {
?temporalNative aocat:from ?temporalNativeFrom .
?temporalNative aocat:until ?temporalNativeUntil .
}
}
optional {
%record aocat:has_temporal_coverage ?temporal .
?temporal aocat:has_period / skos:prefLabel ?temporalPeriodName .
optional {
}
optional {
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
%record aocat:has_temporal_coverage ?temporal .
}
graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodoplus> {
?temporal aocat:has_period ?label .
graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::periodo> {
?label skos:prefLabel ?temporalPeriodName .
}
optional {
?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil .
}
}
}
}
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
{
select *
where {
@ -146,7 +153,9 @@ where {
}
}
}
}
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
{
select *
where {
@ -170,5 +179,31 @@ where {
}
}
}
}
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
{
select *
where {
%record aocat:has_native_subject ?nativeSubject .
?nativeSubject skos:prefLabel ?nativeSubjectPrefLabel .
}
}
}
graph <https://ariadne-infrastructure.eu/ariadneplus::%datasource::aatplus> {
{
select *
where {
optional {
%record aocat:has_derived_subject ?derivedSubject .
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::aat> {
?derivedSubject skos:prefLabel ?derivedSubjectPrefLabel .
}
}
}
}
}
BIND (lang(?derivedSubjectPrefLabel) as ?aatSubjectsLang)
}