generated from opengeospatial/bblock-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3247851
commit 9ad8b74
Showing
54 changed files
with
5,802 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "metaschema.yaml", | ||
"name": "Exercise 1", | ||
"highlighted": true, | ||
"abstract": "Set an example", | ||
"status": "under-development", | ||
"dateTimeAddition": "2023-04-05T00:00:00Z", | ||
"itemClass": "schema", | ||
"register": "ogc-building-block-register", | ||
"version": "0.1", | ||
"dateOfLastChange": "2023-04-05", | ||
"link": "https://github.com/opengeospatial/bblock-template", | ||
"sources": [ | ||
{ | ||
"title": "Sample source document", | ||
"link": "https://example.com/sources/1" | ||
} | ||
], | ||
"maturity": "mature", | ||
"scope": "unstable", | ||
"tags": [ | ||
"templates" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Exercise 1 | ||
|
||
Goal: take a simple JSON schema and test with an example | ||
|
||
### Steps | ||
- un-comment the reference to a local file in [examples.yaml](examples.yaml) | ||
- run build | ||
- run viewer | ||
- navigate to "Exercise 1" | ||
- view validation results at [build-local/...](/register/build-local/tests/bbr/template/exercise1/_report.json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$schema: https://raw.githubusercontent.com/opengeospatial/bblocks-postprocess/refs/heads/master/ogc/bblocks/schemas/examples.schema.yaml | ||
|
||
## List of examples | ||
examples: | ||
- title: Reference a local file for examples | ||
content: |- | ||
[Example from mySchema](../../mySchema/example.json) | ||
In **Markdown** format. | ||
# snippets: | ||
# - language: json | ||
# ref: ../mySchema/example.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$schema: https://json-schema.org/draft/2020-12/schema | ||
description: My example schema | ||
type: object | ||
properties: | ||
a: | ||
type: string | ||
format: uri | ||
b: | ||
type: number | ||
c: | ||
type: number | ||
required: | ||
- a | ||
- b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "metaschema.yaml", | ||
"name": "Exercise 2", | ||
"highlighted": true, | ||
"abstract": "Add a JSON-LD context", | ||
"status": "under-development", | ||
"dateTimeAddition": "2023-04-05T00:00:00Z", | ||
"itemClass": "schema", | ||
"register": "ogc-building-block-register", | ||
"version": "0.1", | ||
"dateOfLastChange": "2023-04-05", | ||
"link": "https://github.com/opengeospatial/bblock-template", | ||
"sources": [ | ||
{ | ||
"title": "Sample source document", | ||
"link": "https://example.com/sources/1" | ||
} | ||
], | ||
"maturity": "mature", | ||
"scope": "unstable", | ||
"tags": [ | ||
"templates" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@context": { | ||
"mynamespace": "http://example.com/mythings/", | ||
"a": "@type", | ||
"b": "https://example.org/my-bb-model/b", | ||
"c": "https://example.org/my-bb-model/c" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## Exercise 2 | ||
|
||
Goal: Semantically annotate a JSON schema | ||
|
||
### Steps | ||
- rename `context.example` to `context.jsonld` | ||
- run build | ||
- run viewer | ||
- navigate to "Exercise 2"/Examples | ||
- choose "RDF/Turtle" to see generated RDF | ||
- view "semantic uplift" | ||
- view validation results at [build-local/...](/register/build-local/tests/bbr/template/exercise2/_report.json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$schema: https://raw.githubusercontent.com/opengeospatial/bblocks-postprocess/refs/heads/master/ogc/bblocks/schemas/examples.schema.yaml | ||
## Prefixes for examples | ||
#prefixes: | ||
# mynamespace: http://example.com/mythings/ | ||
## List of examples | ||
examples: | ||
- title: Reference a local file for examples | ||
content: |- | ||
[Example from mySchema](../../mySchema/example.json) | ||
In **Markdown** format. | ||
snippets: | ||
- language: json | ||
ref: ../mySchema/example.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$schema: https://json-schema.org/draft/2020-12/schema | ||
description: My example schema | ||
type: object | ||
properties: | ||
a: | ||
type: string | ||
format: uri | ||
b: | ||
type: number | ||
c: | ||
type: number | ||
required: | ||
- a | ||
- b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "metaschema.yaml", | ||
"name": "Exercise 3", | ||
"highlighted": true, | ||
"abstract": "Add logical rules", | ||
"status": "under-development", | ||
"dateTimeAddition": "2023-04-05T00:00:00Z", | ||
"itemClass": "model", | ||
"register": "ogc-building-block-register", | ||
"version": "0.1", | ||
"dateOfLastChange": "2023-04-05", | ||
"link": "https://github.com/opengeospatial/bblock-template", | ||
"sources": [ | ||
{ | ||
"title": "Sample source document", | ||
"link": "https://example.com/sources/1" | ||
} | ||
], | ||
"maturity": "mature", | ||
"scope": "unstable", | ||
"tags": [ | ||
"templates" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@context": { | ||
"mynamespace": "http://example.org/ns1/", | ||
"a": "@type", | ||
"b": "https://example.org/my-bb-model/b", | ||
"c": "https://example.org/my-bb-model/c" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Exercise 3 | ||
|
||
Goal: Validate logical rules | ||
|
||
### Steps | ||
- rename `rules.example` to `rules.shacl` | ||
- run build | ||
- run viewer | ||
- navigate to "Exercise 3"/Validation | ||
- view validation results at [Validation Report](../validation) or [build-local/...](/register/build-local/tests/bbr/template/exercise3/_report.json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$schema: https://raw.githubusercontent.com/opengeospatial/bblocks-postprocess/refs/heads/master/ogc/bblocks/schemas/examples.schema.yaml | ||
## Prefixes for examples | ||
prefixes: | ||
mynamespace: http://example.org/ns1/ | ||
## List of examples | ||
examples: | ||
- title: Reference a local file for examples | ||
content: |- | ||
[Example from mySchema](../../mySchema/example.json) | ||
In **Markdown** format. | ||
snippets: | ||
- language: json | ||
ref: ../mySchema/example.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix mynamespace: <http://example.org/ns1/> . | ||
@prefix ns1: <https://example.org/my-bb-model/> . | ||
@base <https://www.ogc.org/rules/template/> . | ||
|
||
<#testValues> | ||
a sh:NodeShape ; | ||
sh:targetClass mynamespace:aThing ; | ||
sh:message "C must be greater than B" ; | ||
sh:property [ sh:path ns1:c ; | ||
sh:lessThan ns1:b ] | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$schema: https://json-schema.org/draft/2020-12/schema | ||
description: My example schema | ||
type: object | ||
properties: | ||
a: | ||
type: string | ||
format: uri | ||
b: | ||
type: number | ||
c: | ||
type: number | ||
required: | ||
- a | ||
- b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "metaschema.yaml", | ||
"name": "Exercise 4", | ||
"highlighted": true, | ||
"abstract": "Profile with rules", | ||
"status": "under-development", | ||
"dateTimeAddition": "2023-04-05T00:00:00Z", | ||
"itemClass": "model", | ||
"register": "ogc-building-block-register", | ||
"version": "0.1", | ||
"dateOfLastChange": "2023-04-05", | ||
"link": "https://github.com/opengeospatial/bblock-template", | ||
"sources": [ | ||
{ | ||
"title": "Sample source document", | ||
"link": "https://example.com/sources/1" | ||
} | ||
], | ||
"maturity": "mature", | ||
"scope": "unstable", | ||
"tags": [ | ||
"templates" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Exercise 3 | ||
|
||
Goal: Profile a building block with additional rules, with tests | ||
|
||
Note this illustrates how to use examples to test rules fail when expected. This is a critical capability for complex systems. | ||
|
||
### Steps | ||
- uncomment import from schema.yaml | ||
- run build | ||
- run viewer | ||
- navigate to "Exercise 4"/Validation | ||
- view validation results at [Validation Report](validation) or [build-local/...](/register/build-local/tests/bbr/template/exercise3/_report.json) | ||
- move `examples/*-fail` to `tests` | ||
- run build | ||
- run viewer | ||
- view validation results at [Validation Report](validation) or [build-local/...](/register/build-local/tests/bbr/template/exercise3/_report.json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
$schema: https://raw.githubusercontent.com/opengeospatial/bblocks-postprocess/refs/heads/master/ogc/bblocks/schemas/examples.schema.yaml | ||
## Prefixes for examples | ||
prefixes: | ||
mynamespace: http://example.org/ns1/ | ||
## List of examples | ||
examples: | ||
- title: Valid under new rule | ||
|
||
snippets: | ||
- language: json | ||
ref: examples/example_b_lt_5.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"a": "mynamespace:aThing", | ||
"b": 4, | ||
"c": 1 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"a": "mynamespace:aThing", | ||
"b": 6, | ||
"c": 1 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"a": "mynamespace:aThing", | ||
"b": 6, | ||
"c": 10 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix mynamespace: <http://example.org/ns1/> . | ||
@prefix ns1: <https://example.org/my-bb-model/> . | ||
@base <https://www.ogc.org/rules/template/> . | ||
|
||
<#testValues> | ||
a sh:NodeShape ; | ||
sh:targetClass mynamespace:aThing ; | ||
sh:message "B must not be less than 5" ; | ||
sh:property [ sh:path ns1:b ; | ||
sh:minInclusive 5 ] | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$schema: https://json-schema.org/draft/2020-12/schema | ||
# $ref: bblocks://ogc.bbr.template.exercise3 |
4 changes: 2 additions & 2 deletions
4
_sources/myFeature/bblock.json → _sources/exercise5/bblock.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Using a standard container | ||
|
||
This is an **interoperable** approach to packaging a data model in a standardised structure. | ||
|
||
i.e. the attributes (properties) are managed independently of the packaging container (Feature) | ||
|
||
In this case we use the schema from the previous examples. | ||
|
||
This building block **inherits** reusable semantic annotations from a common library, simplifying implementation. | ||
|
||
### Steps | ||
- uncomment the reference to the previous exercise schema in schema.yaml | ||
- run build, view etc | ||
- examine "Semantic Uplift" and note that event though no `context.jsonld` is present the building block inherits and combines the two building blocks semantic annotations. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$schema: https://raw.githubusercontent.com/opengeospatial/bblocks-postprocess/refs/heads/master/ogc/bblocks/schemas/examples.schema.yaml | ||
description: Example of a simple GeoJSON Feature specialisation | ||
allOf: | ||
- $ref: bblocks://ogc.geo.features.feature | ||
# - properties: | ||
# properties: | ||
# $ref: ../exercise4/schema.yaml | ||
|
File renamed without changes.
Oops, something went wrong.