Skip to content

Commit a8bfeb6

Browse files
committed
new bbs and skills
1 parent ff024e3 commit a8bfeb6

71 files changed

Lines changed: 4137 additions & 518 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/building-block-generator.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ You are an OGC Building Block generation and validation specialist.
6161
- Add links to standards and specifications
6262
- Declare conformance to OGC standards
6363

64+
- **Validator-Safe Metadata Defaults**:
65+
- Do not add metadata entries that duplicate default local artifact discovery by the postprocessor
66+
- For model blocks, if the ontology is the local default file `ontology.ttl`, do not also set `"ontology": "ontology.ttl"` in `bblock.json`
67+
- For schema blocks, do not add `"examples": "examples.yaml"` as a string in `bblock.json`
68+
- Prefer the repository-default artifact names and let the postprocessor discover them automatically unless an external URL is truly required
69+
- When declaring `dependsOn` or `bblocks://...` references for local repository blocks, always use the fully qualified building block identifier, not a folder-name shorthand
70+
- If transformer or description metadata stores a target building block id, normalize it to the fully qualified identifier before writing files
71+
- For schema-block `context.jsonld`, only emit term definitions for actual output/schema property names, use conservative JSON-LD keys (`@id`, `@type`, `@container`, `@vocab`), and avoid unsupported keys such as `@label`
72+
- Avoid raw source-column labels with spaces, brackets, or punctuation as JSON-LD term names unless they are explicitly required and known to validate
73+
6474
- **Validation & Compliance Checking**:
6575
- Run Docker-based OGC Building Blocks postprocessor
6676
- Validate bblock.json against OGC metadata schema
@@ -75,6 +85,7 @@ You are an OGC Building Block generation and validation specialist.
7585
- Declare dependencies on other building blocks (e.g., OIM, OGC-standard blocks)
7686
- Generate proper dependsOn arrays in bblock.json
7787
- Validate that dependencies are resolvable
88+
- When given a published dependency/import site URL, resolve it to a machine-readable register URL using `bblock-register-resolution`
7889

7990
## Workflow
8091

@@ -107,12 +118,17 @@ You are an OGC Building Block generation and validation specialist.
107118
- If any example was obtained through a retriever skill, include the exact request URL or source URL in `examples.yaml`
108119

109120
6. **Generate Block Files**:
110-
- Create `bblock.json` with metadata aligned to the chosen type
111-
- Write `description.md` and `examples.yaml`
112-
- Add schema/context files only for schema blocks
113-
- Add ontology/SHACL files only for model blocks
114-
- Generate `description.json` only when another toolchain explicitly needs it
115-
- Set up `examples/`, `tests/`, and optional `transforms/` directories
121+
- Create `bblock.json` with metadata aligned to the chosen type
122+
- Write `description.md` and `examples.yaml`
123+
- Add schema/context files only for schema blocks
124+
- Add ontology/SHACL files only for model blocks
125+
- Generate `description.json` only when another toolchain explicitly needs it
126+
- Set up `examples/`, `tests/`, and optional `transforms/` directories
127+
- Before writing metadata, apply validator-safe defaults:
128+
- omit explicit local-default `ontology` metadata for local `ontology.ttl`
129+
- omit string-valued `examples` metadata that points at `examples.yaml`
130+
- qualify all local dependency identifiers and `bblocks://` references
131+
- keep JSON-LD contexts minimal and schema-facing
116132

117133
7. **Validate & Test**:
118134
- Run Docker container validation
@@ -211,6 +227,13 @@ _sources/block-name/
211227
6. **Example Validation**: Load and parse examples, validate against schema or SHACL, and check geometry types only where relevant
212228
7. **Container-Based Validation**: Run `ghcr.io/opengeospatial/bblocks-postprocess`, generate build artifacts
213229

230+
## Known Pitfalls To Avoid
231+
232+
- Do not use local shorthand ids like `macroobservation`, `gfw-fishing-events`, or `stac_multidim_data` in validator-facing metadata when the repository expects fully qualified identifiers.
233+
- Do not emit local-artifact pointers in `bblock.json` when the postprocessor already auto-discovers the same file.
234+
- Do not generate JSON-LD contexts from raw CSV header labels unless those terms are transformed into safe schema-facing names first.
235+
- Do not add non-JSON-LD term-definition keys just for display convenience.
236+
214237
## Dependencies & Related Agents
215238

216239
- Routes auxiliary validation and metadata tasks through `marine-workflow-orchestrator`

.claude/agents/validation-agent.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ docker run --rm \
6565

6666
## Related Skills
6767

68-
- `bblock-container-validation` - Docker commands, troubleshooting, memory configuration
68+
- `bblock-container-validation` - Docker commands, troubleshooting, memory configuration
69+
- `bblock-register-resolution` - resolve published dependency/import URLs to machine-readable register JSON endpoints
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: bblock-register-resolution
3+
description: Use when resolving OGC Building Block dependencies or repository imports from a published URL. Normalizes a human-facing site URL to machine-readable register endpoints by trying `<url>/build/register.json` first, then `<url>/register.json`, and only treating the base URL as documentation unless it already returns JSON.
4+
---
5+
6+
# Building Block Register Resolution Skill
7+
8+
Use this skill when a building block dependency, `imports:` entry, or external bblock reference is given as a site URL and you need the actual machine-readable register.
9+
10+
## Resolution Order
11+
12+
Given a base URL `u`:
13+
14+
1. Normalize by removing a trailing slash for testing, then reconstruct candidate URLs.
15+
2. Try `u/build/register.json`.
16+
3. Try `u/register.json`.
17+
4. Only use `u` directly if it already returns JSON.
18+
19+
For each candidate:
20+
21+
- Prefer `HEAD` or `GET` checks.
22+
- Treat it as valid when it returns `200` and `Content-Type` includes `application/json`.
23+
- Do not assume `Accept: application/json` on the base URL will work; GitHub Pages sites often still return HTML.
24+
25+
## Expected Output
26+
27+
Return:
28+
29+
- the original URL
30+
- the resolved register URL
31+
- the check performed
32+
- whether JSON was confirmed
33+
34+
Example:
35+
36+
- input: `https://ogcincubator.github.io/bblocks-openscience/`
37+
- resolved: `https://ogcincubator.github.io/bblocks-openscience/build/register.json`
38+
39+
## When To Apply
40+
41+
- `Invalid reference to bblock ... perhaps an import is missing?`
42+
- adding or fixing `bblocks-config.yaml` `imports:`
43+
- resolving remote dependencies for validation
44+
- mapping user-provided documentation URLs to actual bblock registers
45+
46+
## Notes
47+
48+
- Prefer explicit JSON register URLs in machine-facing config.
49+
- Keep the human-facing site URL only for documentation or provenance.
50+
- If both `/build/register.json` and `/register.json` fail, report that clearly rather than guessing.

_sources/_staging/helcom vscfile to Geojson representation/bblock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"ldContext": "context.jsonld",
3030
"tests": "tests/test.yaml",
3131
"dependsOn": [
32-
"macroobservation"
32+
"ogc.hosted.iliad.api.features.macroobservation"
3333
],
3434
"shaclRules": [],
3535
"sources": [
@@ -39,4 +39,4 @@
3939
}
4040
],
4141
"scope": "dev"
42-
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "helcom_data_transformation",
3+
"version": "0.1.0",
4+
"dateTimeAddition": "2026-04-27T13:04:47Z",
5+
"status": "under-development",
6+
"itemClass": "schema",
7+
"register": "ogc-incubator",
8+
"dateOfLastChange": "2026-04-27",
9+
"abstract": "Auto-generated bblock from a csv source.",
10+
"license": "https://creativecommons.org/licenses/by/4.0/",
11+
"tags": [
12+
"csv",
13+
"checkin"
14+
],
15+
"authors": [
16+
{
17+
"name": "ILIAD check-in tool",
18+
"organization": "ILIAD",
19+
"email": "info@example.com"
20+
}
21+
],
22+
"standards": [
23+
"https://www.opengis.net/def/standard/geojson",
24+
"https://www.w3.org/TR/sosa/",
25+
"http://www.w3.org/TR/vocab-dcat-2/",
26+
"http://www.w3.org/TR/skos-reference/",
27+
"http://www.opengis.net/def/crs/OGC/1.3/CRS84"
28+
],
29+
"ldContext": "context.jsonld",
30+
"tests": "tests/test.yaml",
31+
"dependsOn": [
32+
"ogc.hosted.iliad.api.features.macroobservation"
33+
],
34+
"shaclRules": [],
35+
"sources": [
36+
{
37+
"title": "source",
38+
"local_path": "/tmp/helcom_sample.csv"
39+
}
40+
],
41+
"scope": "dev"
42+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"@context": {
3+
"id": {
4+
"@id": "https://schema.org/identifier",
5+
"@label": "id"
6+
},
7+
"lon": {
8+
"@id": "http://www.w3.org/2003/01/geo/wgs84_pos#long",
9+
"@label": "lon"
10+
},
11+
"lat": {
12+
"@id": "http://www.w3.org/2003/01/geo/wgs84_pos#lat",
13+
"@label": "lat"
14+
},
15+
"observationTime": {
16+
"@id": "http://rs.tdwg.org/dwc/terms/eventTime",
17+
"@label": "event time"
18+
},
19+
"species": {
20+
"@id": "http://rs.tdwg.org/dwc/terms/scientificName",
21+
"@label": "species"
22+
},
23+
"depth_m": {
24+
"@id": "http://vocab.nerc.ac.uk/collection/P01/current/DEPHZZ01",
25+
"@label": "depth_m"
26+
},
27+
"salinity_psu": {
28+
"@id": "http://vocab.nerc.ac.uk/collection/P01/current/PSALST01",
29+
"@label": "salinity_psu"
30+
},
31+
"abundance": {
32+
"@id": "http://vocab.nerc.ac.uk/collection/P06",
33+
"@label": "abundance"
34+
},
35+
"@vocab": "https://w3id.org/iliad/checkin/"
36+
}
37+
}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"title": "helcom_data_transformation",
3+
"abstract": "Auto-generated bblock from a csv source.",
4+
"source": {
5+
"title": "source",
6+
"local_path": "/tmp/helcom_sample.csv"
7+
},
8+
"transformer": {
9+
"kind": "library",
10+
"id": "json-to-nested-json",
11+
"params": {
12+
"target_template": {},
13+
"mappings": [
14+
{
15+
"expression": "{\"type\":\"Point\",\"coordinates\":[${lon},${lat}]}",
16+
"target": "features[].geometry",
17+
"type": "object"
18+
},
19+
{
20+
"expression": "\"low\"",
21+
"target": "features[].properties.abundance",
22+
"type": "string"
23+
},
24+
{
25+
"source": "depth_m",
26+
"target": "features[].properties.depth_m",
27+
"type": "number"
28+
},
29+
{
30+
"source": "time",
31+
"target": "features[].properties.observationTime",
32+
"type": "string"
33+
},
34+
{
35+
"expression": "\"HELCOM OWS\"",
36+
"target": "features[].properties.provenance_urls",
37+
"type": "array"
38+
},
39+
{
40+
"source": "salinity_psu",
41+
"target": "features[].properties.salinity_psu",
42+
"type": "number"
43+
},
44+
{
45+
"expression": "\"HELCOM\"",
46+
"target": "features[].properties.source",
47+
"type": "string"
48+
},
49+
{
50+
"source": "species",
51+
"target": "features[].properties.species",
52+
"type": "string"
53+
},
54+
{
55+
"expression": "\"Feature\"",
56+
"target": "features[].type",
57+
"type": "string"
58+
},
59+
{
60+
"expression": "\"FeatureCollection\"",
61+
"target": "type",
62+
"type": "string"
63+
},
64+
{
65+
"source": "id",
66+
"target": "id"
67+
}
68+
],
69+
"passthrough_extras": false,
70+
"target_bblock": "macroobservation"
71+
}
72+
},
73+
"property_mappings": [
74+
{
75+
"property_name": "id",
76+
"uri": "https://schema.org/identifier",
77+
"label": "id",
78+
"source": "gfw-fishing-events/context.jsonld"
79+
},
80+
{
81+
"property_name": "lon",
82+
"uri": "http://www.w3.org/2003/01/geo/wgs84_pos#long",
83+
"label": "lon",
84+
"source": "gfw-fishing-events/context.jsonld"
85+
},
86+
{
87+
"property_name": "lat",
88+
"uri": "http://www.w3.org/2003/01/geo/wgs84_pos#lat",
89+
"label": "lat",
90+
"source": "gfw-fishing-events/context.jsonld"
91+
},
92+
{
93+
"property_name": "observationTime",
94+
"uri": "http://rs.tdwg.org/dwc/terms/eventTime",
95+
"label": "event time",
96+
"source": "OIM/oceanCommon.ttl"
97+
},
98+
{
99+
"property_name": "species",
100+
"uri": "http://rs.tdwg.org/dwc/terms/scientificName",
101+
"label": "species",
102+
"source": "macroobservation/context.jsonld"
103+
},
104+
{
105+
"property_name": "depth_m",
106+
"uri": "http://vocab.nerc.ac.uk/collection/P01/current/DEPHZZ01",
107+
"label": "depth_m",
108+
"source": "macroobservation/context.jsonld"
109+
},
110+
{
111+
"property_name": "salinity_psu",
112+
"uri": "http://vocab.nerc.ac.uk/collection/P01/current/PSALST01",
113+
"label": "salinity_psu",
114+
"source": "macroobservation/context.jsonld"
115+
},
116+
{
117+
"property_name": "abundance",
118+
"uri": "http://vocab.nerc.ac.uk/collection/P06",
119+
"label": "abundance",
120+
"source": "macroobservation/context.jsonld"
121+
},
122+
{
123+
"property_name": "id",
124+
"uri": "https://schema.org/identifier",
125+
"label": "id",
126+
"source": "gfw-fishing-events/context.jsonld"
127+
}
128+
],
129+
"vocab_sources": {
130+
"local:coverageJSON": "0.1 (2023-12-07)",
131+
"local:coverageJSONFisheries": "0.1 (2024-04-23)",
132+
"local:coverage_information_model": "0.1 (2023-11-30)",
133+
"local:gfw-fishing-events": "0.1.0 (2026-04-22)",
134+
"local:iliad-jellyfish-features": "0.1 (2023-04-05)",
135+
"local:macroobservation": "0.1.0 (2025-09-22)",
136+
"local:marine-protected-area-emodnet": "1.0 (2025-09-22)",
137+
"local:oim-bio-tdwg": "0.1 (2023-04-05)",
138+
"local:oim-obs": "0.1 (2023-04-05)",
139+
"local:oim-obs-cs": "0.1 (2023-04-05)",
140+
"local:oim-sta-obs": "0.1 (2023-06-05)",
141+
"local:stac_multidim_data": "0.1 (2024-10-11)",
142+
"local:tst-inventory-seadots": "0.1.0 (2026-04-24)",
143+
"local:zarr_array_metadata": "0.1 (2024-09-25)",
144+
"local:zarr_attrs_metadata": "0.1 (2024-09-25)",
145+
"local:zarr_attrs_sdn": "0.1 (2025-01-25)",
146+
"oim:cross-domain": "3.0 (2024-09-06T09:21:36Z)",
147+
"oim:metadata": "1.0 (2024-09-06T09:21:36Z)",
148+
"oim:oceanCommon": "1.0 (2024-09-06T09:21:36Z)",
149+
"oim:oceanProperty": "1.0 (2024-09-06T09:39:51Z)",
150+
"oim:oimOceanProfile": "1.0 (2024-09-06T09:21:36Z)"
151+
},
152+
"custom_vocab_urls": []
153+
}

0 commit comments

Comments
 (0)