Skip to content

Commit 96c008f

Browse files
author
Tom Hollingworth
committed
2 parents 973e3d8 + fb76e98 commit 96c008f

File tree

60 files changed

+57548
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+57548
-14
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
./Docs/static/schemas/*.json
22
/Docs/public/
33
.hugo_build.lock
4-
Examples/
4+
Examples/
5+
node_modules/
6+
.DS_Store

.gitlab-ci.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
stages:
2-
- lint
2+
- jsonschema-validator
33
- containerize
44
- deploy
55

6-
lint:
7-
stage: lint
8-
image: golang:latest
6+
jsonschema-validator:
7+
stage: jsonschema-validator
8+
image: node:latest
99
script:
10-
- go install github.com/giantswarm/schemalint/v2@latest
1110
- |
12-
for i in ./Schema/*.json;
13-
do echo "checking $i";
14-
schemalint verify $i;
15-
done
11+
#!/bin/bash
12+
13+
# Install dependencies
14+
npm install ajv@^8.0.0
15+
16+
# Path to your validation script
17+
VALIDATOR_SCRIPT="scripts/compileSchemas.js"
18+
19+
# Check if the validation script exists
20+
if [ ! -f "$VALIDATOR_SCRIPT" ]; then
21+
echo "Validation script $VALIDATOR_SCRIPT not found."
22+
exit 1
23+
fi
24+
25+
# Run the validation script
26+
node "$VALIDATOR_SCRIPT"
27+
28+
# Check exit status
29+
if [ $? -eq 0 ]; then
30+
echo "All schemas compiled successfully."
31+
else
32+
echo "There was an error compiling schemas."
33+
exit 1
34+
fi
35+
36+
1637
1738
containerize-localhost:
1839
stage: containerize
1940
image: docker:latest
2041
needs:
21-
- lint
42+
- jsonschema-validator
2243
variables:
2344
HOST: "http://localhost/"
2445
services:
@@ -40,7 +61,7 @@ containerize-jsonlibremfgai:
4061
stage: containerize
4162
image: docker:latest
4263
needs:
43-
- lint
64+
- jsonschema-validator
4465
variables:
4566
HOST: "https://json.libremfg.ai/"
4667
ENV_SLUG: "jsonlibremfgai"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ARG HOST=http://localhost/
1515

1616
# Copy in the schema files & replace JSON Schema Location
1717
RUN mkdir ./Docs/static/schemas && \
18-
cp ./Schema/* ./Docs/static/schemas/ && \
18+
cp ./schemas/* ./Docs/static/schemas/ && \
1919
sed -i 's,\("$id"\: *"\),\1'"$HOST"'schemas/,g' ./Docs/static/schemas/*.json && \
2020
sed -i 's,\("$ref"\: *"\)\./,\1'"$HOST"'schemas/,g' ./Docs/static/schemas/*.json
2121

Docs/content/posts/version-v1.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title = 'Version v1.0.0'
2+
title = 'Version 1.0.0'
33
date = 2024-07-12T18:43:31Z
44
+++
55

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
+++
2+
title = 'Version 2.0.0'
3+
date = 2024-09-20T14:52:37-05:00
4+
+++
5+
6+
> A JSON Schema implementation of the ANSI/ISA-95 and ANSI/ISA-88 standards.
7+
8+
An JSON implementation of the ANSI/ISA-95, Enterprise-Control System Integration, family of standards (ISA-95), known internationally as IEC/ISO 62264. B2MML consists of a set of JSON schemas written using the JSON Schema's Schema language (2020) that implement the data models in the ISA-95 standard.
9+
10+
This JSON schema can be used for design for syncrhonous and asynchronous APIs.
11+
12+
Based on the works of https://github.com/MESAInternational/B2MML-BatchML.
13+
14+
## Abbreviations
15+
16+
| Acronynm | Description |
17+
|-------------|---------------------------------------------------------------|
18+
| **ANSI** | American National Standards Institute |
19+
| **API** | Application Programming Interface |
20+
| **B2MML** | Business to (2) Manufacturing Markup Language |
21+
| **BatchML** | Batch Markup Language |
22+
| **BOD** | Business Object Document |
23+
| **ISA** | International Society of Automation |
24+
| **IEC** | International Electrotechnical Commission |
25+
| **JSON** | JavaScipt Object Notation |
26+
| **XML** | eXensible Markup Language |
27+
| **XSD** | eXtensible markup language Schema Definition |
28+
29+
## Quick start
30+
31+
Start out by importing the schema and using it in your JSON documents.
32+
33+
```
34+
"$schema": "{{< siteurl >}}schemas/"
35+
```
36+
37+
Here is an example using the JSON schema in a `NotifyWorkDefined` message.
38+
39+
```json
40+
{
41+
"$schema": "{{< siteurl >}}schemas/",
42+
"NotifyWorkDefined": {
43+
"ApplicationArea": {},
44+
"DataArea": {
45+
"Notify": {},
46+
"WorkDefined": {
47+
48+
}
49+
}
50+
}
51+
}
52+
```
53+
54+
## Updates Introduced in Version 2.0.0
55+
56+
Refactored the v1.0.0.base.schema.json JSON file by separating it into multiple files that use the prefix "v2.0.0", aligning the structure with the existing B2MMl XML implementation https://github.com/MESAInternational/B2MML-BatchML/tree/master/Schema.
57+
58+
Implemented several automated scripts to assist in refactoring. While these scripts are tailored for specific use cases, they can generally be disregarded outside of those particular scenarios.
59+
60+
In Version 2.0.0, a JSON Schema validator is used for verification, replacing the previous Lint-based approach. This update compiles and validates schemas through the use of scripts, specifically compileSchemas.js, located in scripts, and validate.mjs.

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module validator
2+
3+
go 1.22.2

go.sum

Whitespace-only changes.

package-lock.json

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": {
3+
"ajv": "^8.17.1",
4+
"ajv-formats": "^3.0.1"
5+
},
6+
"version": "0.0.0"
7+
}

0 commit comments

Comments
 (0)