Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular JSON Schema. Usage of bare terms allowed. Validation of extensions. #298

Merged
merged 25 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a52b761
Modular schema files. First snapshot
jmcanterafonseca-iota Jun 18, 2021
5a1cd79
Proper renaming to avoid errors
jmcanterafonseca-iota Jun 18, 2021
63a4908
Bundle script updated
jmcanterafonseca-iota Jun 18, 2021
1584f70
Move schemas to its independent folder
jmcanterafonseca-iota Jul 16, 2021
0e054f4
EPCIS Document oneOf --> anyOf
jmcanterafonseca-iota Jul 16, 2021
6623cac
Lifting restriction on CBV URIs
jmcanterafonseca-iota Jul 16, 2021
d8cc73f
EPCIS JSON Schema optimized bundle
jmcanterafonseca-iota Jul 16, 2021
615c796
Generate schema to the root folder
jmcanterafonseca-iota Jul 16, 2021
b9f697d
README updated
jmcanterafonseca-iota Jul 16, 2021
7a91407
Fix schema paths
jmcanterafonseca-iota Jul 16, 2021
36c4d39
Add a validate all script
jmcanterafonseca-iota Jul 16, 2021
fc84979
Remove old Schemas
jmcanterafonseca-iota Jul 19, 2021
15e862d
Schema fixed
jmcanterafonseca-iota Jul 19, 2021
cac2811
Restore oneOf as it is totally correct
jmcanterafonseca-iota Jul 19, 2021
ee1eea5
Update global Schema
jmcanterafonseca-iota Jul 19, 2021
74b77ff
Fix Error Declaration Schema Version
jmcanterafonseca-iota Aug 17, 2021
ec5928d
Fix Master Data Example as per input from #319
jmcanterafonseca-iota Aug 17, 2021
f6da86b
Remove unneeded 'isA'
jmcanterafonseca-iota Aug 17, 2021
3759585
Fix JSON Schema. Object Event no epcList. Only sensor data
jmcanterafonseca-iota Aug 17, 2021
92662f9
Fix Master Data Definition as per suggestion from #319
jmcanterafonseca-iota Aug 17, 2021
81c2651
consider isA property for accurate validation of events
Sep 14, 2021
6282094
reason and correctiveEventIDs are not required within errorDeclaration
mgh128 Sep 21, 2021
800eb31
Delete Example_9.8.1-MasterData-complying-with-schema.jsonld
mgh128 Sep 30, 2021
30317ec
Delete Example_9.8.1-MasterData.jsonld
mgh128 Sep 30, 2021
960e59e
Merge branch 'master' into modular_json_schema
mgh128 Sep 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,738 changes: 1,738 additions & 0 deletions EPCIS-JSON-Schema.json

Large diffs are not rendered by default.

210 changes: 210 additions & 0 deletions JSON-Schema/EPCIS-Document-JSON-Schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"$id": "https://gs1.github.io/EPCIS/JSON-Schema/EPCIS-Document-JSON-Schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"vocabulary": {
"type": "object",
"properties": {
"type": {
"$ref": "schemas/event-definitions-JSON-Schema.json#/definitions/uri"
},
"vocabularyElementList": {
"type": "array",
"items": {
"$ref": "#/definitions/vocabularyElement"
}
}
},
"required": [
"type"
]
},
"vocabularyElement": {
"type": "object",
"properties": {
"id": {
"$ref": "schemas/event-definitions-JSON-Schema.json#/definitions/uri"
},
"attributes": {
"type": "array",
"items": {
"$ref": "#/definitions/attribute"
}
},
"children": {
"type": "array",
"items": {
"$ref": "schemas/event-definitions-JSON-Schema.json#/definitions/uri"
}
}
},
"required": [
"id"
]
},
"attribute": {
"type": "object",
"properties": {
"id": {
"$ref": "schemas/event-definitions-JSON-Schema.json#/definitions/uri"
},
"attribute": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "object"
}
]
}
},
"required": [
"id"
]
},
"eventList": {
"type": "array",
"items": {
"$ref": "EPCIS-Event-JSON-Schema.json#/definitions/EPCIS-Document-Event"
}
},
"vocabularyList": {
"type": "array",
"items": {
"$ref": "#/definitions/vocabulary"
}
},
"resultsBody": {
"type": "object",
"properties": {
"eventList": {
"$ref": "#/definitions/eventList"
},
"vocabularyList": {
"$ref": "#/definitions/vocabularyList"
}
},
"required": [
"eventList"
]
},
"queryResults": {
"type": "object",
"properties": {
"queryName": {
"type": "string"
},
"subscriptionID": {
"type": "string"
},
"resultsBody": {
"$ref": "#/definitions/resultsBody"
}
},
"required": [
"resultsBody"
]
},
"epcisQueryDocumentBody": {
"type": "object",
"properties": {
"queryResults": {
"$ref": "#/definitions/queryResults"
}
},
"required": [
"queryResults"
]
},
"epcisHeader": {
"type": "object",
"properties": {
"epcisMasterData": {
"type": "object",
"properties": {
"vocabularyList": {
"type": "array",
"items": {
"$ref": "#/definitions/vocabulary"
}
}
}
}
}
},
"epcisDocument": {
"type": "object",
"properties": {
"isA": {
"type": "string",
"const": "EPCISDocument"
},
"@context": {
"$ref": "schemas/definitions-JSON-Schema.json#/definitions/@context"
},
"schemaVersion": {
"type": "string"
},
"creationDate": {
"type": "string",
"format": "date-time"
},
"epcisHeader": {
"$ref": "#/definitions/epcisHeader"
},
"epcisBody": {
"type": "object",
"properties": {
"eventList": {
"$ref": "#/definitions/eventList"
}
},
"required": [
"eventList"
]
}
},
"required": [
"@context",
"schemaVersion",
"creationDate",
"epcisBody"
]
},
"epcisQueryDocument": {
"type": "object",
"properties": {
"isA": {
"type": "string",
"const": "EPCISQueryDocument"
},
"epcisBody": {
"$ref": "#/definitions/epcisQueryDocumentBody"
}
},
"required": [
"@context",
"epcisBody"
]
},
"EPCIS-Document": {
"oneOf": [
{
"$ref": "#/definitions/epcisDocument"
},
{
"$ref": "#/definitions/epcisQueryDocument"
}
]
}
},
"allOf": [
{
"$ref": "#/definitions/EPCIS-Document"
}
]
}
99 changes: 99 additions & 0 deletions JSON-Schema/EPCIS-Event-JSON-Schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"$id": "https://gs1.github.io/EPCIS/JSON-Schema/EPCIS-Event-JSON-Schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"EPCIS-Document-Event": {
"required": [
"isA"
],
"allOf": [
{
"if": {
"properties": {
"isA": {
"const": "ObjectEvent"
}
}
},
"then": {
"$ref": "schemas/ObjectEvent-JSON-Schema.json#/definitions/ObjectEvent"
}
},
{
"if": {
"properties": {
"isA": {
"const": "AggregationEvent"
}
}
},
"then": {
"$ref": "schemas/AggregationEvent-JSON-Schema.json#/definitions/AggregationEvent"
}
},
{
"if": {
"properties": {
"isA": {
"const": "TransactionEvent"
}
}
},
"then": {
"$ref": "schemas/TransactionEvent-JSON-Schema.json#/definitions/TransactionEvent"
}
},
{
"if": {
"properties": {
"isA": {
"const": "TransformationEvent"
}
}
},
"then": {
"$ref": "schemas/TransformationEvent-JSON-Schema.json#/definitions/TransformationEvent"
}
},
{
"if": {
"properties": {
"isA": {
"const": "AssociationEvent"
}
}
},
"then": {
"$ref": "schemas/AssociationEvent-JSON-Schema.json#/definitions/AssociationEvent"
}
},
{
"if": {
"not": {
"properties": {
"isA": {
"enum": [
"AssociationEvent",
"ObjectEvent",
"AggregationEvent",
"TransactionEvent",
"TransformationEvent"
]
}
}
}
},
"then": {
"$ref": "schemas/event-definitions-JSON-Schema.json#/definitions/Extended-Event"
}
}
],
"properties": {
"isA": {
"type": "string"
}
}
}
}
}

Loading