Open goneall opened 3 weeks ago
It looks like my input file wasn't proper SHACL - I'll confirm and close if this resolves the issue.
Never mind - looks reasonably valid
I did a comparison against the schema file generated from the model repo, and it looks like it is just missing the @context
references which is where the namespaces are defined.
I'll do some digging in the code to see if there is a parameter or something I missed.
Found the code requiring the context: https://github.com/JPEWdev/shacl2code/blob/ae7ba4e7a31dc302b87d971ca32e253fa0dae786/src/shacl2code/main.py#L104
Correct. --context
can be used to reference a published context URL, --context-url
can be used to reference a local context file as if it were at the specified URL (useful for locally developing before the context is published)
I attempted to use the shal2code to generate a JSON Schema with the latest SPDX 3.0.1 model.
The output did not include any namespaces - is this an expected argument to shacl2code?
The URI's also don't look right - they look like they are missing the
/
's.The schema processor I'm using in Java also complained about missing def's for the classes. e.g.:
Attached is the input and the output.
The command I used was:
spdx-model.json-ld.txt spdx-schema.json.txt