Skip to content

Commit

Permalink
Merge pull request #701 from dgarijo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dgarijo authored Apr 30, 2024
2 parents ce9047b + 6c45f74 commit e6a9f23
Show file tree
Hide file tree
Showing 6 changed files with 1,068 additions and 15 deletions.
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

0 comments on commit e6a9f23

Please sign in to comment.