-
Notifications
You must be signed in to change notification settings - Fork 88
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
Conversation
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.
Thanks, please next time commit to the |
@@ -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"/> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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>
I added a fix and released a new version fixing this. No worries!
El mar., 30 abr. 2024 11:08 p. m., Victor Chavez ***@***.***>
escribió:
… ***@***.**** commented on this pull request.
------------------------------
In src/main/resources/lode/swrl-module.xsl
<#664 (comment)>:
> @@ -52,7 +52,8 @@ Copyright (C) 2023, Victor Chavez ***@***.***>
<xsl:template name="get.swrl.toc">
<ul class="hlist">
<xsl:apply-templates ***@***.***: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"/>
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.png (view on web)
<https://github.com/dgarijo/Widoco/assets/47216966/8cea37e8-11a0-4bbd-8fc7-7371877327f8>
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:when test="exists(rdfs:comment)">
<xsl:sort select="lower-case(f:getLabel(rdfs:comment))" order="ascending" data-type="text"/>
</xsl:when>
</xsl:choose>
—
Reply to this email directly, view it on GitHub
<#664 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALTIGXQLACQPUYRIQJLZRDZAAB3ZAVCNFSM6AAAAABBIK3O6CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAMZSGUZDKMJVHE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
ok nice 👍 |
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.