Skip to content

Commit

Permalink
Update workflows and txs to new layout
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Sep 3, 2024
1 parent 7c6be73 commit 6eb0bef
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
pip install requests pyyaml
- name: Check URLS
run: python scripts/check_links.py
run: python rainbow/scripts/check_links.py
4 changes: 2 additions & 2 deletions .github/workflows/semantic-uplift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
DB_PASSWORD: ${{ secrets.UPLOAD_GRAPH_STORE_PASSWORD }}
run: |
python -m ogc.na.ingest_json --batch --skip-on-missing-context --all \
--ttl --work-dir . --domain-config .ogc/catalog.ttl
python -m ogc.na.update_vocabs -w . .ogc/catalog.ttl --use-git-status \
--ttl --work-dir ./rainbow --domain-config rainbow/catalog.ttl
python -m ogc.na.update_vocabs -w ./rainbow rainbow/catalog.ttl --use-git-status \
--update --graph-store https://defs-dev.opengis.net/fuseki-hosted/data
- name: Commit changes
uses: EndBug/add-and-commit@v9
Expand Down
File renamed without changes.
99 changes: 99 additions & 0 deletions rainbow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Pilot 3 air quality & semantics

## Semantic uplift

The following files are semantically uplifted and published in the
[OGC RAINBOW hosted instance](https://defs-dev.opengis.net/vocprez-hosted):

* `generic/properties.yml`: AD4GD properties
* `generic/procedures.yml`: AD4GD procedures
* `generic/sensors.yml`: AD4GD sensors
* `generic/sensor-manufacturers.yml`: AD4GD sensor anufacturers)

New uplift entries can be configured inside `.ogc/catalog.ttl`
(see [Documentation and tutorials](#documentation-and-tutorials) below).

Please bear in mind that any `.ttl` files that you may find in this repository (apart from `.ogc/catalog.ttl`)
are most certainly going to be auto-generated, and thus you should not edit them directly because your changes
will be lost. The repository is set up to work with YAML/JSON files and JSON-LD uplift definitions (`*-uplift.yml`
files), and to generate (and publish) their RDF representations automatically.

### Documentation and tutorials

* [Example domain definition (like `.ogc/catalog.ttl`)](https://opengeospatial.github.io/ogc-na-tools/examples/#sample-domain-configuration)
* [How to create a JSON-LD uplift context definition](https://opengeospatial.github.io/ogc-na-tools/tutorials/#how-to-create-a-json-ld-uplift-context-definition)

## The data model

A simplified version of the pilot data model employed is shown below.

![AD4GD model](assets/ad4gd-model.png)

Further discussion on the rationale for some of the modeling decisions (such as how to link units of
measure and procedures to sensor definitions) can be found in
[this document](https://docs.google.com/document/d/1fzEKymhmAB4dVEEgJE3XXf4DTzPS60oj3wYzJQrZcrE/edit?usp=sharing).

### Working with observations

An example of a sensor type defined according to the model above could be (some properties omitted for clarity):

```turtle
<https://w3id.org/ad4gd/sensors/Nova-Fitness/SDS011> a skos:Concept, owl:Class ;
rdfs:subClassOf sosa:Sensor ;
sosa:observes [
qudt:hasUnit unit:MicroGM-PER-M3 ;
skos:broader ad4gd-prop:pm10 ;
ssn:implements [ qb:order 1 ; skos:broader ad5gd-procedure:pm-humidity-correction ] ;
]
.
```

This would represent a sensor that observes PM10 concentration (`ad4gd-prop:pm10`) using μg/m³ (`unit:MicroGM-PER-M3`),
and implementing a humidity correction procedure (`ad5gd-procedure:pm-humidity-correction`).

Apart from their numeric value, it is expected that observations will only include a reference to the
sensor type and a reference to the generalized observable property that has been measured. So, for example, we would
have:

```turtle
_:obs75134 a sosa:Observation ;
sosa:madeBySensor [
a <https://w3id.org/ad4gd/sensors/Nova-Fitness/SDS011> ;
dct:identifier "SN/2313Q432"
] ;
sosa:observedProperty ad4gd-prop:pm10 ;
sosa:hasSimpleResult 0.323 ;
.
```

The above observation was made by a sensor of type SDS011 with serial number "SN/2313Q432", its observed property is
PM10, and it has a result of 0.323. If a consumer encounters this observation, it can retrieve the information about the
sensor type and match the observed property to the one declared inside its `sosa:observes`, making it possible to infer
new metadata, resulting in the following full description for the observation:

```turtle
_:obs75134 a sosa:Observation ;
sosa:madeBySensor [
a <https://w3id.org/ad4gd/sensors/Nova-Fitness/SDS011> ;
dct:identifier "SN/2313Q432"
] ;
sosa:observedProperty ad4gd-prop:pm10 ;
sosa:hasSimpleResult 0.323 ;
sosa:hasResult [
qudt:numericValue 0.323 ;
qudt:unit unit:MicroGM-PER-M3 ;
] ;
sosa:usedProcedure [ qb:order 1 ; skos:broader ad5gd-procedure:pm-humidity-correction ] ;
.
```

### The SOSA model

For reference, the observation perspective of the [SOSA/SSN ontology](https://www.w3.org/TR/vocab-ssn/) model follows.

![SOSA-SSN Model](assets/sosa_model.png)

## Acknowledgements

The work has been co-funded by the European Union and the United Kingdom under the
Horizon Europe [AD4GD Project](https://www.ogc.org/initiatives/ad4gd/).
File renamed without changes.

0 comments on commit 6eb0bef

Please sign in to comment.