-
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 rules dont appear. #651
Comments
I debugged the app and I am not sure if swr rules are parsed the XLST output for swr rules looks as this. In this example I added two rules to an ontology. <div id="swrlrules">
<h2>SWRL rules</h2>
<div id="d4e4498" class="entity">
<h3>Rule #1
<span class="backlink">back to
<a href="#toc">ToC</a>
</span>
</h3>
<p>
<a href="#d4e4288" title="http://datos.bne.es/def/C1001">Work</a>
<sup title="class" class="type-c">c</sup>(?) ->
<a href="#d4e4316" title="http://datos.bne.es/def/C1002">Expression</a>
<sup title="class" class="type-c">c</sup>(?)
</p>
</div>
<div id="d4e4558" class="entity">
<h3>Rule #2
<span class="backlink">back to
<a href="#toc">ToC</a>
</span>
</h3>
<p>
<a href="#d4e4288" title="http://datos.bne.es/def/C1001">Work</a>
<sup title="class" class="type-c">c</sup>(?) ->
<a href="#d4e4316" title="http://datos.bne.es/def/C1002">Expression</a>
<sup title="class" class="type-c">c</sup>(?)
</p>
</div>
</div> So my guess is that the SWRL html parser is not implemented in widoco due to the fact that I was debugging and the id for the html div is different. I changed the id to swrlrules but the program crashes. Widoco/src/main/java/widoco/LODEParser.java Line 186 in 4da92b2
|
Ok I made a PR #652 perhaps you can check if it looks fine. The rules are now displayed. However as you see the first element is "null". |
The output of the XLST transformation for SWRL rules does not provide an hlist div element. Instead each rule is provide as a class entity. Fixes dgarijo#651
The output of the XLST transformation for SWRL rules does not provide an hlist div element. Instead each rule is provide as a class entity. Fixes dgarijo#651
ok an update now the rules look much better with annotation from rdfs:comment and rdfs:label this requires changing the xslt of swrl-rules in specific , havent made a PR as I hope this gets merged first :) #653 <xsl:template match="swrl:Imp | rdf:Description[rdf:type[@rdf:resource = 'http://www.w3.org/2003/11/swrl#Imp']]">
<div id="{generate-id()}" class="entity">
<h3>
<xsl:value-of select="concat('Rule #', count(preceding-sibling::swrl:Imp | preceding-sibling::rdf:Description[rdf:type[@rdf:resource = 'http://www.w3.org/2003/11/swrl#Imp']]) + 1, ' ', rdfs:label)" />
<xsl:call-template name="get.backlink.to.top" />
</h3>
<p>
<!-- Add rdfs:comment -->
<xsl:if test="rdfs:comment">
<strong>Comment: </strong>
<xsl:value-of select="rdfs:comment" /><br/><br/>
</xsl:if>
<!-- Continue with the existing content -->
<xsl:apply-templates select="swrl:body" />
<xsl:text> -> </xsl:text>
<xsl:apply-templates select="swrl:head" />
</p>
</div>
</xsl:template>
|
Thanks a lot. So far, I think no swrl rules were considered, as I did not have a use case for them (I may have simplified them from the XSLT output). I will need to review the PR, since in the |
Just pls make sure you send your PRs to the right branch @vChavezB (see https://github.com/dgarijo/Widoco#contribution-guidelines) |
I read the code again and the xlst sources. So if I understand correctly the "rules" extraction uses annotations from owl Individuals or which type of rules does it parse. Widoco/src/main/resources/lode/extraction.xsl Line 2334 in 4da92b2
I did not found a sample ontology that uses this transformation. This would be helpful to know as it was not clear to me. I will update the PR and refine it. |
@vChavezB sorry, the rules stuff I added is for very specific owl annotations for a specific project I am doing. The SWRL module you added recovers the original SWRL annotations, and I think they should be added, but separately. |
I am trying to generate the SWRL rules I declare in my ontology but they dont apper after I generate the project.
The rules section appears empty with just a the title "4.6 Rules" and a blue rectangle
Do you have an example ontology that is known to be working and I can use to check if its just on my side?
Here is an excerpt of how I declare my SWRL rules (generated with protege)
The text was updated successfully, but these errors were encountered: