all not madatory sets of conditions must be set as optional

This commit is contained in:
Enrico Ottonello 2020-03-16 19:16:42 +01:00
parent 5c3d50f309
commit 32b91c277d
1 changed files with 55 additions and 108 deletions

View File

@ -1,4 +1,3 @@
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#>
@ -12,7 +11,7 @@ CONSTRUCT {
?record aoprop:originalId ?originalId .
?record aoprop:issued ?issued .
?record aoprop:modified ?modified .
?record aoprop:partOf ?collection .
?record aoprop:partOf ?partOf .
?record aoprop:creator ?creator .
?creator aoprop:name ?creatorName .
?creator aoprop:email ?creatorEmail .
@ -58,76 +57,50 @@ CONSTRUCT {
?record aoprop:description ?description .
?record aoprop:language ?language .
}
from <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::aat>
from <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::271>
from <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::273>
where {
?record aocat:has_language / skos:prefLabel ?language .
?record aocat:has_original_id ?originalId .
?record aocat:is_part_of ?partOf .
?record aocat:has_creator ?creator .
?creator aocat:has_name ?creatorName .
?record aocat:has_title ?title .
optional {
{
?record aocat:has_native_subject ?nativeSubject .
?creator aocat:has_email ?creatorEmail .
}
optional {
?collection aocat:has_type / skos:prefLabel ?type .
}
optional {
?record aocat:has_native_subject ?nativeSubject .
?nativeSubject skos:prefLabel ?nativeSubjectPrefLabel .
optional {
{
?nativeSubject skos:exactMatch ?aatSubjectsId .
}
union
{
}
optional {
?nativeSubject skos:closeMatch ?aatSubjectsId .
}
}
}
union
{
?record aocat:has_creator ?creator .
?creator aocat:has_name ?creatorName .
}
union
{
?record aocat:has_creator ?creator .
?creator aocat:has_email ?creatorEmail .
}
union
{
?record aocat:has_access_rights ?accessRights .
}
union
{
}
optional {
?record aocat:has_description ?description .
}
union
{
}
optional {
?record aocat:has_access_policy / rdfs:label ?accessPolicy .
}
union
{
?record aocat:has_landing_page / rdfs:label ?landingPage .
}
union
{
?record aocat:has_temporal_coverage ?temporal .
}
union
{
?record aocat:has_temporal_coverage ?temporal .
}
optional {
?record aocat:has_landing_page / rdfs:label ?landingPage .
}
optional {
?record aocat:has_temporal_coverage ?temporal .
}
optional {
?record aocat:has_temporal_coverage ?temporal .
?temporal aocat:has_period / skos:prefLabel ?temporalPeriodName .
optional {
?temporal aocat:from ?temporalFrom .
?temporal aocat:until ?temporalUntil .
}
union
{
?record aocat:has_temporal_coverage ?temporal .
?temporal aocat:from ?temporalFrom .
}
union
{
?record aocat:has_temporal_coverage ?temporal .
?temporal aocat:until ?temporalUntil .
}
union
{
?record aocat:has_title ?title .
}
}
{
select *
@ -141,70 +114,44 @@ where {
?legalResponsible aocat:has_name ?legalResponsibleName .
?collection aocat:has_owner ?owner .
?owner aocat:has_name ?ownerName .
?collection aocat:has_publisher ?publisher .
?publisher aocat:has_name ?publisherName .
?collection aocat:has_access_rights ?accessRights .
?collection aocat:has_ARIADNE_subject ?archeologicalResourceType .
?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName .
optional {
{
?collection aocat:has_contributor / aocat:has_email ?contributorEmail .
}
union
{
?collection aocat:has_responsible / aocat:has_email ?legalResponsibleEmail .
}
union
{
?collection aocat:has_owner / aocat:has_email ?ownerEmail .
}
union
{
?collection aocat:has_publisher ?publisher .
?publisher aocat:has_name ?publisherName .
optional {
?publisher aocat:has_email ?publisherEmail .
}
}
union
{
?collection aocat:has_ARIADNE_subject ?archeologicalResourceType .
?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName .
}
union
{
?collection aocat:has_type / skos:prefLabel ?type .
}
union
{
?collection aocat:has_access_rights ?accessRights .
}
?contributor aocat:has_email ?contributorEmail .
}
}
}
union
optional {
?legalResponsible aocat:has_email ?legalResponsibleEmail .
}
optional {
?owner aocat:has_email ?ownerEmail .
}
optional {
?publisher aocat:has_email ?publisherEmail .
}
}
}
{
select *
where {
?record aocat:has_spatial_coverage ?spatial .
?spatial aocat:has_place_name ?spatialPlaceName .
optional {
?spatial aocat:has_coordinate_system ?spatialCoordinateSystem .
}
optional {
{
?record aocat:has_spatial_coverage ?spatial .
?spatial aocat:has_place_name ?spatialPlaceName .
optional {
?spatial aocat:has_coordinate_system ?spatialCoordinateSystem .
}
}
union
{
?record aocat:has_spatial_coverage ?spatial .
?spatial aocat:has_latitude ?spatialLocationLat ;
aocat:has_longitude ?spatialLocationLon .
BIND(uri(concat('https://www.ariadne-infrastructure.eu/property/location/', md5(concat(str(?spatialLocationLat), str(?spatialLocationLon))))) as ?location)
}
union
{
?record aocat:has_spatial_coverage ?spatial .
}
optional {
?spatial aocat:has_bounding_box_max_lat ?spatialLocationBBMaxLat ;
aocat:has_bounding_box_max_lon ?spatialLocationBBMaxLon ;
aocat:has_bounding_box_min_lat ?spatialLocationBBMinLat ;
aocat:has_bounding_box_min_lon ?spatialLocationBBMinLon ;
BIND(uri(concat('https://www.ariadne-infrastructure.eu/property/location/', md5(concat(str(?spatialLocationBBMaxLat), str(?spatialLocationBBMaxLon), str(?spatialLocationBBMinLat), str(?spatialLocationBBMinLon))))) as ?boxlocation)
}
}
}
}