AriadnePlus/dnet-ariadneplus-graphdb-pu.../src/main/resources/query.txt

228 lines
8.7 KiB
Plaintext

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#>
PREFIX mine: <http://www.myprefix/>
PREFIX onto: <http://www.ontotext.com/>
PREFIX ariadneplus: <https://ariadne-infrastructure.eu/aocat/>
CONSTRUCT {
?record mine:resourcetype "AriadneCatalogEntry" .
?record mine:identifier ?record .
?record mine:originalId ?originalId .
?record mine:issued ?issued .
?record mine:modified ?modified .
?record mine:partOf ?collection .
?record mine:creator ?creator .
?creator mine:name ?creatorName .
?creator mine:email ?creatorEmail .
?record mine:contributor ?contributor .
?contributor mine:name ?contributorName .
?contributor mine:email ?contributorEmail .
?record mine:legalResponsible ?legalResponsible .
?legalResponsible mine:name ?legalResponsibleName .
?legalResponsible mine:email ?legalResponsibleEmail .
?record mine:owner ?owner .
?owner mine:name ?ownerName .
?owner mine:email ?ownerEmail .
?record mine:publisher ?publisher .
?publisher mine:name ?publisherName .
?publisher mine:email ?publisherEmail .
?record mine:accessPolicy ?accessPolicy .
?record mine:accessRights ?accessRights .
?record mine:landingPage ?landingPage .
?record mine:spatial ?spatial .
?spatial mine:placeName ?spatialPlaceName .
?spatial mine:spatialCoordinateSystem ?spatialCoordinateSystem .
?spatial mine:location ?location .
?location mine:lat ?spatialLocationLat .
?location mine:lon ?spatialLocationLon .
?spatial mine:boxlocation ?boxlocation .
?boxlocation mine:boxMaxLat ?spatialLocationBBMaxLat .
?boxlocation mine:boxMaxLon ?spatialLocationBBMaxLon .
?boxlocation mine:boxMinLat ?spatialLocationBBMinLat .
?boxlocation mine:boxMinLon ?spatialLocationBBMinLon .
?record mine:temporal ?temporal .
?temporal mine:uri ?temporal .
?temporal mine:periodName ?temporalPeriodName .
?temporal mine:from ?temporalFrom .
?temporal mine:until ?temporalUntil .
?record mine:archeologicalResourceType ?archeologicalResourceType .
?archeologicalResourceType mine:name ?archeologicalResourceTypeName .
?record mine:resourceType ?resourceType .
?record mine:nativeSubject ?nativeSubject .
?nativeSubject mine:prefLabel ?nativeSubjectPrefLabel .
?nativeSubject mine:rdfAbout ?nativeSubject .
?nativeSubject mine:aatSubjectsId ?aatSubjectsId .
?record mine:title ?title .
?record mine:description ?description .
?record mine:language ?language .
}
from <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::aat>
from <https://ariadne-infrastructure.eu/api_________::ariadne_plus::ads::273>
#from onto:explain
where {
#mandatory statements in our model, to be added in all datasources
# aocat:has_access_rights ?accessRights ;
# aocat:has_creator / aocat:has_name ?contributorName ;
# aocat:has_creator / aocat:has_email ?contributorEmail ;
# aocat:has_native_subject / skos:prefLabel ?nativeSbj ;
# aocat:has_original_id ?originalId ;
#?record aocat:has_title ?title .
?record aocat:has_language / skos:prefLabel ?language .
optional {
{
?record aocat:has_original_id ?originalId .
}
union
{
?record aocat:has_native_subject ?nativeSubject .
?nativeSubject skos:prefLabel ?nativeSubjectPrefLabel .
optional {
{
?nativeSubject skos:exactMatch ?aatSubjectsId .
}
union
{
?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
{
?record aocat:has_description ?description .
}
union
{
?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 .
?temporal aocat:has_period / skos:prefLabel ?temporalPeriodName .
}
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 *
where {
#mandatory statements in our model, to be added in all datasources
#?collection aocat:has_publisher / rdfs:label ?publisherName ;
# aocat:has_ARIADNE_subject ?archeologicalResourceType ;
# aocat:has_type / skos:prefLabel ?type .
?record aocat:is_part_of ?collection .
?collection aocat:was_issued ?issued .
?collection aocat:was_modified ?modified .
?collection aocat:has_contributor ?contributor .
?contributor aocat:has_name ?contributorName .
?collection aocat:has_responsible ?legalResponsible .
?legalResponsible aocat:has_name ?legalResponsibleName .
?collection aocat:has_owner ?owner .
?owner aocat:has_name ?ownerName .
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 .
}
}
#?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName .
}
}
union
{
select *
where {
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('http://www.myprefix/location/', md5(concat(str(?spatialLocationLat), str(?spatialLocationLon))))) as ?location)
}
union
{
?record aocat:has_spatial_coverage ?spatial .
?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('http://www.myprefix/location/', md5(concat(str(?spatialLocationBBMaxLat), str(?spatialLocationBBMaxLon), str(?spatialLocationBBMinLat), str(?spatialLocationBBMinLon))))) as ?boxlocation)
}
}
}
}
BIND("organization" as ?contributorType) .
BIND("organization" as ?publisherType) .
}