Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWRL rule ordering and minor href fix #664

Merged
merged 1 commit into from
Dec 31, 2023

Conversation

vChavezB
Copy link
Contributor

This change orders swrl rules according to their rdfs:label and a minor fix to href in the body and head of the swrl rules.

PS: nice to know the other SWRL PR got merged. This PR should just introduce minor fixes.

This change orders swrl rules according to their rdfs:label and a minor fix to href in the body and head of the swrl rules.
@dgarijo dgarijo merged commit d1d8ed5 into dgarijo:master Dec 31, 2023
4 checks passed
@dgarijo
Copy link
Owner

dgarijo commented Dec 31, 2023

Thanks, please next time commit to the develop branch

@@ -52,7 +52,8 @@ Copyright (C) 2023, Victor Chavez <vchavezb@protonmail.com>
<xsl:template name="get.swrl.toc">
<ul class="hlist">
<xsl:apply-templates select="/rdf:RDF/rdf:Description[rdf:type[@rdf:resource='http://www.w3.org/2003/11/swrl#Imp']]" mode="toc">
<xsl:sort select="rdfs:comment" order="ascending" data-type="text"/>
<xsl:sort select="lower-case(f:getLabel(rdfs:label))"
order="ascending" data-type="text"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this triggers an error if the label does not exist

Copy link
Contributor Author

@vChavezB vChavezB Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed all the swrl rules had an rdfs:label because in the SWRL Tab from Protégé the rdfs: label is always included.

grafik

I am not sure if this will work but we could perhaps check if the rdfs:label exists

<xsl:choose>
    <xsl:when test="exists(rdfs:label)">
        <xsl:sort select="lower-case(f:getLabel(rdfs:label))" order="ascending" data-type="text"/>
    </xsl:when>
    <xsl:otherwise>
        <xsl:sort select="lower-case(f:getLabel(rdfs:comment))" order="ascending" data-type="text"/>
    </xsl:otherwise>
</xsl:choose>

@dgarijo
Copy link
Owner

dgarijo commented Apr 30, 2024 via email

@vChavezB
Copy link
Contributor Author

vChavezB commented May 1, 2024

ok nice 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants