Open albert-verdeny opened 2 days ago
Thanks @albert-verdeny , for sharing profile rules - I will reach out to you if something is unclear
Hi @anishjain1401 I have come up with a draft JSON schema can you kindly look into it
{ "$schema": "http://json-schema.org/draft-07/schema#", "allOf": [ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "@context": { "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "object", "patternProperties": { "ext": { "type": "string", "const": "http://example.com/ext/" } }, "additionalProperties": true } ] }, "minItems": 1 }, "type": { "type": "string", "enum": [ "TransformationEvent" ] }, "action": { "type": "string" }, "readPoint": { "type": "object", "properties": { "id": { "type": "string", "minLength": 13 } }, "required": [ "id" ] }, "eventID": { "type": "string", "pattern": "^ni:///sha-256;[a-f0-9]{64}\\?ver=CBV2.0$" }, "bizStep": { "type": "string", "enum": [ "commissioning", "creating_class_instance" ] }, "inputEPCList": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }, "outputEPCList": { "type": "array", "items": { "type": "string" }, "minItems": 0, "uniqueItems": true }, "bizLocation": { "type": "object", "properties": { "id": { "type": "string" } }, "required": [ "id" ] }, "ext:eventProfile": { "type": "string" } }, "required": [ "inputEPCList", "outputEPCList", "action", "readPoint", "eventID", "type", "bizStep", "@context", "ext:eventProfile" ], "if": { "properties": { "outputEPCList": { "maxItems": 0 } } }, "then": { "required": [ "inputEPCList", "outputEPCList", "action", "readPoint", "eventID", "type", "bizStep", "@context", "ext:eventProfile" ] }, "else": { "required": [ "inputEPCList", "outputEPCList", "action", "readPoint", "eventID", "type", "bizStep", "@context", "ext:eventProfile", "bizLocation" ] }, "additionalProperties": true } ] }
Sure @projjal-gop , thanks for the schema - I will take a look into schema and surely connect with you.
Dear Anish (@anishjain1401 ) and Projjal
This is an Event Profile that combines a number of the atomic units of logic that we collectively identified in our shared Google doc, while trying to minimise overlap with the other event profile tests.
Set of rules
"type"
must beTransformationEvent
"readPoint"
must not be empty"eventID"
has the syntax of an Event Hash ID, as defined in the CBV (doesn't need to verify that the value is correct)"bizStep"
must be eithercommissioning
orcreating_class_instance
"ext:eventProfile"
, whereext
maps tohttp://example.com/ext/
in the"@context"
"bizLocation"
must not be empty if output products are specified"bizLocation"
must be empty if no output products are specifiedPlease let me know if something is unclear.
Best regards, Albert