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

Develop #701

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>es.oeg</groupId>
<artifactId>widoco</artifactId>
<packaging>jar</packaging>
<version>1.4.23</version>
<version>1.4.24</version>
<name>Widoco</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/widoco/ExternalPropertyParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ private Optional<OWLAnnotation> getLabelAnnotation(OWLEntity entity, String lang
continue;
}
label = getLabel(entity, langPrefix, importedOntology);
if (label != null) return label;
if (!label.isEmpty()) return label;
}
return Optional.empty();
}
Expand Down
14 changes: 10 additions & 4 deletions src/main/resources/lode/swrl-module.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

<!-- SWRL TOC and SWRL Rule extraction
Copyright (C) 2023, Victor Chavez <[email protected]>
Modified by Daniel Garijo
-->
<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="lower-case(f:getLabel(rdfs:label))"
order="ascending" data-type="text"/>

<xsl:sort
select="if(rdfs:label) then lower-case(rdfs:label) else ''"
order="ascending"
data-type="text"/>
</xsl:apply-templates>
</ul>
</xsl:template>
Expand Down Expand Up @@ -193,8 +197,10 @@ Copyright (C) 2023, Victor Chavez <[email protected]>
<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:sort select="lower-case(f:getLabel(rdfs:label))"
order="ascending" data-type="text"/>
<xsl:sort
select="if(rdfs:label) then lower-case(rdfs:label) else ''"
order="ascending"
data-type="text"/>
</xsl:apply-templates>
</div>
</xsl:if>
Expand Down
18 changes: 17 additions & 1 deletion src/test/java/widoco/CreateDocInThreadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,23 @@ public void testOntologyInLanguage() {
fail("Error while running test "+e.getMessage());
}
}*/

/**
* Testing an ontology with SWRL rules (issue
*/
@org.junit.Test
public void testOntologyWithSWRLRules() {
System.out.println("Testing Ontology: PAC2_EX2_RDF.rdf");
try{
String pathToOnto = "test" + File.separator + "PAC2_EX2_RDF.rdf";
c.setFromFile(true);
this.c.setOntologyPath(pathToOnto);
//read the model from file
WidocoUtils.loadModelToDocument(c);
CreateResources.generateDocumentation(c.getDocumentationURI(), c, c.getTmpFile());
}catch(Exception e){
fail("Error while running test "+e.getMessage());
}
}


}
Loading