spatialkg

SAWGraph Spatial KG

The SAWGraph Spatial KG is part of the Safe Agricultural Products and Water Graph (SAWGraph) project. It contains all the Level 13 grid cells from the S2 grid as well as administrative regions of levels 1 to 3 (states, counties, and county subdivisions) and the spatial relationships between them for the 48 contiguous states in the U.S.

The SAWGraph Spatial KG is a large-scale geospatial knowledge graph developed by the SAWGraph project (funded by NSF award #2333782) for researchers and practitioners working with place-based data and spatial analytics. It supports spatial reasoning, place-based linkage, and geographic data integration. The graph covers the entire 48 contiguous states in the U.S. and contains 756.9 million triples describing 16.8 million spatial entities, including 7.4 million S2 cells (Level 13 discretization) and hierarchical administrative regions across three levels: Level 1 (102 states), Level 2 (6,228 counties), Level 3 (35,458 county subdivisions such as towns and townships). The administrative entities are hierarchically linked as well as spatially integrated with the Level 13 S2 cells using the spatial:connectedTo relation. The knowledge graph leverages the KWG ontology and implements OGC GeoSPARQL standards for interoperability with other geospatial datasets.

Retrieve all solid waste landfills (NAICS Industry Code 562212) in the state of Georgia (FIPS code 13) and their name and the town they are located in.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX fio: <http://w3id.org/fio/v1/fio#>
PREFIX naics: <http://w3id.org/fio/v1/naics#> 
PREFIX epa-frs: <http://w3id.org/fio/v1/epa-frs#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX kwg-ont: <http://stko-kwg.geog.ucsb.edu/lod/ontology/>
PREFIX kwgr: <http://stko-kwg.geog.ucsb.edu/lod/resource/>
PREFIX spatial: <http://purl.org/spatialai/spatial/spatial-full#>


SELECT * WHERE {
  VALUES ?code {naics:NAICS-562212}
  ?fac rdf:type fio:Facility ;
       fio:ofIndustry ?code ;
       spatial:connectedTo ?town ;
       geo:hasGeometry/geo:asWKT ?facWKT;
       rdfs:label ?facilityName.

  # filter by administrative region (kwgr:administrativeRegion.USA.13 denotes the state of Georgia) and retrieve town
  ?town rdf:type kwg-ont:AdministrativeRegion_3 ;
                   kwg-ont:administrativePartOf+ kwgr:administrativeRegion.USA.13 ;
                   rdfs:label ?townLabel .

  # also retrieve any labels associated with the facility and industry 
  OPTIONAL { ?fac rdfs:label ?faclabel . }
  OPTIONAL { ?code rdfs:label ?ind . }
}
graph TD
SPARQL Endpoint https://frink.apps.renci.org/spatialkg/sparql
Triple Pattern Fragments https://frink.apps.renci.org/ldf/spatialkg