Skip to content

Commit

Permalink
Merge pull request #190 from OP-TED/feature/EPO-834
Browse files Browse the repository at this point in the history
Feature/epo 834
  • Loading branch information
Dragos0000 authored Oct 31, 2023
2 parents 65dddeb + 0374ccb commit d9dbd13
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/owl-core-lib/connectors-owl-core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
()"/>

<xsl:variable name="documentation"
select="f:formatDocString(fn:string-join($connectorDocumentations))"/>
select="fn:normalize-space(f:formatDocString(fn:string-join($connectorDocumentations)))"/>

<xsl:variable name="connectorNotes" as="xs:string*"
select="
Expand All @@ -204,7 +204,7 @@
else
()"/>

<xsl:variable name="note" select="f:formatDocString(fn:string-join($connectorNotes))"/>
<xsl:variable name="note" select="fn:normalize-space(f:formatDocString(fn:string-join($connectorNotes)))"/>


<owl:ObjectProperty rdf:about="{$roleURI}"/>
Expand Down
4 changes: 2 additions & 2 deletions src/owl-core-lib/descriptors-owl-core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<xsl:param name="elementUri"/>
<rdf:Description rdf:about="{$elementUri}">
<skos:definition xml:lang="en">
<xsl:value-of select="$definition"/>
<xsl:value-of select="fn:normalize-space($definition)"/>
</skos:definition>
</rdf:Description>
</xsl:template>
Expand All @@ -65,7 +65,7 @@
<xsl:param name="elementUri"/>
<rdf:Description rdf:about="{$elementUri}">
<skos:editorialNote xml:lang="en">
<xsl:value-of select="$comment"/>
<xsl:value-of select="fn:normalize-space($comment)"/>
</skos:editorialNote>
</rdf:Description>
</xsl:template>
Expand Down
10 changes: 5 additions & 5 deletions src/owl-core-lib/elements-owl-core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<xsl:variable name="className" select="./@name"/>
<xsl:variable name="idref" select="./@xmi:idref"/>
<xsl:variable name="classURI" select="f:buildURIFromElement(.)"/>
<xsl:variable name="documentation" select="f:formatDocString(./properties/@documentation)"/>
<xsl:variable name="documentation" select="fn:normalize-space(f:formatDocString(./properties/@documentation))"/>

<owl:Class rdf:about="{$classURI}"/>

Expand Down Expand Up @@ -210,7 +210,7 @@
for $attribute in $attributesWithSameName
return
if ($attribute/documentation/@value) then
fn:concat(f:formatDocString($attribute/documentation/@value), ' (', $attribute/../../@name, ') ')
fn:concat(fn:normalize-space(f:formatDocString($attribute/documentation/@value)), ' (', $attribute/../../@name, ') ')
else
()"/>
<xsl:variable name="descriptionsWithAnnotations" as="xs:string"
Expand Down Expand Up @@ -316,7 +316,7 @@
<xsl:variable name="dataTypeName" select="./@name"/>
<xsl:variable name="idref" select="./@xmi:idref"/>
<xsl:variable name="dataTypeURI" select="f:buildURIFromElement(.)"/>
<xsl:variable name="documentation" select="f:formatDocString(./properties/@documentation)"/>
<xsl:variable name="documentation" select="fn:normalize-space(f:formatDocString(./properties/@documentation))"/>

<rdfs:Datatype rdf:about="{$dataTypeURI}"/>

Expand Down Expand Up @@ -357,7 +357,7 @@

<xsl:variable name="conceptSchemeURI" select="f:buildURIFromElement(.)"/>
<xsl:variable name="documentation"
select="f:formatDocString(./properties/@documentation)"/>
select="fn:normalize-space(f:formatDocString(./properties/@documentation))"/>


<xsl:if
Expand Down Expand Up @@ -437,7 +437,7 @@
./@name"/>
<xsl:variable name="enumerationAttributeURI" select="f:buildURIFromElement(.)"/>
<xsl:variable name="enumerationURI" select="f:buildURIFromElement(../..)"/>
<xsl:variable name="documentation" select="f:formatDocString(./documentation/@value)"/>
<xsl:variable name="documentation" select="fn:normalize-space(f:formatDocString(./documentation/@value))"/>

<xsl:if
test="not(fn:contains($enumerationAttributeURI, $base-ontology-uri)) and $generateReusedConcepts">
Expand Down
2 changes: 1 addition & 1 deletion src/reasoning-layer-lib/connectors-reasoning-layer.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
<xsl:if test="f:getElementByIdRef($generalisation/source/@xmi:idref, root($generalisation)) and count($subClasses) > 1">

<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl##AllDisjointClasses"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AllDisjointClasses"/>
<owl:members rdf:parseType="Collection">
<xsl:for-each select="$subClasses">
<xsl:variable name="subClassURI" select="f:buildURIFromElement(.)"/>
Expand Down
12 changes: 6 additions & 6 deletions src/shacl-shape-lib/connectors-shacl-shape.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@
<rdf:Description
rdf:about="{f:buildPropertyShapeURI($sourceClassName,$targetRole)}">
<sh:sparql rdf:parseType="Resource">
<sh:select> SELECT ?this ?that WHERE { ?this &lt;<xsl:value-of
<sh:select>SELECT ?this ?that WHERE { ?this &lt;<xsl:value-of
select="$targetRoleURI"/>&gt; ?that . ?that &lt;<xsl:value-of
select="$targetRoleURI"/>&gt; ?this .} </sh:select>
select="$targetRoleURI"/>&gt; ?this .}</sh:select>
</sh:sparql>
</rdf:Description>

Expand All @@ -501,19 +501,19 @@
<rdf:Description
rdf:about="{f:buildPropertyShapeURI($sourceClassName,$targetRole)}">
<sh:sparql rdf:parseType="Resource">
<sh:select> SELECT ?this ?that WHERE { ?this &lt;<xsl:value-of
<sh:select>SELECT ?this ?that WHERE { ?this &lt;<xsl:value-of
select="$targetRoleURI"/>&gt; ?that . ?that &lt;<xsl:value-of
select="$targetRoleURI"/>&gt; ?this .} </sh:select>
select="$targetRoleURI"/>&gt; ?this .}</sh:select>
</sh:sparql>
</rdf:Description>


<rdf:Description
rdf:about="{f:buildPropertyShapeURI($targetClassName,$sourceRole)}">
<sh:sparql rdf:parseType="Resource">
<sh:select> SELECT ?this ?that WHERE { ?this &lt;<xsl:value-of
<sh:select>SELECT ?this ?that WHERE { ?this &lt;<xsl:value-of
select="$sourceRoleURI"/>&gt; ?that . ?that &lt;<xsl:value-of
select="$sourceRoleURI"/>&gt; ?this .} </sh:select>
select="$sourceRoleURI"/>&gt; ?this .}</sh:select>
</sh:sparql>
</rdf:Description>

Expand Down
8 changes: 4 additions & 4 deletions src/shacl-shape-lib/descriptors-shacl-shape.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
<rdf:Description rdf:about="{$uri}">
<xsl:choose>
<xsl:when test="$rdfsComment=fn:true()">
<rdfs:comment><xsl:value-of select="$definition"/></rdfs:comment>
<rdfs:comment><xsl:value-of select="fn:normalize-space($definition)"/></rdfs:comment>
</xsl:when>
<xsl:otherwise>
<sh:description><xsl:value-of select="$definition"/></sh:description>
<sh:description><xsl:value-of select="fn:normalize-space($definition)"/></sh:description>
</xsl:otherwise>
</xsl:choose>
</rdf:Description>
Expand All @@ -83,10 +83,10 @@
<rdf:Description rdf:about="{$uri}">
<xsl:choose>
<xsl:when test="$rdfsComment=fn:true()">
<rdfs:comment><xsl:value-of select="$comment"/></rdfs:comment>
<rdfs:comment><xsl:value-of select="fn:normalize-space($comment)"/></rdfs:comment>
</xsl:when>
<xsl:otherwise>
<sh:description><xsl:value-of select="$comment"/></sh:description>
<sh:description><xsl:value-of select="fn:normalize-space($comment)"/></sh:description>
</xsl:otherwise>
</xsl:choose>
</rdf:Description>
Expand Down
5 changes: 2 additions & 3 deletions src/shacl-shape-lib/elements-shacl-shape.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
select="f:buildShapeURI($class/@name)"/>
<xsl:variable name="classURI" select="f:buildURIFromElement($class)"/>
<xsl:variable name="documentation"
select="f:formatDocString($class/properties/@documentation)"/>
select="fn:normalize-space(f:formatDocString($class/properties/@documentation))"/>

<sh:NodeShape rdf:about="{$shapeClassUri}">
<sh:targetClass rdf:resource="{$classURI}"/>
Expand Down Expand Up @@ -229,8 +229,7 @@
<xsl:template name="abstractClassDeclaration">
<xsl:param name="classURI"/>
<sh:sparql rdf:parseType="Resource">
<sh:select>SELECT ?this WHERE { ?this a &lt;<xsl:value-of select="$classURI"/>&gt; . }
</sh:select>
<sh:select>SELECT ?this WHERE { ?this a &lt;<xsl:value-of select="$classURI"/>&gt; . }</sh:select>
</sh:sparql>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<x:param name="generalisation" href="../../testData/ePO_core_with_tags.xml" select="/xmi:XMI/xmi:Extension[1]/connectors[1]/connector[43]"/>
</x:call>
<x:expect label="there is a rdf:Description" test="boolean(rdf:Description) "/>
<x:expect label="there is a rdf:type with correct URI" test="boolean(rdf:Description/rdf:type) and rdf:Description/rdf:type/@rdf:resource = 'http://www.w3.org/2002/07/owl##AllDisjointClasses'"/>
<x:expect label="there is a rdf:type with correct URI" test="boolean(rdf:Description/rdf:type) and rdf:Description/rdf:type/@rdf:resource = 'http://www.w3.org/2002/07/owl#AllDisjointClasses'"/>
<x:expect label="there is a 3 disjoint classes" test="count(rdf:Description/owl:members/rdf:Description)=3 "/>

</x:scenario>
Expand Down

0 comments on commit d9dbd13

Please sign in to comment.