From 5d8cbece81298bdd886022e60df659e44e2abeb9 Mon Sep 17 00:00:00 2001 From: Enrico Ottonello Date: Fri, 7 Feb 2020 14:44:26 +0100 Subject: [PATCH] graphdb query --- .../src/main/resources/query.txt | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 dnet-ariadneplus-graphdb-publisher/src/main/resources/query.txt diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/query.txt b/dnet-ariadneplus-graphdb-publisher/src/main/resources/query.txt new file mode 100644 index 0000000..279f092 --- /dev/null +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/query.txt @@ -0,0 +1,92 @@ +PREFIX aocat: +PREFIX rdfs: +PREFIX skos: +PREFIX mine: +PREFIX onto: + +CONSTRUCT { + ?record mine:resourcetype "AriadneCatalogEntry" . + ?record mine:identifier ?record . + ?record mine:publisher ?x . + ?x a mine:AgentInfo . + ?x mine:name ?publisherName . + ?x mine:type ?publisherType . + ?archeologicalResourceType a mine:archeologicalResourceType . +?record mine:archeologicalResourceType ?archeologicalResourceType . +?archeologicalResourceType mine:name ?archeologicalResourceTypeName . +?record mine:issued ?issued . +?record mine:resourceType ?resourceType . +?record mine:modified ?modified . +?record mine:nativeSubject ?ns . + ?ns a mine:NativeSubject . +?ns mine:prefLabel ?nativeSbj . + ?spatial a mine:Spatial . +?record mine:spatial ?spatial . +?spatial mine:placeName ?spatialPlaceName . +?spatial mine:location ?blocation . + ?blocation a mine:AriadneGeoPoint . +?blocation mine:lat ?spatialLocationLat . +?blocation mine:lon ?spatialLocationLon . +?record mine:accessPolicy ?accessPolicy . +?record mine:landingPage ?landingPage . +?record mine:title ?title . +?record mine:accessRights ?accessRights . +?record mine:description ?description . +?record mine:contributor ?contributor . + ?contributor a mine:AgentInfo . +?contributor mine:name ?contributorName . +?contributor mine:email ?contributorEmail . +?contributor mine:type ?contributorType . +?record mine:originalId ?originalId . + ?record mine:temporal ?t . + ?t a mine:AriadneTemporal . +?t mine:periodName ?temporalPeriodName . +?t mine:from ?from . +?t mine:until ?until . +?record mine:language ?language . +?record mine:partOf ?collection . +} + + +where { +?record aocat:has_title ?title ; + aocat:has_access_policy / rdfs:label ?accessRights ; + aocat:has_description ?description ; + aocat:has_creator / aocat:has_name ?contributorName ; + aocat:has_creator / aocat:has_email ?contributorEmail ; + + aocat:has_access_policy ?accessPolicy ; + aocat:has_landing_page / rdfs:label ?landingPage ; + aocat:is_part_of ?collection ; + aocat:has_spatial_coverage ?spatial ; + aocat:has_native_subject / skos:prefLabel ?nativeSbj ; + aocat:has_original_id ?originalId ; + aocat:has_temporal_coverage / aocat:has_period / skos:prefLabel ?temporalPeriodName ; + aocat:has_temporal_coverage / aocat:from ?from ; + aocat:has_temporal_coverage / aocat:until ?until ; + aocat:has_language / skos:prefLabel ?language . + { + select * + where { + ?collection aocat:has_publisher / rdfs:label ?publisherName ; + aocat:has_ARIADNE_subject ?archeologicalResourceType ; + aocat:was_issued ?issued ; + aocat:has_type / skos:prefLabel ?type . + ?archeologicalResourceType skos:prefLabel ?archeologicalResourceTypeName . + } + } + + { + select * + where { + ?spatial aocat:has_place_name ?spatialPlaceName ; + aocat:has_latitude ?spatialLocationLat ; + aocat:has_longitude ?spatialLocationLon . + BIND(uri(concat('http://www.myprefix/location/', md5(concat(str(?spatialLocationLat), str(?spatialLocationLon))))) as ?blocation) + + } + } + +BIND("organization" as ?contributorType) . +BIND("organization" as ?publisherType) . +}