Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
VladimirAlexiev opened this issue Sep 25, 2024 · 1 comment
Open

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

VladimirAlexiev opened this issue Sep 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@VladimirAlexiev
Copy link

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.

  • So please extract all examples from https://github.com/EKGF/dprod/tree/main/examples (*/README.md) into separate .jsonld files,
  • Use some workflow to convert them to turtle/trig
  • Check them to make sure all the info is present, and it makes sense
  • optionally, use rdfpuml to generate diagrams

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 #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
  • no DPROD terms are present whatsoever
  • URLs like <ex:DataProductAgreement> <rdfs:subClassOf> <fibo:Agreement> are wrong
    • I can't even guess how you produce both <rdfs:label> (wrong) and <http://www.w3.org/2000/01/rdf-schema#label> (right but unprefixed) from the same example
  • The second example produces no triples.
@joshcornejo
Copy link
Contributor

This is very useful!

@rivettp rivettp added the enhancement New feature or request label Oct 1, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants