dgarijo / Widoco

Wizard for documenting ontologies. WIDOCO is a step by step generator of HTML templates with the documentation of your ontology. It uses the LODE environment to create part of the template.
Apache License 2.0
275 stars 85 forks source link

Improve namespace declaration parsing #688

Open dgarijo opened 3 months ago

dgarijo commented 3 months ago

As shown in https://stackoverflow.com/questions/65480889/extracting-ontology-namespaces-prefixes-with-owl-api, there is a native method to retrieve all namespaces.

The method public void loadNamespaceDeclarations(OWLOntology o) in Configuration.java loads the namespaces into a hashmap. However, this is a little redundant, since the following already returns all ns:

Map<String, String> map = format.asPrefixOWLDocumentFormat().getPrefixName2PrefixMap();

Should take the existing map and modify the preferrednsPrefix, instead of re-parsing everything again.