Last active
April 27, 2020 08:44
-
-
Save michimau/46bf7dd521f5c7da7cd77b304fdc15e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | |
PREFIX dcterms: <http://purl.org/dc/terms/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX cr: <http://cr.eionet.europa.eu/ontologies/contreg.rdf#> | |
PREFIX aq: <http://rdfdata.eionet.europa.eu/airquality/ontology/> | |
PREFIX rod: <http://rod.eionet.europa.eu/schema.rdf#> | |
PREFIX obligations: <http://rod.eionet.europa.eu/obligations/> | |
PREFIX aqdd: <http://dd.eionet.europa.eu/property/> | |
SELECT DISTINCT | |
?source | |
#md5(concat(?Country, ?Namespace, ?AttainmentId, xsd:string(?startOfPeriod), ?ObjectiveType, ?ReportingMetric, xsd:string(?ExceedanceThreshold), xsd:string(?Exceedance), ?AggregationType,?Pollutant, ?ProtectionTarget, xsd:string(?FinalNumericalExceedance), xsd:string(?FinalNumberExceedances), xsd:string(?ClassificationArea), xsd:string(?SurfaceAreaFinal), xsd:string(?RoadLengthFinal), xsd:string(?PopulationExposedFinal),xsd:string(?ReferenceYearFinal),xsd:string(?BaseNumericalExceedance), xsd:string(?BaseNumberExceedances), xsd:string(?Adjustment),?AdjustmentSource, ?AdjustmentType, ?AssessmentType, ?ModelAssessmentMetadataURI, ?AssessmentTypeDescription, xsd:string(?ModellingAdjustment),xsd:string(?SamplingAdjustment), ?envelope)) as ?_id | |
#?attainmentURI | |
?Country as ?CountryOrTerritory | |
#YEAR(xsd:date(?startOfPeriod)) AS ?ReportingYear | |
?Namespace | |
?AttainmentId | |
replace(str(?areURI),"http://reference.eionet.europa.eu/aq/","") as ?AssessmentId | |
replace(replace(replace(str(?ZoneURI),"http://reference.eionet.europa.eu/aq/",""),?Namespace ,""),"/","") as ?ZoneId | |
#?ResidentPopulation | |
?Pollutant | |
?ObjectiveType | |
?ReportingMetric | |
?ProtectionTarget | |
bif:either(?Exceedance > 0,"TRUE","FALSE") as ?ExceedanceFinal | |
?ExceedanceThreshold | |
?AggregationType | |
?FinalNumericalExceedance | |
?FinalNumberExceedances | |
?ClassificationArea | |
?SurfaceAreaFinal | |
?RoadLengthFinal | |
?PopulationExposedFinal | |
#?SensitivePopulationFinal | |
#?EcosystemAreaExposedFinal | |
#?InfrastructureServicesFinal | |
?ReferenceYearFinal | |
?BaseNumericalExceedance | |
?BaseNumberExceedances | |
?Adjustment | |
?AdjustmentSource | |
?AdjustmentType | |
?AssessmentType | |
?AssessmentTypeDescription | |
replace(replace(replace(str(?ModellingAdjustment),"http://reference.eionet.europa.eu/aq/",""),?Namespace ,""),"/","") as ?ModellingAdjustment | |
replace(replace(replace(str(?SamplingAdjustment),"http://reference.eionet.europa.eu/aq/",""),?Namespace ,""),"/","") as ?SamplingAdjustment | |
?Comment | |
?envelope | |
WHERE {{ | |
values ?source { <http://cdr.eionet.europa.eu/at/eu/aqd/g/envvjfwsa/REP_D-AT_000820_20141211_G-001_corr.xml> } . | |
#values ?source { <<source>> } | |
GRAPH ?source { | |
?attainmentURI a aq:AQD_Attainment . | |
?attainmentURI aq:environmentalObjective ?envURI . | |
?attainmentURI aq:assessment ?areURI . | |
?attainmentURI aq:zone ?ZoneURI . | |
?attainmentURI aq:pollutant ?PollutantURI . | |
?attainmentURI aq:inspireId ?inspireURI . | |
?inspireURI aq:localId ?AttainmentId . | |
OPTIONAL{?attainmentURI aq:comment ?Comment} . | |
} | |
?source dcterms:isPartOf ?envelope . | |
# ?envelope rod:released ?released . | |
# ?envelope rod:locality ?locality . | |
# ?envelope rod:obligation ?obliURI . | |
# ?envelope rod:startOfPeriod ?startOfPeriod . | |
###namespace property does exist | |
?inspireURI aq:namespace ?Namespace . | |
?PollutantURI skos:notation ?Pollutant . | |
?thresURI aqdd:relatedPollutant ?PollutantURI . | |
?thresURI aqdd:aggregationProcess ?AggregationTypeURI . | |
?AggregationTypeURI rdfs:label ?AggregationType . | |
?thresURI aqdd:hasReportingMetric ?ReportingMetricURI . | |
?thresURI aqdd:hasObjectiveType ?ObjectiveTypeURI . | |
?thresURI aqdd:hasProtectionTarget ?ProtectionTargetURI . | |
?thresURI aqdd:exceedanceThreshold ?ExceedanceThreshold . | |
?thresURI skos:notation ?NrId . | |
# OPTIONAL{?attainmentURI aq:comment ?Comment} . | |
OPTIONAL{?attainmentURI aq:exceedanceDescriptionFinal ?exceedanceDescriptionFinal . | |
#?exceedanceDescriptionFinal aq:exceedance ?Exceedance . | |
?exceedanceDescriptionFinal aq:numberExceedances ?FinalNumberExceedances . | |
?exceedanceDescriptionFinal aq:exceedanceArea ?areaFinalURI . | |
?exceedanceDescriptionFinal aq:exceedanceExposure ?exposureFinalURI . | |
?exceedanceDescriptionFinal aq:deductionAssessmentMethod ?DeductionAssessmentFinal . | |
?areaFinalURI aq:surfaceArea ?SurfaceAreaFinal . | |
?areaFinalURI aq:roadLength ?RoadLengthFinal . | |
?exposureFinalURI aq:populationExposed ?PopulationExposedFinal . | |
?exposureFinalURI aq:referenceYear ?ReferenceYearURI . | |
?ReferenceYearURI aq:timePosition ?ReferenceYearFinal . | |
?areaFinalURI aq:areaClassification ?ClassificationArea . | |
?DeductionAssessmentFinal aq:adjustmentType ?AdjustmentTypeURI . | |
?AdjustmentTypeURI rdfs:label ?Adjustment . | |
} | |
OPTIONAL {?exceedanceDescriptionFinal aq:numericalExceedance ?FinalNumericalExceedance }. | |
## OPTIONAL{?attainmentURI aq:exceedanceDescriptionBase ?exceedanceDescriptionBase} . | |
OPTIONAL{?attainmentURI aq:exceedanceDescriptionBase ?exceedanceDescriptionBase . | |
?exceedanceDescriptionBase aq:numberExceedances ?BaseNumberExceedances . | |
?exceedanceDescriptionBase aq:numericalExceedance ?BaseNumericalExceedance | |
} | |
### ClassificationArea is an array of results, thus gives duplicate rows with this field only differenciating. | |
OPTIONAL{ ?attainmentURI aq:exceedanceDescriptionAdjustment ?ExceedanceDescriptionAdjustment . | |
?ExceedanceDescriptionAdjustment aq:deductionAssessmentMethod ?DeductionAssessmentMethod . | |
?DeductionAssessmentMethod aq:assessmentMethod ?AssessmentMethod . | |
?DeductionAssessmentMethod aq:adjustmentSource ?sourceAdjURI . | |
?DeductionAssessmentMethod aq:adjustmentType ?excAdjURI . | |
?sourceAdjURI rdfs:label ?AdjustmentSource . | |
?excAdjURI rdfs:label ?AdjustmentType . | |
?AssessmentMethod aq:assessmentTypeDescription ?AssessmentTypeDescription . | |
?AssessmentMethod aq:assessmentType ?asstypeURI . | |
?AssessmentMethod aq:modelAssessmentMetadata ?ModellingAdjustment . | |
?AssessmentMethod aq:samplingpointAssessmentMetadata ?SamplingAdjustment . | |
?asstypeURI rdfs:label ?AssessmentType . | |
} | |
OPTIONAL{?envURI aq:reportingMetric ?ReportingMetricURI . | |
?envURI aq:objectiveType ?ObjectiveTypeURI . | |
?envURI aq:protectionTarget ?ProtectionTargetURI | |
} . | |
OPTIONAL{?ReportingMetricURI rdfs:label ?ReportingMetric} . | |
OPTIONAL{?ObjectiveTypeURI rdfs:label ?ObjectiveType} . | |
OPTIONAL{?ProtectionTargetURI rdfs:label ?ProtectionTarget} . | |
#?locality rod:localityName ?Country . | |
#?obliURI rdfs:label ?Obligation . | |
}} | |
ORDER BY ?_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment