CSIRO-enviro-informatics / geofabric-dataset

A Linked Data version of the Australian Hydrological Geospatial Fabric product
http://geofabricld.net
Apache License 2.0
5 stars 2 forks source link

Fixed rr cc relationships #18

Closed benjaminleighton closed 5 years ago

benjaminleighton commented 5 years ago

This solves issues raised in https://github.com/CSIRO-enviro-informatics/geofabric-dataset/issues/9 using code developed for https://github.com/CSIRO-enviro-informatics/mb16cc-linkset/issues/2 in the loci-cache-scripts generalize_database_load branch.

loci-cache-scripts can be run to produce a linkset that describes the within/contains relationships of rr>cc based on the geometry of river regions compared to contracted catchments. The output of this is a ls_rr16cc.ttl file which is a linkset description of geometric relationships, because it is small and for convenience a copy of that file is currently local as part of this pull request which might do for now. At startup of the geofabric ldapi this file is loaded via rdflib and a query executed to build a lookup of cc>rr. Subsequent logic executes on demand as contracted catchments are requested, this logic preferentially uses the existing logic i.e hydrological relationships are queried if they exist they describe within/contains relationships and are used if not the system falls back to using the lookup created from the linkset. I've tested this for contracted catchmetn 12302702 which I believe is one of the missing ones.