On 2022-04-08 4:20 am, Kai Liu wrote:
Hi,
we have a set of json files (not json-ld) that should be validated
with an ontology developed in EDG. The json objects should contain the
properties defined in the ontology classes, and the defined rules of
these properties should be obeyed.
What is the best way to do that? We are thinking of writing a
converter that can convert the ontology into a json schema for the
validation.
In principle a SHACL to JSON Schema converter would be useful and should
be created at some stage. It would, of course, need to make some
assumptions about how RDF instance data gets mapped to JSON objects.
But I am not sure whether this will work for all cases.
My understanding is that JSON Schema is less expressive than SHACL, so
it would only work for the very simple constraint types such as
sh:minCount, sh:datatype and sh:class.
Another idea would be to create RDF files from these json files for
the validation. Any experience or ideas would be much appreciated. Thanks.
Converting JSON into RDF is relatively easy to implement using ADS
scripts. ADS would also be able to pull multiple JSON files from web
services etc, if that's needed. And once in RDF you could validate the
merged data from multiple JSON files, in case there are constraints that
span the semantics of individual files. And such constraints can look up
data from other (knowledge) graphs, e.g. with reference data. All this
would be very hard to do in JSON Schema. So if you already have your
semantics expressed in the ontology, I guess writing a converter to RDF
instances sounds best.
If you need further help with the conversion, it would be helpful to see
the sample JSON files and the target ontology. There are many strategies
to define mappings, e.g. through annotations in the classes/property
shapes that instruct a generic converter, but it all depends on what
your requirements are.
Holger
Best regards, Kai
--
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/fffc83ad-aad1-43f2-9e10-69fc7abcbb66n%40googlegroups.com
<https://groups.google.com/d/msgid/topbraid-users/fffc83ad-aad1-43f2-9e10-69fc7abcbb66n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups "TopBraid
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/df52a8bb-4783-552a-0957-00df6c62ea5e%40topquadrant.com.