Github action `Validate Jargon Artifacts` validates too much
Created by: absoludity
It's great to see this working at:
https://github.com/uncefact/spec-untp/actions/workflows/jargon-webhooks.yml
Each action is correctly validating the main instance file (good), but then it also validates any other specific instances which fail because they don't have a context defined. For example, looking at the DPP:
Validating context in credentials...
Validating "https://jargon.sh/user/unece/DigitalProductPassport/s/0/artefacts/jsonSchemas/DigitalProductPassport_instance.json?class=DigitalProductPassport_instance"
Validating "https://jargon.sh/user/unece/DigitalProductPassport/s/0/artefacts/jsonSchemas/Product_instance.json?class=Product_instance"
Error: Error validating context in credentials: {"name":"jsonld.ValidationError","details":{"event":{"type":["JsonLdEvent"],"code":"invalid property","level":"warning","message":"Dropping property that did not expand into an absolute IRI or keyword.","details":{"property":"batchNumber","expandedProperty":"batchNumber"}}}}
Context in credentials validation results: failed.
So the DigitalProductPassport_instance
appears to succeed (good) but the Product_instance
validation fails, because, if you check the link, you'll see that it doesn't have an @context
defined - so none of the terms will be defined.
Now, some background: the only reason we have a Product_instance
is because we mark the Product
in Jargon with [jargon.jsonSchemaRoot]=true
so that we get an extra JSON-Schema file which we can use in web forms. The side-effect is that we also get the Product_instance
, which we don't use or need.
We can't make this pass by adding an @context
directly to the Product
because we don't want it to have that property when part of the DPP, since the DPP already defines the @context
.
So the only way forward that I can see is that we update the code running in the action so that we validate the main instance as we do now, but skip validating any other instance data.
Thoughts?