Skip to content

Commit

Permalink
Merge pull request #195 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 cd46f15 + 83092fe commit 3f095a8
Show file tree
Hide file tree
Showing 36 changed files with 1,579 additions and 511 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/model-2owl-validator-refresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Update github model2owl-validator repo

on:
push:
branches:
- master

jobs:
copy-and-commit:
runs-on: ubuntu-latest

steps:
- name: Checkout model2owl repository
uses: actions/checkout@v2


- name: Copy folder to destination repository
run: |
cd ..
pwd
ls -la
mkdir copied-src-folder
ls -la
echo "directory to copy src folder was created"
cp -r model2owl/src copied-src-folder
ls -la copied-src-folder
ls -la copied-src-folder/src
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
- name: Checkout model2owl validator repository
uses: actions/checkout@v2
with:
repository: meaningfy-ws/model2owl-validator
token: ${{ secrets.GIT_USER }}
- name: second clone
run: |
ls -la
- name: Copy folder to destination repository
run: |
pwd
ls -la
cd ..
ls -la
cp -r copied-src-folder/src model2owl/resources/
cd model2owl/resources
ls -la
- name: Commit and Push to destination repository
run: |
git add .
git commit -m "Copy src folder from model2owl repository"
git status
git remote -v
git push -f https://${{ secrets.GIT_USER }}@github.com/meaningfy-ws/model2owl-validator.git main
78 changes: 51 additions & 27 deletions src/html-conventions-lib/association-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
</xsl:call-template>
<xsl:call-template name="connectorSourceTags">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
</xsl:call-template>
<xsl:call-template name="connectorTags">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
</xsl:call-template>
<xsl:call-template name="connectorGeneralNameProvided">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
Expand All @@ -98,41 +98,48 @@
</xsl:call-template>
<xsl:call-template name="connectorDirectionAndRolesOutOfSync">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
</xsl:call-template>

<!-- End of common connectors checkers rules -->

<!-- End of common connectors checkers rules -->
<!-- Start of specific checker rules-->
<xsl:if test="f:getConnectorDirection(.) = 'Bi-Directional'">

<xsl:call-template name="associationMissingSourceMultiplicity">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
<xsl:call-template name="associationInvalidSourceMultiplicityFormat">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
<xsl:call-template name="associationMissingSourceMultiplicity">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
<xsl:call-template name="associationInvalidSourceMultiplicityFormat">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="associationSourceTargetTypes">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
<xsl:call-template name="connectorUniqueName">
<xsl:with-param name="connector" select="."/>
</xsl:call-template>
</xsl:call-template>
<xsl:call-template name="connectorRoleCrossTypeReuseCheck">
<xsl:with-param name="connector" select="."/>
<xsl:with-param name="isDependency" select="fn:false()"/>
</xsl:call-template>
<!-- End of specific checker rules-->
</xsl:call-template>
<!-- End of specific checker rules-->
</xsl:if>
</xsl:variable>
<xsl:if test="boolean($associationChecks)">
<h2><xsl:value-of select="f:getConnectorName(.)"/></h2>
<dl>
<dt>
Unmet association conventions
</dt>
<xsl:copy-of select="$associationChecks"/>
</dl>
<xsl:choose>
<xsl:when test="$reportType = 'HTML'">
<h2>
<xsl:value-of select="f:getConnectorName(.)"/>
</h2>
<dl>
<dt> Unmet association conventions </dt>
<xsl:copy-of select="$associationChecks"/>
</dl>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$associationChecks"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>

Expand All @@ -148,8 +155,14 @@
<xsl:sequence
select="
if ($connector/source/type/not(@multiplicity)) then
f:generateHtmlError(fn:concat('The source role of ', f:getConnectorName($connector),
' has no multiplicity. Cardinality must be provided for each role.'))
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',
'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-r12&quot; target=&quot;_blank&quot;&gt;CMC-R12&lt;/a&gt;'
)
else
()"
/>
Expand All @@ -171,8 +184,14 @@
if (fn:matches($multiplicityValue, '^[0-9]..[0-9]$') or fn:matches($multiplicityValue, '^[0-9]..\*$')) then
()
else
f:generateHtmlWarning(fn:concat('The connector ', f:getConnectorName($connector),
' has source multiplicity invalidly stated. Multiplicity must be specified in the form [min..max].'))
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',
'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:if>
Expand All @@ -181,7 +200,7 @@

<xd:doc>
<xd:desc>[association-source-target-types-3] - Associations can be
provided only between classes to classes and classes to objects..</xd:desc>
provided only between classes to classes and classes to objects.</xd:desc>
<xd:param name="connector"/>
</xd:doc>

Expand All @@ -194,7 +213,12 @@
if ($sourceType = 'Class' and $targetType = ('Class', 'Object')) then
()
else
f:generateHtmlError('Associations can be provided only between classes to classes and classes to objects.')"
f:generateErrorMessage('Associations can be provided only between classes to classes and classes to objects.',
path($connector),
'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
75 changes: 60 additions & 15 deletions src/html-conventions-lib/class-attributes-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,23 @@
<!-- End of specific checker rules-->
</xsl:variable>
<xsl:if test="boolean($classAttributeChecks)">
<dl id="attribute-{$classAttributeName}">
<dt>
<xsl:value-of select="$classAttributeName"/>
</dt>
<xsl:copy-of select="$classAttributeChecks"/>
</dl>
<xsl:choose>
<xsl:when test="$reportType = 'HTML'">
<dl id="attribute-{$classAttributeName}">
<dt>
<xsl:value-of select="$classAttributeName"/>
</dt>
<xsl:copy-of select="$classAttributeChecks"/>
</dl>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$classAttributeChecks"/>
</xsl:otherwise>
</xsl:choose>




</xsl:if>
</xsl:template>

Expand Down Expand Up @@ -156,13 +167,25 @@
then
if (f:isQNameLowerCasedCamelCase($classAttributeName) = fn:false())
then
f:generateHtmlWarning(fn:concat('The attribute name ', $classAttributeName, ' is invalid. The attribute name must start with a lower case.'))
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',
'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:generateHtmlWarning(fn:concat('The attribute name ', $classAttributeName, ' is invalid. The attribute name must start with a lower case.'))
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',
'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 @@ -183,9 +206,15 @@
if (fn:matches($classAttributeMultiplicityMin, '[0-9\*]') and fn:matches($classAttributeMultiplicityMax, '[0-9\*]')) then
()
else
f:generateHtmlError(fn:concat('The attribute ', $classAttribute/@name, ' multiplicity is incorrect. ',
f:generateErrorMessage(fn:concat('The attribute ', $classAttribute/@name, ' multiplicity is incorrect. ',
'Multiplicity must be specified in the form [min..max] and the values should ',
'be defined with a digit or *'))"
'be defined with a digit or *'),
path($classAttribute),
'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 All @@ -210,9 +239,14 @@
then
()
else
f:generateHtmlError(fn:concat('The attribute type ', $classAttribute/properties/@type,
f:generateErrorMessage(fn:concat('The attribute type ', $classAttribute/properties/@type,
' 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).'))
' (b) belonging to a shortlist of custom URIs (datatypes or classes).'),
path($classAttribute),
'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 @@ -231,9 +265,15 @@
if ($classAttributeMultiplicityMin and $classAttributeMultiplicityMax) then
()
else
f:generateHtmlWarning(fn:concat('The attribute ', $classAttribute/@name, ' multiplicity is missing. ',
f:generateWarningMessage(fn:concat('The attribute ', $classAttribute/@name, ' multiplicity is missing. ',
'Multiplicity must be specified in the form [min..max] and the values should ',
'be defined with a digit or *'))"
'be defined with a digit or *'),
path($classAttribute),
'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 @@ -250,7 +290,12 @@
if ($attributeScope = 'Public') then
()
else
f:generateHtmlWarning(fn:concat('The attribute ', $classAttribute/@name, ' is non-public. Attributes shall be public '))"
f:generateWarningMessage(fn:concat('The attribute ', $classAttribute/@name, ' is non-public. Attributes shall be public '),
path($classAttribute),
'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
Loading

0 comments on commit 3f095a8

Please sign in to comment.