Skip to content

Commit

Permalink
Add graph results for Hucs (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
webb-ben authored Sep 26, 2024
1 parent ec6fb38 commit 572438c
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h6 class="m-0 font-weight-bold text-primary">
</div>
</div>
{% if data['properties']['datasets'] %}
<h2 class="mx-auto">Datasets</h2>
<h2 class="mx-auto">Graph Results</h2>
{% for dataset in data['properties']['datasets'] %}
<div class="card border-left-info shadow mb-1" style="overflow-x: scroll;">
<table class="table">
Expand Down
76 changes: 72 additions & 4 deletions pygeoapi.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ resources:
end: null
providers:
- type: feature
name: PostgreSQL
name: pygeoapi_plugins.provider.sparql.SPARQLProvider
data: &provider-data
host: ${POSTGRES_HOST}
dbname: ${POSTGRES_DB}
Expand All @@ -120,6 +120,23 @@ resources:
table: hu02
uri_field: uri
geom_field: geom
sparql_provider: PostgreSQL
sparql_query:
convert: false
endpoint: https://graph.geoconnex.us/repositories/iow
prefixes:
hyf: <https://www.opengis.net/def/schema/hy_features/hyf/>
bind:
name: uri
variable: '?huc'
select: '?huc ?hucLevel (GROUP_CONCAT(?containedCatchment; SEPARATOR="|") AS ?hucs)'
groupby: '?huc ?hucLevel'
where:
- subject: '?containedCatchment'
predicate: hyf:containingCatchment
object: '?huc'
filter:
- 'BIND(REPLACE(STR(?containedCatchment), "^.*ref/(hu[0-9]+)/.*$", "$1") AS ?hucLevel)'
hu04:
type: collection
title: HU04
Expand All @@ -138,13 +155,30 @@ resources:
extents: *extents
providers:
- type: feature
name: PostgreSQL
name: pygeoapi_plugins.provider.sparql.SPARQLProvider
data: *provider-data
id_field: huc4
title_field: name
table: hu04
uri_field: uri
geom_field: geom
sparql_provider: PostgreSQL
sparql_query:
convert: false
endpoint: https://graph.geoconnex.us/repositories/iow
prefixes:
hyf: <https://www.opengis.net/def/schema/hy_features/hyf/>
bind:
name: uri
variable: '?huc'
select: '?huc ?hucLevel (GROUP_CONCAT(?containedCatchment; SEPARATOR="|") AS ?hucs)'
groupby: '?huc ?hucLevel'
where:
- subject: '?containedCatchment'
predicate: hyf:containingCatchment
object: '?huc'
filter:
- 'BIND(REPLACE(STR(?containedCatchment), "^.*ref/(hu[0-9]+)/.*$", "$1") AS ?hucLevel)'
hu06:
type: collection
title: HU06
Expand All @@ -163,13 +197,30 @@ resources:
extents: *extents
providers:
- type: feature
name: PostgreSQL
name: pygeoapi_plugins.provider.sparql.SPARQLProvider
data: *provider-data
id_field: huc6
title_field: name
table: hu06
uri_field: uri
geom_field: geom
sparql_provider: PostgreSQL
sparql_query:
convert: false
endpoint: https://graph.geoconnex.us/repositories/iow
prefixes:
hyf: <https://www.opengis.net/def/schema/hy_features/hyf/>
bind:
name: uri
variable: '?huc'
select: '?huc ?hucLevel (GROUP_CONCAT(?containedCatchment; SEPARATOR="|") AS ?hucs)'
groupby: '?huc ?hucLevel'
where:
- subject: '?containedCatchment'
predicate: hyf:containingCatchment
object: '?huc'
filter:
- 'BIND(REPLACE(STR(?containedCatchment), "^.*ref/(hu[0-9]+)/.*$", "$1") AS ?hucLevel)'
hu08:
type: collection
title: HU08
Expand All @@ -188,13 +239,30 @@ resources:
extents: *extents
providers:
- type: feature
name: PostgreSQL
name: pygeoapi_plugins.provider.sparql.SPARQLProvider
data: *provider-data
id_field: huc8
title_field: name
table: hu08
uri_field: uri
geom_field: geom
sparql_provider: PostgreSQL
sparql_query:
convert: false
endpoint: https://graph.geoconnex.us/repositories/iow
prefixes:
hyf: <https://www.opengis.net/def/schema/hy_features/hyf/>
bind:
name: uri
variable: '?huc'
select: '?huc ?hucLevel (GROUP_CONCAT(?containedCatchment; SEPARATOR="|") AS ?hucs)'
groupby: '?huc ?hucLevel'
where:
- subject: '?containedCatchment'
predicate: hyf:containingCatchment
object: '?huc'
filter:
- 'BIND(REPLACE(STR(?containedCatchment), "^.*ref/(hu[0-9]+)/.*$", "$1") AS ?hucLevel)'
hu10:
type: collection
title: HU10
Expand Down

0 comments on commit 572438c

Please sign in to comment.