Closed maximelefrancois86 closed 7 months ago
Add an option "ontology" in pylode/ontodoc.py:106 ? if this ontology exists, then, only those terms that are defined by this ontology should be documented. This has an impact in functions: _make_main_sections _make_toc
currently pyLODE looks if the ontology contains triples of the kind: (None, RDF.type, OWL.Class)
we may want to change each of those into executing an ask query, something along the lines of:
self.ont.query(f"ASK \{ [] a owl:Class ; rdfs:isDefinedBy {ontology}}").askAnswer
then the function section_html is to """Makes all the HTML (div, title & table) for all instances of a given RDF class, e.g. owl:Class or owl:ObjectProperty"""
We want to restrict that a bit: """Makes all the HTML (div, title & table) for all instances of a given RDF class, e.g. owl:Class or owl:ObjectProperty, that are defined by the given ontology, if given""".
so:
for s_ in ont.subjects(predicate=RDF.type, object=obj_class):
add a filter: if ontology and (s_, RDFS.isDefinedBy, ontology ) not in ont: continueaddressed in PR #184
Currently every class, op, dp, and skos concept, has a section in the documentation.
We should add an option to pyLODE to filter only those that are defined by (
rdfs:isDefinedBy
) the ontology that is being documented