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

node shape fix #161

Merged
merged 2 commits into from
Jun 22, 2023
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
9 changes: 3 additions & 6 deletions src/shacl-shape-lib/elements-shacl-shape.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<xsl:with-param name="classURI" select="$classURI"/>
</xsl:call-template>
</xsl:if>

</sh:NodeShape>
<xsl:call-template name="shapeLayerName">
<xsl:with-param name="elementName" select="$class/@name"/>
<xsl:with-param name="uri" select="$shapeClassUri"/>
Expand All @@ -60,10 +60,7 @@
<xsl:with-param name="rdfsComment" select="fn:true()"/>
</xsl:call-template>
</xsl:if>



</sh:NodeShape>




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<x:scenario label="Scenario for testing template with match 'element[@xmi:type = 'uml:Class']">
<x:context href="../../testData/ePO-CM_v.3.0.1.eap.xmi" select="/xmi:XMI/xmi:Extension[1]/elements[1]/element[224]"/>
<x:expect label="there is a sh:NodeShape" test="boolean(sh:NodeShape) "/>
<x:expect label="there is a rdfs:label" test="boolean(sh:NodeShape/rdf:Description/rdfs:label)"/>
<x:expect label="there is a rdfs:label" test="boolean(rdf:Description/rdfs:label)"/>
<!-- <x:expect label="there is a rdfs:label" test="boolean(sh:NodeShape/rdfs:label)"/>-->
<x:expect label="there is rdfs:comment" test="boolean(sh:NodeShape/rdf:Description/rdfs:comment)"/>
<x:expect label="there is rdfs:comment" test="boolean(rdf:Description/rdfs:comment)"/>
<!-- <x:expect label="there is rdfs:comment" test="boolean(sh:NodeShape/rdfs:comment)"/>-->
<x:expect label="there is a not sh:minCount" test="not(boolean(sh:NodeShape/sh:property/sh:PropertyShape/sh:minCount))"/>
</x:scenario>
Expand All @@ -27,8 +27,8 @@
<x:scenario label="Scenario for class declaration for class that has no description">
<x:context href="../../testData/ePO-CM-v2.0.1-2020-03-27_test.eap.xmi" select="/xmi:XMI/xmi:Extension[1]/elements[1]/element[34]"/>
<x:expect label="there is a sh:NodeShape" test="boolean(sh:NodeShape) "/>
<x:expect label="there is a rdfs:label" test="boolean(sh:NodeShape/rdf:Description/rdfs:label)"/>
<x:expect label="there is no sh:description" test="not(boolean(sh:NodeShape/rdf:Description/rdfs:comment))"/>
<x:expect label="there is a rdfs:label" test="boolean(rdf:Description/rdfs:label)"/>
<x:expect label="there is no sh:description" test="not(boolean(rdf:Description/rdfs:comment))"/>

</x:scenario>

Expand All @@ -37,16 +37,16 @@
<x:scenario label="Scenario for class declaration for a class that is not abstract">
<x:context href="../../testData/ePO-CM-v2.0.1-2020-03-27_test.eap.xmi" select="/xmi:XMI/xmi:Extension[1]/elements[1]/element[52]"/>
<x:expect label="there is a sh:NodeShape" test="boolean(sh:NodeShape) "/>
<x:expect label="there is a rdfs:label" test="boolean(sh:NodeShape/rdf:Description/rdfs:label)"/>
<x:expect label="there is rdfs:comment" test="boolean(sh:NodeShape/rdf:Description/rdfs:comment)"/>
<x:expect label="there is a rdfs:label" test="boolean(rdf:Description/rdfs:label)"/>
<x:expect label="there is rdfs:comment" test="boolean(rdf:Description/rdfs:comment)"/>

</x:scenario>

<x:scenario label="Scenario for class declaration for an abstract class">
<x:context href="../../testData/ePO-CM-v2.0.1-2020-03-27_test.eap.xmi" select="/xmi:XMI/xmi:Extension[1]/elements[1]/element[155]"/>
<x:expect label="there is a sh:NodeShape" test="boolean(sh:NodeShape) "/>
<x:expect label="there is a rdfs:label" test="boolean(sh:NodeShape/rdf:Description/rdfs:label)"/>
<x:expect label="there is rdfs:comment" test="boolean(sh:NodeShape/rdf:Description/rdfs:comment)"/>
<x:expect label="there is a rdfs:label" test="boolean(rdf:Description/rdfs:label)"/>
<x:expect label="there is rdfs:comment" test="boolean(rdf:Description/rdfs:comment)"/>
<x:expect label="there is sh:sparql" test="boolean(sh:NodeShape/sh:sparql)"/>
<x:expect label="there is sh:select" test="boolean(sh:NodeShape/sh:sparql/sh:select)"/>
</x:scenario>
Expand Down