Skip to content

Commit

Permalink
Query Mainstems and Gages with SPARQL provider (7261757324) (#21)
Browse files Browse the repository at this point in the history
* Query Mainstems and Gages with SPARQL provider (7261757324)

* Update SPARQL provider

* Use pygeoapi root image

* Update item.html

* Update configuration to include more sparql predicates

* Update pygeoapi.config.yml
  • Loading branch information
webb-ben authored Sep 13, 2024
1 parent 7733cb2 commit 85e1e61
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM internetofwater/pygeoapi:latest
FROM geopython/pygeoapi:latest
#pygeoapi last updated 2023-07-31

#add requirements and mods
Expand All @@ -7,5 +7,7 @@ COPY ./pygeoapi.config.yml /pygeoapi/local.config.yml
# COPY ./schemas.opengis.net /opt/schemas.opengis.net
COPY ./pygeoapi-skin-dashboard /skin-dashboard

RUN pip3 install https://github.com/cgs-earth/pygeoapi-plugins/archive/refs/heads/master.zip

COPY ./sitemap /sitemap
RUN mv /sitemap/_sitemap.xml /sitemap/sitemap.xml
76 changes: 73 additions & 3 deletions pygeoapi.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ resources:
title: data source
href: https://doi.org/10.5066/F7F76BSS
hreflang: en-US
links:
- type: application/html
rel: canonical
title: report documenting data
Expand Down Expand Up @@ -405,14 +404,85 @@ resources:
extents: *extents
providers:
- type: feature
name: PostgreSQL
name: pygeoapi_plugins.provider.sparql.SPARQLProvider
data: *provider-data
id_field: id
title_field: name_at_outlet
table: mainstems
uri_field: uri
geom_field: geom
dams: #updated 2024-04-23
sparql_provider: PostgreSQL
sparql_query:
convert: false
endpoint: https://graph.geoconnex.us/repositories/iow
prefixes:
schema: <https://schema.org/>
gsp: <http://www.opengis.net/ont/geosparql#>
wiki: <https://www.wikidata.org/wiki/>
hyf: <https://www.opengis.net/def/schema/hy_features/hyf/>
xsd: <http://www.w3.org/2001/XMLSchema#>
bind:
name: uri
variable: '?mainstem'
select: '?mainstem ?monitoringLocation ?siteName ?datasetDescription ?type ?url ?variableMeasured ?variableUnit ?measurementTechnique ?temporalCoverage ?wkt'
where:
- subject: '?monitoringLocation'
predicate: hyf:referencedPosition/hyf:HY_IndirectPosition/hyf:linearElement
object: '?mainstem'
- subject: '?monitoringLocation'
predicate: schema:name
object: '?siteName'
- subject: '?monitoringLocation'
predicate: schema:subjectOf
object: '?dataset'
- subject: '?dataset'
predicate: schema:url
object: '?url'
- subject: '?dataset'
predicate: schema:distribution
object: '?distribution'
- subject: '?distribution'
predicate: schema:name
object: '?distributionName'
- subject: '?distribution'
predicate: schema:contentUrl
object: '?distributionURL'
- subject: '?distribution'
predicate: schema:encodingFormat
object: '?distributionFormat'
- subject: '?dataset'
predicate: schema:description
object: '?datasetDescription'
- subject: '?monitoringLocation'
predicate: hyf:HydroLocationType
object: '?type'
- subject: '?dataset'
predicate: 'schema:variableMeasured'
object: '?variableMeasured_'
- subject: '?variableMeasured_'
predicate: 'schema:name'
object: '?variableMeasured'
- subject: '?variableMeasured_'
predicate: 'schema:unitText'
object: '?variableUnit'
- subject: '?variableMeasured_'
predicate: 'schema:measurementTechnique'
object: '?measurementTechnique'
- subject: '?variableMeasured_'
predicate: 'schema:name'
object: '?variableMeasured'
- subject: '?dataset'
predicate: 'schema:temporalCoverage'
object: '?temporalCoverage'
- subject: '?dataset'
predicate: 'schema:provider'
object: '?provider'
- subject: '?provider'
predicate: 'schema:name'
object: '?datasetProvider'
filter:
- 'FILTER(REGEX(?variableMeasured, "stream(flow)?|discharge|flow", "i"))'
dams: # updated 2024-04-23
type: collection
title: Reference Dams
description: United States Community Contributed Reference Dams
Expand Down

0 comments on commit 85e1e61

Please sign in to comment.