EKGF / dprod

Artifacts of the EKGF Data Product Workgroup (DPROD)
https://ekgf.github.io/dprod
MIT License
22 stars 6 forks source link

validate all examples by converting them to turtle/trig #92

Open VladimirAlexiev opened 2 months ago

VladimirAlexiev commented 2 months ago

Examples are important. Busy people may have no time to read your spec, and often start from examples. Examples also validate that all your infrastructure works together.

We had such workflow in GS1 EPCIS, and it helped both spec development, and then actual deployments:

I extracted the 2 examples from https://github.com/EKGF/dprod/tree/main/examples/core-data-product-extensions. Until https://github.com/EKGF/dprod/issues/90 is fixed, we can't use riot but can use https://www.npmjs.com/package/jsonld (the same code as in the JSONLD Playground).

Here's the result, and it's pretty tragic:

$ jsonld format -q example1.jsonld
<ex:DataProductAgreement> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <rdfs:class> .
<ex:DataProductAgreement> <rdfs:label> "DataProductAgreement" .
<ex:DataProductAgreement> <rdfs:subClassOf> <fibo:Agreement> .
<http://example.org/dp#isSubjectToAgreement> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> .
<http://example.org/dp#isSubjectToAgreement> <http://www.w3.org/2000/01/rdf-schema#label> "Data Product is Subject To FIBO Agreement" .

$ jsonld format -q example2.jsonld
joshcornejo commented 2 months ago

This is very useful!