From 4286d09458e892466cd028a37b9c219e228c980e Mon Sep 17 00:00:00 2001 From: stelspeh Date: Tue, 8 Sep 2026 15:14:16 +0400 Subject: [PATCH 1/2] ontology: register AI Weed Library field & observation schemas (v2) Nine draft-07 JSON Schemas written by the AI Weed Library platform (Dutch crop-field map viewer): LogicalField, FieldBoundary, FieldClaim, FieldLink, Observation, ObservationRelation, MediaAsset, plus two app-profile types, ObservationAttributes (per-observation agronomic attributes and access policy sidecar) and FieldAccessGrant (field-share mechanics, v2 keyed on logicalFieldRef). Files are the artifacts emitted from the platform's contracts, added verbatim under services/ontology/schemas/ following the existing one-file-per-schema convention. The schemaIds are already in use by a running deployment and must not be renumbered. --- .../ontology/schemas/fieldAccessGrant.json | 86 ++++ services/ontology/schemas/fieldBoundary.json | 428 ++++++++++++++++++ services/ontology/schemas/fieldClaim.json | 108 +++++ services/ontology/schemas/fieldLink.json | 73 +++ services/ontology/schemas/logicalField.json | 270 +++++++++++ services/ontology/schemas/mediaAsset.json | 87 ++++ services/ontology/schemas/observation.json | 295 ++++++++++++ .../schemas/observationAttributes.json | 82 ++++ .../ontology/schemas/observationRelation.json | 75 +++ 9 files changed, 1504 insertions(+) create mode 100644 services/ontology/schemas/fieldAccessGrant.json create mode 100644 services/ontology/schemas/fieldBoundary.json create mode 100644 services/ontology/schemas/fieldClaim.json create mode 100644 services/ontology/schemas/fieldLink.json create mode 100644 services/ontology/schemas/logicalField.json create mode 100644 services/ontology/schemas/mediaAsset.json create mode 100644 services/ontology/schemas/observation.json create mode 100644 services/ontology/schemas/observationAttributes.json create mode 100644 services/ontology/schemas/observationRelation.json diff --git a/services/ontology/schemas/fieldAccessGrant.json b/services/ontology/schemas/fieldAccessGrant.json new file mode 100644 index 000000000..19d60995e --- /dev/null +++ b/services/ontology/schemas/fieldAccessGrant.json @@ -0,0 +1,86 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/63d0e376-2522-4799-b82d-990267965dd9", + "schemaId": "63d0e376-2522-4799-b82d-990267965dd9", + "title": "FieldAccessGrant", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "id": { + "type": "string", + "minLength": 1 + }, + "isReference": { + "type": "boolean" + }, + "ownerEname": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "canonicalOwnerEName": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "logicalFieldRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "granteeEname": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "role": { + "type": "string", + "enum": [ + "viewer", + "contributor", + "manager" + ] + }, + "grantedBy": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "canonicalEnvelopeId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "id", + "isReference", + "ownerEname", + "canonicalOwnerEName", + "logicalFieldRef", + "granteeEname", + "role", + "grantedBy", + "createdAt", + "updatedAt" + ], + "additionalProperties": false +} diff --git a/services/ontology/schemas/fieldBoundary.json b/services/ontology/schemas/fieldBoundary.json new file mode 100644 index 000000000..b7ba931b6 --- /dev/null +++ b/services/ontology/schemas/fieldBoundary.json @@ -0,0 +1,428 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/207a6b1a-19b4-468d-9641-68ba661c2291", + "schemaId": "207a6b1a-19b4-468d-9641-68ba661c2291", + "title": "FieldBoundary", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "source": { + "type": "string", + "minLength": 1 + }, + "externalId": { + "type": "string", + "minLength": 1 + }, + "validFrom": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "validTo": { + "anyOf": [ + { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + { + "type": "null" + } + ] + }, + "geometry": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Point" + }, + "coordinates": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPoint" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "LineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiLineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Polygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPolygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + } + ] + }, + "sourceGeometry": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Point" + }, + "coordinates": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPoint" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "LineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiLineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Polygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPolygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + } + ] + }, + "sourceCrs": { + "type": "string", + "pattern": "^EPSG:\\d+$" + }, + "sourceAttributes": { + "type": "object", + "additionalProperties": {} + }, + "areaHa": { + "type": "number", + "minimum": 0 + }, + "retrievedAt": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "source", + "externalId", + "validFrom", + "validTo", + "geometry" + ], + "additionalProperties": false, + "dependencies": { + "sourceGeometry": [ + "sourceCrs" + ] + } +} diff --git a/services/ontology/schemas/fieldClaim.json b/services/ontology/schemas/fieldClaim.json new file mode 100644 index 000000000..e131fe682 --- /dev/null +++ b/services/ontology/schemas/fieldClaim.json @@ -0,0 +1,108 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/f577eb36-8230-494d-866b-45af25e83f16", + "schemaId": "f577eb36-8230-494d-866b-45af25e83f16", + "title": "FieldClaim", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "logicalFieldRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "claimantRef": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "role": { + "type": "string", + "enum": [ + "owner", + "tenant", + "manager" + ] + }, + "validFrom": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "validTo": { + "anyOf": [ + { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + { + "type": "null" + } + ] + }, + "assertedBy": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "method": { + "type": "string", + "enum": [ + "user-confirmed", + "source-provided", + "geometry-derived" + ] + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "algorithm": { + "type": "string", + "minLength": 1 + }, + "algorithmVersion": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "logicalFieldRef", + "claimantRef", + "role", + "validFrom", + "validTo", + "assertedBy", + "method" + ], + "additionalProperties": false +} diff --git a/services/ontology/schemas/fieldLink.json b/services/ontology/schemas/fieldLink.json new file mode 100644 index 000000000..f0a5b0035 --- /dev/null +++ b/services/ontology/schemas/fieldLink.json @@ -0,0 +1,73 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/339723ce-4771-48d6-a7e1-a0fdf736d584", + "schemaId": "339723ce-4771-48d6-a7e1-a0fdf736d584", + "title": "FieldLink", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "logicalFieldRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "boundaryRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "relationType": { + "type": "string", + "enum": [ + "represents" + ] + }, + "method": { + "type": "string", + "enum": [ + "user-confirmed", + "source-provided", + "geometry-derived" + ] + }, + "assertedBy": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "algorithm": { + "type": "string", + "minLength": 1 + }, + "algorithmVersion": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "logicalFieldRef", + "boundaryRef", + "relationType", + "method", + "assertedBy" + ], + "additionalProperties": false +} diff --git a/services/ontology/schemas/logicalField.json b/services/ontology/schemas/logicalField.json new file mode 100644 index 000000000..6373a7ff2 --- /dev/null +++ b/services/ontology/schemas/logicalField.json @@ -0,0 +1,270 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/a1abfd8e-4f0a-4c1d-98de-f351586c03e8", + "schemaId": "a1abfd8e-4f0a-4c1d-98de-f351586c03e8", + "title": "LogicalField", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "validFrom": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "validTo": { + "anyOf": [ + { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string", + "minLength": 1 + }, + "geometry": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Point" + }, + "coordinates": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPoint" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "LineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiLineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Polygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPolygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + } + ] + }, + "geometryProvenance": { + "type": "string", + "enum": [ + "farmer-drawn", + "link-union", + "imported" + ] + }, + "stableExternalIDs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source": { + "type": "string", + "minLength": 1 + }, + "externalId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "source", + "externalId" + ], + "additionalProperties": false + } + }, + "notes": { + "type": "string" + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "validFrom", + "validTo" + ], + "additionalProperties": false, + "dependencies": { + "geometry": [ + "geometryProvenance" + ] + } +} diff --git a/services/ontology/schemas/mediaAsset.json b/services/ontology/schemas/mediaAsset.json new file mode 100644 index 000000000..762722a28 --- /dev/null +++ b/services/ontology/schemas/mediaAsset.json @@ -0,0 +1,87 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/65586839-24ad-4875-921e-578e3c284a0f", + "schemaId": "65586839-24ad-4875-921e-578e3c284a0f", + "title": "MediaAsset", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "fileRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "observationRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "capturedAt": { + "type": "string", + "format": "date-time" + }, + "geometry": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Point" + }, + "coordinates": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + "geometryProvenance": { + "type": "string", + "enum": [ + "exif", + "filename", + "manual", + "derived" + ] + }, + "width": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "height": { + "type": "integer", + "exclusiveMinimum": 0 + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "fileRef", + "observationRef" + ], + "additionalProperties": false, + "dependencies": { + "geometry": [ + "geometryProvenance" + ] + } +} diff --git a/services/ontology/schemas/observation.json b/services/ontology/schemas/observation.json new file mode 100644 index 000000000..9a59bbed9 --- /dev/null +++ b/services/ontology/schemas/observation.json @@ -0,0 +1,295 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/a9723f8c-9aa1-48ff-9698-9447353736c3", + "schemaId": "a9723f8c-9aa1-48ff-9698-9447353736c3", + "title": "Observation", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "type": { + "type": "string", + "minLength": 1 + }, + "phenomenonTime": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "start", + "end" + ], + "additionalProperties": false + } + ] + }, + "resultTime": { + "type": "string", + "format": "date-time" + }, + "deviceRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "sourceClass": { + "type": "string", + "minLength": 1 + }, + "footprint": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Point" + }, + "coordinates": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPoint" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "LineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiLineString" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 2 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Polygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "MultiPolygon" + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + }, + "minItems": 4 + } + } + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + } + ] + }, + "footprintType": { + "type": "string", + "enum": [ + "exact", + "bbox", + "centroid", + "unknown" + ] + }, + "pinPoint": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Point" + }, + "coordinates": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 3 + } + }, + "required": [ + "type", + "coordinates" + ], + "additionalProperties": false + }, + "result": {}, + "observedBy": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "uploadedBy": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "batchUid": { + "type": "string", + "minLength": 1 + }, + "datasetName": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "type", + "phenomenonTime", + "observedBy", + "uploadedBy" + ], + "additionalProperties": false, + "dependencies": { + "footprint": [ + "footprintType" + ] + } +} diff --git a/services/ontology/schemas/observationAttributes.json b/services/ontology/schemas/observationAttributes.json new file mode 100644 index 000000000..d8e11a8c5 --- /dev/null +++ b/services/ontology/schemas/observationAttributes.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/bef1033f-ecbd-4ffd-a36a-e30fe521f2ef", + "schemaId": "bef1033f-ecbd-4ffd-a36a-e30fe521f2ef", + "title": "ObservationAttributes", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "observationRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "attributes": { + "type": "object", + "properties": { + "crop": { + "type": "string", + "minLength": 1 + }, + "sowingDate": { + "type": "string", + "format": "date" + }, + "weeds": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "priceEur": { + "type": "number" + }, + "comment": { + "type": "string" + }, + "device": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false + }, + "accessLevel": { + "type": "string", + "enum": [ + "private", + "public", + "selective" + ] + }, + "allowedEnames": { + "type": "array", + "items": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "maxItems": 200 + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "observationRef", + "accessLevel" + ], + "additionalProperties": false +} diff --git a/services/ontology/schemas/observationRelation.json b/services/ontology/schemas/observationRelation.json new file mode 100644 index 000000000..602868ac6 --- /dev/null +++ b/services/ontology/schemas/observationRelation.json @@ -0,0 +1,75 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://ontology.w3ds.metastate.foundation/schemas/772ea2b3-82e7-4ce3-9a4d-a4445c57bd6c", + "schemaId": "772ea2b3-82e7-4ce3-9a4d-a4445c57bd6c", + "title": "ObservationRelation", + "type": "object", + "properties": { + "schemaVersion": { + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+$" + }, + "recordedAt": { + "type": "string", + "format": "date-time" + }, + "supersedes": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "deleted": { + "type": "boolean" + }, + "observationRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "logicalFieldRef": { + "type": "string", + "pattern": "^w3ds:\\/\\/(@[^/\\s]+)\\/([^/\\s]+)$" + }, + "relationType": { + "type": "string", + "enum": [ + "about", + "covers", + "intersects" + ] + }, + "method": { + "type": "string", + "enum": [ + "user-confirmed", + "source-provided", + "geometry-derived" + ] + }, + "assertedBy": { + "type": "string", + "pattern": "^@?[^\\s/@][^\\s/]*$" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "algorithm": { + "type": "string", + "minLength": 1 + }, + "algorithmVersion": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "schemaVersion", + "recordedAt", + "observationRef", + "logicalFieldRef", + "relationType", + "method", + "assertedBy" + ], + "additionalProperties": false +} From eec34c7bb51ce3495e7428c7416e067ec0a09b0e Mon Sep 17 00:00:00 2001 From: stelspeh Date: Wed, 9 Sep 2026 16:06:19 +0400 Subject: [PATCH 2/2] ontology: declare the agriculture domain on the nine schemas The registry groups types by domain and grants a platform access one domain at a time, so a type without one sits outside that mechanism. All nine are farmland data, and `agriculture` is already in the published Domain list. Emitted from the platform's contracts, so the same value is now in the artifacts the platform ships. --- services/ontology/schemas/fieldAccessGrant.json | 1 + services/ontology/schemas/fieldBoundary.json | 1 + services/ontology/schemas/fieldClaim.json | 1 + services/ontology/schemas/fieldLink.json | 1 + services/ontology/schemas/logicalField.json | 1 + services/ontology/schemas/mediaAsset.json | 1 + services/ontology/schemas/observation.json | 1 + services/ontology/schemas/observationAttributes.json | 1 + services/ontology/schemas/observationRelation.json | 1 + 9 files changed, 9 insertions(+) diff --git a/services/ontology/schemas/fieldAccessGrant.json b/services/ontology/schemas/fieldAccessGrant.json index 19d60995e..b408222f4 100644 --- a/services/ontology/schemas/fieldAccessGrant.json +++ b/services/ontology/schemas/fieldAccessGrant.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/63d0e376-2522-4799-b82d-990267965dd9", "schemaId": "63d0e376-2522-4799-b82d-990267965dd9", "title": "FieldAccessGrant", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/fieldBoundary.json b/services/ontology/schemas/fieldBoundary.json index b7ba931b6..b3ea24979 100644 --- a/services/ontology/schemas/fieldBoundary.json +++ b/services/ontology/schemas/fieldBoundary.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/207a6b1a-19b4-468d-9641-68ba661c2291", "schemaId": "207a6b1a-19b4-468d-9641-68ba661c2291", "title": "FieldBoundary", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/fieldClaim.json b/services/ontology/schemas/fieldClaim.json index e131fe682..7f858c6d0 100644 --- a/services/ontology/schemas/fieldClaim.json +++ b/services/ontology/schemas/fieldClaim.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/f577eb36-8230-494d-866b-45af25e83f16", "schemaId": "f577eb36-8230-494d-866b-45af25e83f16", "title": "FieldClaim", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/fieldLink.json b/services/ontology/schemas/fieldLink.json index f0a5b0035..4d58466cd 100644 --- a/services/ontology/schemas/fieldLink.json +++ b/services/ontology/schemas/fieldLink.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/339723ce-4771-48d6-a7e1-a0fdf736d584", "schemaId": "339723ce-4771-48d6-a7e1-a0fdf736d584", "title": "FieldLink", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/logicalField.json b/services/ontology/schemas/logicalField.json index 6373a7ff2..7db43813d 100644 --- a/services/ontology/schemas/logicalField.json +++ b/services/ontology/schemas/logicalField.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/a1abfd8e-4f0a-4c1d-98de-f351586c03e8", "schemaId": "a1abfd8e-4f0a-4c1d-98de-f351586c03e8", "title": "LogicalField", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/mediaAsset.json b/services/ontology/schemas/mediaAsset.json index 762722a28..7e982c03e 100644 --- a/services/ontology/schemas/mediaAsset.json +++ b/services/ontology/schemas/mediaAsset.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/65586839-24ad-4875-921e-578e3c284a0f", "schemaId": "65586839-24ad-4875-921e-578e3c284a0f", "title": "MediaAsset", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/observation.json b/services/ontology/schemas/observation.json index 9a59bbed9..7b76f91d9 100644 --- a/services/ontology/schemas/observation.json +++ b/services/ontology/schemas/observation.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/a9723f8c-9aa1-48ff-9698-9447353736c3", "schemaId": "a9723f8c-9aa1-48ff-9698-9447353736c3", "title": "Observation", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/observationAttributes.json b/services/ontology/schemas/observationAttributes.json index d8e11a8c5..e7e81dd1a 100644 --- a/services/ontology/schemas/observationAttributes.json +++ b/services/ontology/schemas/observationAttributes.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/bef1033f-ecbd-4ffd-a36a-e30fe521f2ef", "schemaId": "bef1033f-ecbd-4ffd-a36a-e30fe521f2ef", "title": "ObservationAttributes", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": { diff --git a/services/ontology/schemas/observationRelation.json b/services/ontology/schemas/observationRelation.json index 602868ac6..19548a498 100644 --- a/services/ontology/schemas/observationRelation.json +++ b/services/ontology/schemas/observationRelation.json @@ -3,6 +3,7 @@ "$id": "https://ontology.w3ds.metastate.foundation/schemas/772ea2b3-82e7-4ce3-9a4d-a4445c57bd6c", "schemaId": "772ea2b3-82e7-4ce3-9a4d-a4445c57bd6c", "title": "ObservationRelation", + "domain": "agriculture", "type": "object", "properties": { "schemaVersion": {