Skip to content

Commit ad452e1

Browse files
authored
Merge pull request #510 from SAWGraph/main
Add Sawgraph questions
2 parents ebae4c2 + 7c0e951 commit ad452e1

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Find PFAS results near suspected PFAS industry using facilities, by State
2+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5+
PREFIX fio: <http://w3id.org/fio/v1/fio#>
6+
PREFIX fio-pfas: <http://w3id.org/fio/v1/pfas#>
7+
PREFIX naics: <http://w3id.org/fio/v1/naics#>
8+
PREFIX epa-frs: <http://w3id.org/fio/v1/epa-frs#>
9+
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
10+
PREFIX kwg-ont: <http://stko-kwg.geog.ucsb.edu/lod/ontology/>
11+
PREFIX kwgr: <http://stko-kwg.geog.ucsb.edu/lod/resource/>
12+
PREFIX spatial: <http://purl.org/spatialai/spatial/spatial-full#>
13+
PREFIX coso:<http://w3id.org/coso/v1/contaminoso#>
14+
PREFIX qudt: <http://qudt.org/schema/qudt/>
15+
16+
SELECT DISTINCT ?observation ?stateName ?townName ?concentration ?unit ?normalizedConc ?substance ?date ?facilityName ?industryName WHERE {
17+
#find s2 cells with detect samples
18+
?sp a coso:SamplePoint;
19+
kwg-ont:sfWithin ?s2, ?town.
20+
?observation coso:observedAtSamplePoint ?sp;
21+
coso:ofDSSToxSubstance/skos:altLabel ?substance;
22+
coso:hasResult ?result;
23+
coso:observedTime ?date.
24+
?result qudt:quantityValue/qudt:numericValue ?concentration;
25+
qudt:quantityValue/qudt:hasUnit ?rawUnit. #only detected values
26+
?rawUnit qudt:symbol ?unit;
27+
qudt:conversionMultiplier ?unitConversion.
28+
BIND((?unitConversion * ?concentration) as ?normalizedConc ) #normalize different units
29+
?s2 rdf:type kwg-ont:S2Cell_Level13.
30+
?town rdf:type kwg-ont:AdministrativeRegion_3;
31+
kwg-ont:administrativePartOf+ ?state;
32+
rdfs:label ?townName.
33+
?state rdf:type kwg-ont:AdministrativeRegion_1;
34+
rdfs:label ?stateName.
35+
36+
#find facilities in s2 cells
37+
?facility kwg-ont:sfWithin ?s2;
38+
rdf:type fio:Facility;
39+
rdfs:label ?facilityName;
40+
fio:ofIndustry ?industry.
41+
?pfasIndustryList rdfs:subClassOf fio-pfas:IndustryCollectionByPFASContaminationConcern;
42+
fio:hasMember ?industry.
43+
?industry rdfs:label ?industryName.
44+
45+
} ORDER BY DESC(?normalizedConc) # highest normalized concentration first
46+
limit 100
47+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Retrieve 100 plant and animal (biota) sample results with the location type sampled, sample material type, observed property, substance, and detected result.
2+
PREFIX coso: <http://w3id.org/coso/v1/contaminoso#>
3+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
4+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
5+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
6+
PREFIX qudt: <http://qudt.org/schema/qudt/>
7+
PREFIX pfas: <http://w3id.org/pfas/v1/>
8+
PREFIX dsstox: <http://w3id.org/DSSTox/v1/>
9+
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
10+
11+
SELECT ?sample ?sampleName ?location ?coordinates (GROUP_CONCAT(DISTINCT ?materialTypeName;separator=",") as ?materialType) ?substance ?substanceName ?value ?unit ?date
12+
WHERE {
13+
?sample rdf:type coso:BiotaSample;
14+
coso:sampleOfMaterialType ?sampletype;
15+
coso:fromSamplePoint ?samplePoint;
16+
rdfs:label ?sampleName.
17+
?observation coso:analyzedSample ?sample;
18+
a coso:ContaminantSampleObservation;
19+
coso:hasFeatureOfInterest ?feature;
20+
coso:ofSubstance ?substance;
21+
coso:observedTime ?date;
22+
coso:hasResult ?result.
23+
?substance rdf:type pfas:PerFAs; #Perfluoroalkyl substances (not poly)
24+
skos:altLabel ?substanceName;
25+
dsstox:hasCarbonChainLength ?carbonChainLength.
26+
FILTER(?carbonChainLength > 6) #carbon chain > 6
27+
?result coso:measurementValue ?value.
28+
OPTIONAL{?result coso:measurementUnit/qudt:symbol ?unit.}
29+
MINUS {VALUES ?value{"non-detect" "non-quantified"}} #only detect values
30+
?samplePoint geo:hasGeometry/geo:asWKT ?coordinates.
31+
?feature coso:ofFeatureType/rdfs:label ?location.
32+
?sampletype rdf:type coso:SampleMaterialType;
33+
rdfs:label ?materialTypeName.
34+
} GROUP BY ?sample ?sampleName ?location ?substance ?substanceName ?value ?unit ?date ?coordinates
35+
LIMIT 100

0 commit comments

Comments
 (0)