-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate JSON Schema using shacl2code
Generates the JSON schema for validating JSON-LD documents using `shacl2code` Signed-off-by: Joshua Watt <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,16 @@ jobs: | |
run: pip install -r spec-parser/requirements.txt | ||
- name: Build model | ||
run: python3 spec-parser/main.py spdx-3-model/model spdx-spec/docs/model | ||
- name: Copy JSON annotations | ||
run: cp spdx-spec/serialization/jsonld/annotations.ttl spdx-spec/docs/model/jsonld-annotations.ttl | ||
- name: Generate JSON schema | ||
run: | | ||
shacl2code generate \ | ||
--input spdx-spec/docs/model/ontology.rdf.ttl \ | ||
--input spdx-spec/docs/model/jsonld-annotations.ttl \ | ||
--context-url spdx-spec/docs/model/context.jsonld https://spdx.org/rdf/3.0.0/spdx-context.jsonld \ | ||
jsonschema \ | ||
--output spdx-spec/docs/model/schema.json | ||
- name: Set git identity | ||
run: git config user.name ci-bot; git config user.email [email protected] | ||
working-directory: spdx-spec | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ mkdocs==1.5.3 | |
json-schema-for-humans==0.47 | ||
mkdocs-pdf-export-plugin==0.5.10 | ||
mike==1.1.2 | ||
shacl2code==0.0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@base <https://rdf.spdx.org/v3/> . | ||
@prefix sh-to-code: <https://jpewdev.github.io/shacl2code/schema#> . | ||
|
||
<Core/Element> ; | ||
sh-to-code:idPropertyName "spdxId" | ||
. | ||
|
||
<Extension/Extension> ; | ||
sh-to-code:isExtensible true | ||
. |