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

Question: Can WIDOCO be configured to not display the IRI for each thing in the exported ontology? #677

Open Rcaschultz opened 5 months ago

Rcaschultz commented 5 months ago

Do not want to display the IRI for each item in the export.

image

Regards,

dgarijo commented 5 months ago

@Rcaschultz, no I don't think it's possible to hide the IRIs at the moment, sorry.

vChavezB commented 5 months ago

The IRI generation from the xsl transformation sheet is exactly here

https://github.com/dgarijo/Widoco/blob/5b9b1dea501d716af3820b532b50ec4c6dccae92/src/main/resources/lode/extraction.xsl#L1575

It could be enhanced and add a Widoco ontology data property widoco:DoNotDisplayIRI with value xsd:boolean. Then in the xsl transformation just adding a second condition and looking if this data property is true or false here:

https://github.com/dgarijo/Widoco/blob/5b9b1dea501d716af3820b532b50ec4c6dccae92/src/main/resources/lode/extraction.xsl#L1576

vChavezB commented 5 months ago

As I am not an xsl transformation expert I asked our overlord AI Chatgpt and this is something that could be tested to check if works

<xsl:template name="get.ontology.url">
    <xsl:if test="exists((@*:about|@*:ID)[normalize-space() != '']) and not(exists(//widoco:DoNotDisplayIRI[text()='true']))">
        <dl>
            <dt>IRI:</dt>
            <dd>
                <xsl:value-of select="@*:about|@*:ID"/>
            </dd>
            <xsl:if test="exists(owl:versionIRI)">
                <dt>Version IRI:</dt>
                <dd>
                    <xsl:value-of select="owl:versionIRI/@*:resource"/>
                </dd>
            </xsl:if>
        </dl>
    </xsl:if>
</xsl:template>
dgarijo commented 5 months ago

Thanks @vChavezB. The only thing I am a little hesitant is that your ontology ends up with Widoco configuration parameters. We can do something similar under the hood: accept a parameter for the tool, then annotate the ontology and use the xslt.

But I don't understand very well why would you want to remove the class URI from the documentation, since that's kind of the main thing to know which property you are dealing with. For example, 2 properties/Classes could have the same label. How would you distinguish theM