diff --git a/examples/ContextSourceRegistration-example_C.3.json b/examples/ContextSourceRegistration-example_C.3.json index 7180da3a1d20f7136f2f8940f5866744cbc3acf1..698144e2746fece1b260fe4a46e87f2499f9b99e 100644 --- a/examples/ContextSourceRegistration-example_C.3.json +++ b/examples/ContextSourceRegistration-example_C.3.json @@ -65,9 +65,9 @@ ] ] }, - "timestamp": { - "start": " 2017-11-29T14:53:15" - }, + "timestamp": [{ + "start": "2017-11-29T14:53:15Z" + }], "@context": [ "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", "http://example.org/cim/commonTerms.jsonld", diff --git a/examples/EntityTemporal-example_C5.5.3.json b/examples/EntityTemporal-example_C5.5.3.json index 89bcacda6e9c2e2f754bf01ab5f72cb694b4b465..1e871c615d970cc2cb8220e4c4568cbb8658641a 100644 --- a/examples/EntityTemporal-example_C5.5.3.json +++ b/examples/EntityTemporal-example_C5.5.3.json @@ -11,17 +11,17 @@ { "type": "Property", "value": 120, - "observedAt": "2018-08-01T12:03:00" + "observedAt": "2018-08-01T12:03:00Z" }, { "type": "Property", "value": 80, - "observedAt": "2018-08-01T12:05:00" + "observedAt": "2018-08-01T12:05:00Z" }, { "type": "Property", "value": 100, - "observedAt": "2018-08-01T12:07:00" + "observedAt": "2018-08-01T12:07:00Z" } ], "@context": [ diff --git a/examples/Entity_temporalValues_C.5.6.3.json b/examples/Entity_temporalValues_C.5.6.3.json index 75f0ffbc277721e0defd164ba11ec700bffbf534..73c068e2f09c267ccb193960d6d811f68705a83b 100644 --- a/examples/Entity_temporalValues_C.5.6.3.json +++ b/examples/Entity_temporalValues_C.5.6.3.json @@ -15,15 +15,15 @@ "values": [ [ 120, - "2018-08-01T12:03:00" + "2018-08-01T12:03:00Z" ], [ 80, - "2018-08-01T12:05:00" + "2018-08-01T12:05:00Z" ], [ 100, - "2018-08-01T12:07:00" + "2018-08-01T12:07:00Z" ] ] }, diff --git a/schema/subscriptions/Subscription.json b/schema/subscriptions/Subscription.json index eb1ee758836ad5edec91a988a29657c82bdfaacd..c18a37af77e8eaaef6ce428d1bba8a70b2767d1f 100644 --- a/schema/subscriptions/Subscription.json +++ b/schema/subscriptions/Subscription.json @@ -59,10 +59,10 @@ ], "properties": { "georel": { - "oneOf": [ + "anyOf": [ { "type": "string", - "enumeration": [ + "enum": [ "equals", "disjoint", "intersects", @@ -73,7 +73,7 @@ }, { "type": "string", - "pattern": "near;(maxDistance==\\d+)|(minDistance==\\d+)$" + "pattern": "^near;((maxDistance==\\d+)|(minDistance==\\d+))$" } ] }, diff --git a/schema/temporal/EntityTemporal.json b/schema/temporal/EntityTemporal.json index 526326bdc1417faa39859f8e0c9bb167538acb08..f601268bed0f665cc2bf2c598bbf7a4339192c85 100644 --- a/schema/temporal/EntityTemporal.json +++ b/schema/temporal/EntityTemporal.json @@ -57,5 +57,9 @@ "minItems": 1 } ] + }, + "propertyNames": { + "type": "string", + "pattern": "^((\\d|[a-zA-Z]|_)+(#\\d+)?)$|^(@context)$" } } diff --git a/schema/temporal/Entity_temporalValues.json b/schema/temporal/Entity_temporalValues.json index 190a7ab6cac054d627b28f87077ec7a39a9abeee..103904a0c3d586c52fe5698a8b60f22b16c124cb 100644 --- a/schema/temporal/Entity_temporalValues.json +++ b/schema/temporal/Entity_temporalValues.json @@ -116,6 +116,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 index f9667d96de34e184d00a10279f429d84f2aaff14..645803c1c864c54aab18b9bd23f8ea475198a484 100755 --- a/scripts/validate_examples.sh +++ b/scripts/validate_examples.sh @@ -6,27 +6,17 @@ ajv validate -s $SCHEMAS/Entity.json -d $EXAMPLES/Vehicle_C2.2.json -r $SCHEMAS/ 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 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 validate -s $SCHEMAS/Entity_keyValues.json -d -d $EXAMPLES/OffStreetParking_keyValues_C2.3.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 validate -s $SCHEMAS/Entity.json -d $EXAMPLES/Vehicle_MultiAttribute_C2.2.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -ajv compile -s $SCHEMAS/registrations/ContextSourceRegistration.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json +ajv validate -s $SCHEMAS/subscriptions/Subscription.json -d $EXAMPLES/Subscription-example_C.4.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 validate -s $SCHEMAS/registrations/ContextSourceRegistration.json -d $EXAMPLES/ContextSourceRegistration-example_C.3.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -ajv compile -s $SCHEMAS/registrations/ContextSourceNotification.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/registrations/ContextSourceRegistration.json +ajv validate -s $SCHEMAS/temporal/EntityTemporal.json -d $EXAMPLES/EntityTemporal-example_C5.5.3.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.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 +ajv validate -s $SCHEMAS/temporal/Entity_temporalValues.json -d $EXAMPLES/Entity_temporalValues_C.5.6.3.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json