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

rechecked checkers #169

Merged
merged 1 commit into from
Jun 28, 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

<xd:doc>
<xd:desc>Getting all class attributes and show only the ones that have unmet conventions
[class-attribute-name-21] [class-attribute-multiplicity-22] [class-attribute-type-23]
[class-attribute-type-24] [class-attribute-type-25] [class-attribute-counter-part-65] </xd:desc>
</xd:desc>
</xd:doc>

<xsl:template match="element[@xmi:type = 'uml:Class']/attributes/attribute">
Expand Down
21 changes: 11 additions & 10 deletions src/html-conventions-lib/class-attributes-with-same-name.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
<xsl:import href="../common/formatters.xsl"/>

<xd:doc>
<xd:desc>Applying the checkers to a group of class attributes with same name
[class-attributes-reuse-definition-4] [class-attributes-reuse-multiplicity-5]
[class-attributes-reuse-data-types-6] </xd:desc>
<xd:desc>Applying the checkers to a group of class attributes with same name </xd:desc>
</xd:doc>

<xsl:template name="classAttributesWithSameName">
Expand Down Expand Up @@ -57,8 +55,9 @@
</xsl:template>

<xd:doc>
<xd:desc>[class-attributes-reuse-definition-1] Check the definition values from a group of
class attributes with same name</xd:desc>
<xd:desc>[class-attributes-reuse-definition-1] The attribute $value$ is defined differently in reuse contexts.
When a property is reused in multiple contexts, the meaning given by the definition is expected to be the same.
In this case, multiple definitions are found: $Definitions</xd:desc>
<xd:param name="attributeName"/>
<xd:param name="root"/>
</xd:doc>
Expand Down Expand Up @@ -95,8 +94,9 @@


<xd:doc>
<xd:desc>[class-attributes-reuse-multiplicity-2 ]Check the multiplicity values from a group
of class attributes with same name</xd:desc>
<xd:desc>[class-attributes-reuse-multiplicity-2 ] - The attribute $value$ is has different multiplicities in reuse contexts.
When a property is reused in multiple contexts, the multiplicity is expected to be the same.
Please check the nomenclature above for a summary. </xd:desc>
<xd:param name="attributeName"/>
<xd:param name="root"/>
</xd:doc>
Expand Down Expand Up @@ -136,8 +136,9 @@


<xd:doc>
<xd:desc>[class-attributes-reuse-data-types-6] Check the data-type from a group of class
attributes with same name</xd:desc>
<xd:desc>[class-attributes-reuse-data-types-3] - The attribute $value$ has different datatypes in reuse contexts.
When a property is reused in multiple contexts, the data-type is expected to be the same.
In this case, multiple data-types are found: $Data-types</xd:desc>
<xd:param name="attributeName"/>
<xd:param name="root"/>
</xd:doc>
Expand Down Expand Up @@ -166,7 +167,7 @@
()
else
if (fn:boolean($datatypeValues)) then
f:generateFormattedHtmlError(fn:concat('The attribute ', $attributeName, ' is has different datatypes in reuse contexts.',
f:generateFormattedHtmlWarning(fn:concat('The attribute ', $attributeName, ' is has different datatypes in reuse contexts.',
'When a property is reused in multiple contexts, the data-type is expected to be the same.',
'In this case, multiple data-types are found: '), $datatypeWithAnnotations)
else
Expand Down
7 changes: 3 additions & 4 deletions src/html-conventions-lib/class-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

<xd:doc>
<xd:desc>Getting all classes and attributes and show only the ones with unmet conventions
[class->common-name-11] [class->common-description-12] [class->common-stereotype-13]
</xd:desc>
</xd:doc>

Expand Down Expand Up @@ -148,8 +147,8 @@
</xsl:template>

<xd:doc>
<xd:desc>[class-connector-4] - The class $className$ is not connected to anything. A class
should be connected to otehr elements.</xd:desc>
<xd:desc>[class-connector-4] - The class $className$ is disconnected. A class should be
connected to other elements.</xd:desc>
<xd:param name="class"/>
</xd:doc>

Expand All @@ -162,7 +161,7 @@
()
else
f:generateHtmlWarning(fn:concat('The class ', $class/@name,
' is not connected to anything. A class should be connected to other elements.'))"
' is is disconnected. A class should be connected to other elements.'))"
/>
</xsl:template>

Expand Down
26 changes: 15 additions & 11 deletions src/html-conventions-lib/common-elements-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@


<xd:doc>
<xd:desc>[common-name-9] - The local name segment $value$ contains token delimiters. It is
best if the names are camel cased and delimiters removed. </xd:desc>
<xd:desc>[common-name-9] - The local name segment $value$ contains token delimiters.
It is best if the names are camel-cased and delimiters removed. </xd:desc>
<xd:param name="element"/>
</xd:doc>
<xsl:template name="delimitersInTheLocalSegment">
Expand All @@ -191,8 +191,8 @@


<xd:doc>
<xd:desc>[common-description-10] - $elementName$ is missing a description. All concepts
should be defined or described.</xd:desc>
<xd:desc>[common-description-10] - $elementName$ is missing a description.
All concepts and properties should be defined and/or described.</xd:desc>
<xd:param name="element"/>
<xd:param name="elementType"/>
</xd:doc>
Expand Down Expand Up @@ -389,9 +389,10 @@
</xsl:template>

<xd:doc>
<xd:desc>[common-name-unique] - The name $value$ is not unique. The Concept names should be
unique within the model; while the relations may repeat but should not overlap with
concept names. </xd:desc>
<xd:desc>[common-name-19] - The name $value$ is not unique. The Concept names should be unique within the model.
The following list specifies the names of the which things are not to be reused as the names of which other things:
(a) elements (Class, Datatype, Enumeration, Object) -> elements, attributes, connector roles (dependency and association);
(b) attributes -> elements, connector roles (dependency and association) </xd:desc>
<xd:param name="element"/>
<xd:param name="isAttribute"/>
</xd:doc>
Expand All @@ -411,8 +412,10 @@
select="
if (count($elementsFound) > 0 or count($connectorsFound) > 0) then
f:generateHtmlError(fn:concat('The name ', $element/@name, ' is not unique. The Concept names ',
'should be unique within the model; while the relations may repeat ',
'but should not overlap with concept names. '))
'should be unique within the model. ',
'The following specifies the names of the which things are not to be reused as the names of which other things: ',
'attributes -> elements, connector roles (dependency and association)'
))
else
()

Expand All @@ -424,8 +427,9 @@
select="
if (count($elementsFound) > 1 or count($connectorsFound) > 0 or count($attributesFound) > 0) then
f:generateHtmlError(fn:concat('The name ', $element/@name, ' is not unique. The Concept names ',
'should be unique within the model; while the relations may repeat ',
'but should not overlap with concept names. '))
'should be unique within the model. ',
'The following specifies the names of the which things are not to be reused as the names of which other things: ',
'elements (Class, Datatype, Enumeration, Object) -> elements, attributes, connector roles (dependency and association)'))
else
()

Expand Down
13 changes: 7 additions & 6 deletions src/html-conventions-lib/connectors-with-same-name.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

<xd:doc>
<xd:desc>Applying the checkers to a group of connectors with same name
[connectors-with-same-name-multiplicity-1]
[connectors-with-same-name-definition-2]
</xd:desc>
</xd:doc>

Expand Down Expand Up @@ -59,7 +57,7 @@


<xd:doc>
<xd:desc>[connectors-with-same-name-multiplicity-1]Check the multiplicity values from a group of connectors with same name</xd:desc>
<xd:desc>[connectors-with-same-name-multiplicity-1] - Check the multiplicity values from a group of connectors with same name</xd:desc>
<xd:param name="connectorName"/>
<xd:param name="root"/>
</xd:doc>
Expand All @@ -83,7 +81,9 @@


<xd:doc>
<xd:desc>[connectors-with-same-name-definition-2] Check the definition values from a group of connectors with same name</xd:desc>
<xd:desc>[connectors-with-same-name-definition-2] - When a property is reused in multiple contexts,
the meaning given by the definition is expected to be the same. In this case, multiple definitions
are found: $Definitions</xd:desc>
<xd:param name="connectorName"/>
<xd:param name="root"/>
</xd:doc>
Expand Down Expand Up @@ -122,7 +122,8 @@


<xd:doc>
<xd:desc>[connectors-with-same-name-name-3] Check if the name is used on group of connectors have the same type</xd:desc>
<xd:desc>[connectors-with-same-name-name-3] - The name $Name appears on connectors of different types.
A name shall be reused only on connectors of the same type. </xd:desc>
<xd:param name="connectorName"/>
<xd:param name="root"/>
</xd:doc>
Expand All @@ -139,7 +140,7 @@
if (f:areStringsEqual($typeValues)) then
()
else
f:generateHtmlWarning(fn:concat('The name ', $connectorName,
f:generateHtmlError(fn:concat('The name ', $connectorName,
' appears on connectors of different types. A name shall be reused only on connectors of the same type.'))"
/>
</xsl:template>
Expand Down
4 changes: 2 additions & 2 deletions src/html-conventions-lib/data-type-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@


<xd:doc>
<xd:desc>[datatype-connector-4] The datatype $value should not connect to othe elements.
<xd:desc>[datatype-datatype-4] The datatype $value should not connect to other elements.
A Datatype can only be referred to. </xd:desc>
<xd:param name="dataTypeElement"/>
</xd:doc>
Expand All @@ -194,7 +194,7 @@
select="
if ($outgoingConnectors > 0) then
f:generateHtmlError(fn:concat('The datatype ', $dataTypeElement/@name,
' should not connect to othe elements. A Datatype can only be referred to.'))
' should not connect to other elements. A Datatype can only be referred to.'))
else
()
"
Expand Down
9 changes: 4 additions & 5 deletions src/html-conventions-lib/dependency-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@


<xd:doc>
<xd:desc>Getting all dependencies and show only the ones that have unmet conventions
[dependency-direction-64]</xd:desc>
<xd:desc>Getting all dependencies and show only the ones that have unmet conventions</xd:desc>
</xd:doc>

<xsl:template match="connector[./properties/@ea_type = 'Dependency']">
Expand Down Expand Up @@ -130,7 +129,7 @@


<xd:doc>
<xd:desc>[dependency-direction-64] - The direction is not 'Source->Destination'. Dependecy
<xd:desc>[dependency-direction-1] - The direction is not 'Source->Destination'. Dependecy
direction can be only 'Source->Destination'. </xd:desc>
<xd:param name="dependencyConnector"/>
</xd:doc>
Expand All @@ -148,8 +147,8 @@


<xd:doc>
<xd:desc>[dependency-source-target-types-3] - Dependecies can be provided only between classes and
enumerations or objects..</xd:desc>
<xd:desc>[dependency-source-target-types-2] - Dependecies can be provided only between classes
and enumerations or objects.</xd:desc>
<xd:param name="dependencyConnector"/>
</xd:doc>

Expand Down
8 changes: 4 additions & 4 deletions src/html-conventions-lib/enumeration-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

<xd:doc>
<xd:desc>[enumeration-attribute-2] The enumeration $value$ shall have no values/attributes defined.
An Enumeration stands for an controlled list and its management is out of model scope. </xd:desc>
An Enumeration stands for a controlled list and its management is out of model scope. </xd:desc>
<xd:param name="enumeration"/>
</xd:doc>

Expand All @@ -157,7 +157,7 @@
select="
if ($enumerationNumberOfAttributes > 0) then
f:generateHtmlWarning(fn:concat('The enumeration ', $enumeration/@name,
' shall have no values/attributes defined. An Enumeration stands for an controlled list and its management is out of model scope. '))
' shall have no values/attributes defined. An Enumeration stands for a controlled list and its management is out of model scope. '))
else
()
"
Expand All @@ -166,7 +166,7 @@


<xd:doc>
<xd:desc>[enumeration-connector-3] The enumeration $value should not connect to othe elements.
<xd:desc>[enumeration-connector-3] The enumeration $value should not connect to other elements.
An Enumeration stands for an controlled list and can only be referred to. </xd:desc>
<xd:param name="enumeration"/>
</xd:doc>
Expand All @@ -179,7 +179,7 @@
select="
if ($outgoingConnectors > 0) then
f:generateHtmlError(fn:concat('The enumeration ', $enumeration/@name,
' should not connect to othe elements. An Enumeration stands for an controlled list and can only be referred to.'))
' should not connect to other elements. An Enumeration stands for an controlled list and can only be referred to.'))
else
()
"
Expand Down
2 changes: 1 addition & 1 deletion src/html-conventions-lib/fragments/introduction.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="abstract counter-skip">
<h1>Abstract</h1>
<p>eProcurement UML model needs to conform to a set of UML conventions described
<a href="https://github.com/OP-TED/model2owl/blob/master/doc/uml-conventions/uml-conventions.pdf" target="_blank">elsewhere</a>. A conformance checking script was developed to execute tests to the UML
<a href="https://meaningfy-ws.github.io/model2owl-docs/public-review/uml/conceptual-model-conventions.html" target="_blank">elsewhere</a>. A conformance checking script was developed to execute tests to the UML
model and generate errors or warnings when encountered. </p>

<p>This document was automatically generated by the conformance checking script and
Expand Down
Loading