diff --git a/examples/EntityTemportal-example_C5.5.3.json b/examples/EntityTemporal-example_C5.5.3.json similarity index 100% rename from examples/EntityTemportal-example_C5.5.3.json rename to examples/EntityTemporal-example_C5.5.3.json diff --git a/examples/OffStreetParking_C2.3.json b/examples/OffStreetParking_C2.3.json index 4e6918f52a18722e40b62b5c023ccf61ebe6444f..af6a0590bdedde040c0be23372848b2029e43ef9 100644 --- a/examples/OffStreetParking_C2.3.json +++ b/examples/OffStreetParking_C2.3.json @@ -8,7 +8,7 @@ "availableSpotNumber": { "type": "Property", "value": 121, - "observedAt": "2017-07-29T12:05:02", + "observedAt": "2017-07-29T12:05:02Z", "reliability": { "type": "Property", "value": 0.7 diff --git a/examples/Vehicle_C2.2.js b/examples/Vehicle_C2.2.json similarity index 93% rename from examples/Vehicle_C2.2.js rename to examples/Vehicle_C2.2.json index 858bf6e812d9951b150cd4d0f898feee0e1a989a..4e062b217bec2256eafa0a9582ce02f5835a2f66 100644 --- a/examples/Vehicle_C2.2.js +++ b/examples/Vehicle_C2.2.json @@ -8,7 +8,7 @@ "isParked": { "type": "Relationship", "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04", + "observedAt": "2017-07-29T12:00:04Z", "providedBy": { "type": "Relationship", "object": "urn:ngsi-ld:Person:Bob" diff --git a/schema/Entity.json b/schema/Entity.json index c98fd98469f5f1dcf82dc2e4cb9144f07fa28726..492b652e749a65c3e1ab17283e29cd635ef14777 100644 --- a/schema/Entity.json +++ b/schema/Entity.json @@ -184,6 +184,6 @@ }, "propertyNames": { "type": "string", - "pattern": "^((\\d|[a-zA-Z]|_)+(#\\d+)?)$" + "pattern": "^((\\d|[a-zA-Z]|_)+(#\\d+)?)$|^(@context)$" } } diff --git a/schema/Entity_keyValues.json b/schema/Entity_keyValues.json index e78d348fa046df2192ee9917c8c0747ba9c7b1b1..a1f88391dd55967e9863d69a29c7496fa939d2d9 100644 --- a/schema/Entity_keyValues.json +++ b/schema/Entity_keyValues.json @@ -46,6 +46,6 @@ }, "propertyNames": { "type": "string", - "pattern": "^((\\d|[a-zA-Z]|_)+(#\\d+)?)$" + "pattern": "^((\\d|[a-zA-Z]|_)+(#\\d+)?)$|^(@context)$" } } diff --git a/scripts/validate_examples.sh b/scripts/validate_examples.sh new file mode 100755 index 0000000000000000000000000000000000000000..f9667d96de34e184d00a10279f429d84f2aaff14 --- /dev/null +++ b/scripts/validate_examples.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +ajv validate -s $SCHEMAS/Entity.json -d $EXAMPLES/Entity-example.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + +ajv validate -s $SCHEMAS/Entity.json -d $EXAMPLES/Vehicle_C2.2.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + +ajv validate -s $SCHEMAS/Entity.json -d $EXAMPLES/OffStreetParking_C2.3.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + +ajv validate -s $SCHEMAS/Entity_keyValues.json -d -d $EXAMPLES/Vehicle_keyValues_C2.2.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + +ajv compile -s $SCHEMAS/subscriptions/Subscription.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + +ajv compile -s $SCHEMAS/temporal/EntityTemporal.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json + +ajv compile -s $SCHEMAS/registrations/ContextSourceRegistration.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + +ajv compile -s $SCHEMAS/subscriptions/Notification.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json + +ajv compile -s $SCHEMAS/registrations/ContextSourceNotification.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/registrations/ContextSourceRegistration.json + +ajv compile -s $SCHEMAS/EntityList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json + +ajv compile -s $SCHEMAS/temporal/EntityTemporalList.json -r $SCHEMAS/temporal/EntityTemporal.json -r $SCHEMAS/Entity.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + +ajv compile -s $SCHEMAS/BatchOperationResult.json -r $SCHEMAS/common.json + +ajv compile -s $SCHEMAS/UpdateResult.json + + + +ajv compile -s $SCHEMAS/temporal/Entity_temporalValues.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json +