Skip to content

Commit

Permalink
Merge pull request #2 from meaningfy-ws/feature/SM15-120
Browse files Browse the repository at this point in the history
Feature/sm15 120
  • Loading branch information
Dragos0000 authored Feb 8, 2024
2 parents 607a875 + 83092fe commit 9610168
Show file tree
Hide file tree
Showing 17 changed files with 485 additions and 135 deletions.
17 changes: 14 additions & 3 deletions src/html-conventions-lib/association-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@
f:generateErrorMessage(fn:concat('The source role of ', f:getConnectorName($connector),
' has no multiplicity. Cardinality must be provided for each role.'),
path($connector),
'association-multiplicity-1')
'association-multiplicity-1',
'CMC-R11',
'<a href="https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r11" target="_blank">CMC-R11</a>
<a href="https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r12" target="_blank">CMC-R12</a>'
)
else
()"
/>
Expand All @@ -183,7 +187,11 @@
f:generateWarningMessage(fn:concat('The connector ', f:getConnectorName($connector),
' has source multiplicity invalidly stated. Multiplicity must be specified in the form [min..max].'),
path($connector),
'association-multiplicity-2')
'association-multiplicity-2',
'CMC-R11',
'<a href="https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r11" target="_blank">CMC-R11</a>'
)
"
/>
</xsl:if>
Expand All @@ -207,7 +215,10 @@
else
f:generateErrorMessage('Associations can be provided only between classes to classes and classes to objects.',
path($connector),
'association-source-target-types-3')"
'association-source-target-types-3',
'CMC-R12',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r12&quot; target=&quot;_blank&quot;&gt;CMC-R12&lt;/a&gt;'
)"
/>
</xsl:template>

Expand Down
31 changes: 25 additions & 6 deletions src/html-conventions-lib/class-attributes-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,23 @@
then
f:generateWarningMessage(fn:concat('The attribute name ', $classAttributeName, ' is invalid. The attribute name must start with a lower case.'),
path($classAttribute),
'class-attribute-name-1')
'class-attribute-name-1',
'CMC-R4',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r4&quot; target=&quot;_blank&quot;&gt;CMC-R4&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r4&quot; target=&quot;_blank&quot;&gt;GC-R4&lt;/a&gt;'
)
else
()
else
if (fn:contains($uppercaseLetters, fn:substring($classAttributeName, 1, 1)))
then
f:generateWarningMessage(fn:concat('The attribute name ', $classAttributeName, ' is invalid. The attribute name must start with a lower case.'),
path($classAttribute),
'class-attribute-name-1')
'class-attribute-name-1',
'CMC-R4',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r4&quot; target=&quot;_blank&quot;&gt;CMC-R4&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r4&quot; target=&quot;_blank&quot;&gt;GC-R4&lt;/a&gt;'
)
else
()"/>

Expand All @@ -202,7 +210,10 @@
'Multiplicity must be specified in the form [min..max] and the values should ',
'be defined with a digit or *'),
path($classAttribute),
'class-attribute-multiplicity-2')
'class-attribute-multiplicity-2',
'CMC-R11',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r11&quot; target=&quot;_blank&quot;&gt;CMC-R11&lt;/a&gt;'
)
"
/>
</xsl:template>
Expand Down Expand Up @@ -232,7 +243,10 @@
' type is invalid. Attributes must use types that are either: (a) XSD or RDF datatypes or',
' (b) belonging to a shortlist of custom URIs (datatypes or classes).'),
path($classAttribute),
'class-attribute-type-3')
'class-attribute-type-3',
'CMC-R10',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r10&quot; target=&quot;_blank&quot;&gt;CMC-R10&lt;/a&gt;'
)
"
/>
</xsl:template>
Expand All @@ -255,7 +269,10 @@
'Multiplicity must be specified in the form [min..max] and the values should ',
'be defined with a digit or *'),
path($classAttribute),
'class-attribute-multiplicity-4'
'class-attribute-multiplicity-4',
'CMC-R11',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r11&quot; target=&quot;_blank&quot;&gt;CMC-R11&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r10&quot; target=&quot;_blank&quot;&gt;CMC-R10&lt;/a&gt;'
)"
/>
</xsl:template>
Expand All @@ -275,7 +292,9 @@
else
f:generateWarningMessage(fn:concat('The attribute ', $classAttribute/@name, ' is non-public. Attributes shall be public '),
path($classAttribute),
'class-attribute-visibility-5'
'class-attribute-visibility-5',
'CMC-R13',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r13&quot; target=&quot;_blank&quot;&gt;CMC-R13&lt;/a&gt;'
)"
/>
</xsl:template>
Expand Down
15 changes: 12 additions & 3 deletions src/html-conventions-lib/class-attributes-with-same-name.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@
'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: '), $descriptionsWithAnnotations,
'//elements/element/attributes',
'class-attributes-reuse-definition-1'
'class-attributes-reuse-definition-1',
'GC-R5',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r5&quot; target=&quot;_blank&quot;&gt;GC-R5&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r6&quot; target=&quot;_blank&quot;&gt;GC-R6&lt;/a&gt;'
)
else
()"
Expand Down Expand Up @@ -142,7 +145,10 @@
When a property is reused in multiple contexts, the multiplicity is expected to be the same. Please see usage below:'
)), $multiplicityUsage,
'//elements/element/attributes',
'class-attributes-reuse-multiplicity-2'
'class-attributes-reuse-multiplicity-2',
'CMC-R11',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r11&quot; target=&quot;_blank&quot;&gt;CMC-R11&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r6&quot; target=&quot;_blank&quot;&gt;GC-R6&lt;/a&gt;'
)"
/>
</xsl:template>
Expand Down Expand Up @@ -187,7 +193,10 @@
'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,
'//elements/element/attributes',
'class-attributes-reuse-data-types-3'
'class-attributes-reuse-data-types-3',
'GC-R6',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r6&quot; target=&quot;_blank&quot;&gt;GC-R6&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r1&quot; target=&quot;_blank&quot;&gt;GC-R1&lt;/a&gt;'
)
else
()"
Expand Down
18 changes: 14 additions & 4 deletions src/html-conventions-lib/class-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@
f:generateWarningMessage(fn:concat('The class ', $class/@name,
' is is disconnected. A class should be connected to other elements.'),
path($class),
'class-connector-4'
'class-connector-4',
'CMC-R12',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r12&quot; target=&quot;_blank&quot;&gt;CMC-R12&lt;/a&gt;'
)"
/>
</xsl:template>
Expand All @@ -191,7 +193,9 @@
if ($classNumberOfAttributes = 0) then
f:generateWarningMessage(fn:concat('The class ', $class/@name, ' has no attributes provided. A class should define some attributes.'),
path($class),
'class-attributes-3'
'class-attributes-3',
'CMC-R10',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r10&quot; target=&quot;_blank&quot;&gt;CMC-R10&lt;/a&gt;'
)
else
()"
Expand All @@ -216,7 +220,10 @@
then
f:generateWarningMessage(fn:concat('The class name ', $className, ' is invalid. The class name must start with a capital case.'),
path($class),
'class-name-2'
'class-name-2',
'CMC-R4',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r4&quot; target=&quot;_blank&quot;&gt;CMC-R4&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r4&quot; target=&quot;_blank&quot;&gt;GC-R4&lt;/a&gt;'
)
else
()
Expand All @@ -227,7 +234,10 @@
else
f:generateWarningMessage(fn:concat('The class name ', $className, ' is invalid. The class name must start with a capital case.'),
path($class),
'class-name-2'
'class-name-2',
'CMC-R4',
'&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r4&quot; target=&quot;_blank&quot;&gt;CMC-R4&lt;/a&gt;
&lt;a href=&quot;https://semiceu.github.io/style-guide/1.0.0/gc-general-conventions.html#sec:gc-r4&quot; target=&quot;_blank&quot;&gt;GC-R4&lt;/a&gt;'
)"
/>
</xsl:template>
Expand Down
Loading

0 comments on commit 9610168

Please sign in to comment.