diff --git a/services/ontology/schemas/fieldAccessGrant.json b/services/ontology/schemas/fieldAccessGrant.json new file mode 100644 index 000000000..b408222f4 --- /dev/null +++ b/services/ontology/schemas/fieldAccessGrant.json @@ -0,0 +1,87 @@ +{ + "$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", + "domain": "agriculture", + "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..b3ea24979 --- /dev/null +++ b/services/ontology/schemas/fieldBoundary.json @@ -0,0 +1,429 @@ +{ + "$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", + "domain": "agriculture", + "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..7f858c6d0 --- /dev/null +++ b/services/ontology/schemas/fieldClaim.json @@ -0,0 +1,109 @@ +{ + "$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", + "domain": "agriculture", + "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..4d58466cd --- /dev/null +++ b/services/ontology/schemas/fieldLink.json @@ -0,0 +1,74 @@ +{ + "$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", + "domain": "agriculture", + "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..7db43813d --- /dev/null +++ b/services/ontology/schemas/logicalField.json @@ -0,0 +1,271 @@ +{ + "$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", + "domain": "agriculture", + "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..7e982c03e --- /dev/null +++ b/services/ontology/schemas/mediaAsset.json @@ -0,0 +1,88 @@ +{ + "$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", + "domain": "agriculture", + "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..7b76f91d9 --- /dev/null +++ b/services/ontology/schemas/observation.json @@ -0,0 +1,296 @@ +{ + "$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", + "domain": "agriculture", + "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..e7e81dd1a --- /dev/null +++ b/services/ontology/schemas/observationAttributes.json @@ -0,0 +1,83 @@ +{ + "$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", + "domain": "agriculture", + "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..19548a498 --- /dev/null +++ b/services/ontology/schemas/observationRelation.json @@ -0,0 +1,76 @@ +{ + "$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", + "domain": "agriculture", + "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 +}