-
Notifications
You must be signed in to change notification settings - Fork 89
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
+18
−11
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,8 @@ Copyright (C) 2023, Victor Chavez <[email protected]> | |
<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"/> | ||
</xsl:apply-templates> | ||
</ul> | ||
</xsl:template> | ||
|
@@ -132,19 +133,22 @@ Copyright (C) 2023, Victor Chavez <[email protected]> | |
<xsl:text>)</xsl:text> | ||
</xsl:template> | ||
|
||
<!-- Use http://www.essepuntato.it/2011/05/overlapping to test it --> | ||
|
||
<xsl:template match="swrl:BuiltinAtom | rdf:Description[rdf:type[@rdf:resource = 'http://www.w3.org/2003/11/swrl#BuiltinAtom']]"> | ||
<xsl:value-of select="substring-after(swrl:builtin/@rdf:resource,'http://www.w3.org/2003/11/swrlb#')" /> | ||
<xsl:text>(</xsl:text> | ||
<xsl:variable name="builtinHref" select="swrl:builtin/@rdf:resource" /> | ||
<a href="{$builtinHref}" title="{substring-after($builtinHref, '#')}"> | ||
<xsl:value-of select="substring-after($builtinHref, '#')" /> | ||
</a> | ||
<xsl:text>(</xsl:text> | ||
<xsl:for-each select="swrl:arguments/rdf:Description"> | ||
<xsl:value-of select="concat('?',substring-after(@rdf:about,'#'))"/> | ||
<xsl:if test="position() != last()"> | ||
<xsl:text>,</xsl:text> | ||
</xsl:if> | ||
<xsl:value-of select="concat('?', substring-after(@rdf:about, '#'))"/> | ||
<xsl:if test="position() != last()"> | ||
<xsl:text>,</xsl:text> | ||
</xsl:if> | ||
</xsl:for-each> | ||
<xsl:text>)</xsl:text> | ||
</xsl:template> | ||
|
||
<xsl:template match="swrl:classPredicate"> | ||
<xsl:apply-templates select="@rdf:resource"> | ||
<xsl:with-param name="type" select="'class'" tunnel="yes" as="xs:string" /> | ||
|
@@ -184,7 +188,10 @@ Copyright (C) 2023, Victor Chavez <[email protected]> | |
<div id="swrlrules"> | ||
<h2>SWRL rules</h2> | ||
<xsl:call-template name="get.swrl.toc"/> | ||
<xsl:apply-templates select="//(swrl:Imp | rdf:Description[rdf:type[@rdf:resource = 'http://www.w3.org/2003/11/swrl#Imp']])" /> | ||
<xsl:apply-templates select="//(swrl:Imp | rdf:Description[rdf:type[@rdf:resource = 'http://www.w3.org/2003/11/swrl#Imp']])" > | ||
<xsl:sort select="lower-case(f:getLabel(rdfs:label))" | ||
order="ascending" data-type="text"/> | ||
</xsl:apply-templates> | ||
</div> | ||
</xsl:if> | ||
</xsl:template> | ||
|
@@ -203,4 +210,4 @@ Copyright (C) 2023, Victor Chavez <[email protected]> | |
</xsl:if> | ||
</span> | ||
</xsl:template> | ||
</xsl:stylesheet> | ||
</xsl:stylesheet> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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