pyLODE major update

24 views
Skip to first unread message

Nicholas Car

unread,
Jan 6, 2022, 7:13:41 AM1/6/22
to rdfli...@googlegroups.com
Hi all,

There is a small RDFLib-based utility called pyLODE [1] that I maintain which produces HTML documentation for OWL Ontologies. See this example: https://rdflib.dev/pyLODE/examples/ontdoc/agrif.html. It's small and can be run in auto-build scenarios.

I've just made a new major release (a complete rewrite actually), so if you've never seen pyLODE before, please check it out now!

If you ever want HTML from RDF in Python, there are probably lots of quite reusable bits of code in there.

Cheers,

Nick

Miel Vander Sande

unread,
Jan 6, 2022, 7:58:47 AM1/6/22
to rdfli...@googlegroups.com
Hi Nicolas,

First off: thanks and generating ontology documentation is an extremely useful thing.
I was wondering, since I'm augmenting ontologies more and more with constraints defined in shacl, I was wondering how difficult it would be to have pyLODE also pick up the shacl vocabulary given the current codebase? 

Best,

Miel

Op do 6 jan. 2022 om 13:13 schreef Nicholas Car <nichol...@surroundaustralia.com>:
--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/CAP7nqh3vumtF7jW103rDV%2Bz7Y7XjrFphVogy6hTg%2BRpAAPmBTw%40mail.gmail.com.

Nicholas Car

unread,
Jan 6, 2022, 9:24:45 AM1/6/22
to rdfli...@googlegroups.com
> I was wondering how difficult it would be to have pyLODE also pick up the shacl vocabulary given the current codebase?

No, it would be very easy to do this. I rebuilt pyLODE because the previous version, while doing lots of things, was a real code mess. This new version has reusable HTML generation functions all in one place and the triggers for properties that are understood are all listed in one place too (rdf_elements.py). So it would be easy to cater for SHACL by:

* adding all the desired SHACL properties to rdf_elements.py
* extending the HTML producing functions to produce the correct looking SHACL
    * perhaps things like if a property <x> has sh:minCount 1 & sh:maxCount 1, the rendering is <x> exactly 1 etc.

Feel free to try a PR to add this. It would be great to have the code reviewed!

The bad bits in the code still are the repeated passing of properties down functions in utils.py, so some improvements there might make the code a lot easier to extend further.

Cheers, Nick

Reply all
Reply to author
Forward
0 new messages