lambdamusic / Ontospy

Python library and command-line interface for inspecting and visualizing RDF models aka ontologies.
http://lambdamusic.github.io/Ontospy/
MIT License
218 stars 52 forks source link

Ontodocs does not necessarily use rdfs:label #82

Closed SamuelFriedman closed 2 years ago

SamuelFriedman commented 5 years ago

I'm working on generating documentation for an ontology using ontodocs and I would prefer to have a different display name than what is provided by default, especially for the HTML outputs. I would like to have each node use the label associated with the entry rdfs:label instead of the qname. When I generate the documentation using the D3 methods, it seems to work the way I want. Is there a way to easily enable this change and/or have it be an option to pass to the code? It seems like the function bestLabel would be a good function to use here.

Akash-Sharma-1 commented 4 years ago

Hi ! I would like to work on this, if nobody is working on this and if I get a green light and guidance from the maintainers.

reeshabhranjan commented 4 years ago

Me, @prince17080 and @guvi007 are looking into this and will send a PR if we code a solution.

vemonet commented 3 years ago

Hi!

I stumbled upon the same issue for my ontologies, and started a fix, it is working well on my ontology, most references are now using labels instead of URIs, which makes the documentation so much easier to read!

Here is the example an the ontology deployed using labels instead of URIs for most concepts references in the documentation

https://vemonet.github.io/semanticscience/browse/entities-tree-classes.html

You can find the fixes here: https://github.com/vemonet/Ontospy/tree/improve-labels

I mostly replaced .qname by .bestLabel in the links rendering in the templates (and utils.py for the classes tree)

I will do a pull request if you are interested to integrate those improvements

lambdamusic commented 2 years ago

Fixed with https://github.com/lambdamusic/Ontospy/releases/tag/v1.9.9

You can now pass an argument to specify if you want to use qnames or labels

Eg ontospy gendocs -l --preflabel label (or qname => default)