From 71ba16c454aeac107c97c33f6ad70ea9e55f2195 Mon Sep 17 00:00:00 2001 From: Dragos0000 Date: Thu, 29 Aug 2024 16:32:25 +0100 Subject: [PATCH 1/6] WIP --- src/html-model-glossary/glossary.xsl | 79 ++--- src/owl-core-lib/connectors-owl-core.xsl | 188 ++++++----- src/owl-core-lib/elements-owl-core.xsl | 299 +++++++++--------- .../connectors-reasoning-layer.xsl | 171 ++++++---- .../elements-reasoning-layer.xsl | 71 +++-- .../connectors-shacl-shape.xsl | 23 +- src/shacl-shape-lib/elements-shacl-shape.xsl | 221 ++++++------- test/ePO-default-config/config-parameters.xsl | 10 +- 8 files changed, 601 insertions(+), 461 deletions(-) diff --git a/src/html-model-glossary/glossary.xsl b/src/html-model-glossary/glossary.xsl index f70d7723..6e086461 100644 --- a/src/html-model-glossary/glossary.xsl +++ b/src/html-model-glossary/glossary.xsl @@ -38,10 +38,10 @@ - + - + @@ -71,15 +71,19 @@ - - - - + + + + + + @@ -92,12 +96,14 @@ + + @@ -109,25 +115,25 @@ select="f:getClassAttributeByName($attributeName, $root)"/> - + - + - + @@ -145,17 +151,18 @@ - - + @@ -169,25 +176,25 @@ - - + + - - - - + + + + - - - - - + + + + + @@ -204,7 +211,7 @@ select=" for $connector in $connectorsWithSameName return - f:formatDocString(fn:concat($connector/documentation/@value, $connector/source/documentation/@value, $connector/target/documentation/@value))" + f:formatDocString(fn:concat($connector/documentation/@value, $connector/source/documentation/@value, $connector/target/documentation/@value))" />
Class nameClass name Attribute name DefinitionData type / cardinality
- - - - -
+ + + + +

+ - + - +
- -
+ +
@@ -236,8 +243,7 @@ if ($sourceClass and $targetClass) then fn:concat($sourceClass, ' -> ', $targetClass, ' [', $targetMultiplicity, ']') else - ()" - /> + ()"/>
@@ -247,8 +253,7 @@ if ($sourceClass and $targetClass) then fn:concat($sourceClass, ' [,', $sourceMultiplicity, ']', ' <- ', $targetClass) else - ()" - /> + ()"/>
diff --git a/src/owl-core-lib/connectors-owl-core.xsl b/src/owl-core-lib/connectors-owl-core.xsl index b9c6feb0..5afbbf1a 100644 --- a/src/owl-core-lib/connectors-owl-core.xsl +++ b/src/owl-core-lib/connectors-owl-core.xsl @@ -43,9 +43,19 @@ - - - + + + + + + + + + + @@ -54,45 +64,36 @@ - - - - - + + + - - - - - - - + - Applying core layer rules to generalisation connectors with distinct targets + Applying core layer rules to generalisation connectors with distinct + targets - + - - - - - - + + + + + test="$generateReusedConceptsOWLcore or ($sourcePrefix = $internalModelPrefixesList and $targetPrefix = $internalModelPrefixesList)"> @@ -100,8 +101,8 @@ - Rule R.15. Property generalisation — in core ontology layer. Specify - sub-property axiom for the generalisation between UML association/dependency connectors. + Rule R.15. Property generalisation — in core ontology layer. Specify sub-property + axiom for the generalisation between UML association/dependency connectors. @@ -127,10 +128,33 @@ () else f:buildURIfromLexicalQName($sourceConnector/target/role/@name)"/> + + + + - - - + + + + + + + + + + + + - - - + + + + + + + + + + @@ -164,19 +211,15 @@ test=" f:getConnectorByName(., $root)/source/model/@type != 'ProxyConnector' and f:getConnectorByName(., $root)/target/model/@type != 'ProxyConnector' and f:getConnectorByName(., $root)/properties/@ea_type = ('Association', 'Dependency')"> - - - - - - - - + + + @@ -219,25 +262,26 @@ else ()"/> - + - - + + + + + + + - - - - - - - + + - + @@ -255,13 +299,13 @@ - - + + - Rule R.14. Class generalisation — in core ontology layer. Specify subclass - axiom for the generalisation between UML Classes. + Rule R.14. Class generalisation — in core ontology layer. Specify subclass axiom + for the generalisation between UML Classes. @@ -276,16 +320,16 @@ - + - + - Rule R.19. - Declare an individual with a specified class as its type, - for a UML Realization connector between a UML Object and a UML Class. + Rule R.19. - Declare an individual with a specified class as its type, for a UML + Realization connector between a UML Object and a UML Class. - + @@ -294,8 +338,8 @@ - - + + @@ -305,7 +349,7 @@ - + diff --git a/src/owl-core-lib/elements-owl-core.xsl b/src/owl-core-lib/elements-owl-core.xsl index 9c20e489..0f4767e4 100644 --- a/src/owl-core-lib/elements-owl-core.xsl +++ b/src/owl-core-lib/elements-owl-core.xsl @@ -31,14 +31,14 @@ cdata-section-elements="lines"/> - Rule T.05. Comment — in core ontology layer. Specify an annotation axiom (comment or editorial note) - on the OWL entity for the UML Comment associated to a UML element. + Rule T.05. Comment — in core ontology layer. Specify an annotation axiom (comment + or editorial note) on the OWL entity for the UML Comment associated to a UML element. Selector to run core layer transfomation rules for commnents - + - + @@ -46,7 +46,7 @@ - + @@ -54,10 +54,10 @@ + if ($connectorFound/target/role/not(@name) = fn:true()) then + () + else + f:buildURIfromLexicalQName($connectorFound/target/role/@name)"/> @@ -68,16 +68,16 @@ + if ($connectorFound/target/role/not(@name) = fn:true()) then + () + else + f:buildURIfromLexicalQName($connectorFound/target/role/@name)"/> + if ($connectorFound/source/role/not(@name) = fn:true()) then + () + else + f:buildURIfromLexicalQName($connectorFound/source/role/@name)"/> @@ -103,11 +103,9 @@ Selector to run core layer transformation rules for classes - - - - + + + @@ -122,7 +120,8 @@ - + @@ -136,11 +135,11 @@ - + - + @@ -167,14 +166,12 @@ + + + + - - - - - - + test="$generateReusedConceptsOWLcore or $attributePrefix = $internalModelPrefixesList"> @@ -210,7 +207,7 @@ for $attribute in $attributesWithSameName return if ($attribute/documentation/@value) then - fn:concat(fn:normalize-space(f:formatDocString($attribute/documentation/@value)), ' (', $attribute/../../@name, ') ') + fn:concat(fn:normalize-space(f:formatDocString($attribute/documentation/@value)), ' (', $attribute/../../@name, ') ') else ()"/> - + @@ -283,20 +280,14 @@ + + + + + test="$generateReusedConceptsOWLcore or $dataTypePrefix = $internalModelPrefixesList"> - - - - - - - - - - - + @@ -316,7 +307,8 @@ - + @@ -334,7 +326,7 @@ - + @@ -354,67 +346,71 @@ - - - + + + + + - - + + - - - - - - - + + - + + + + + + - - - - - - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + + + + + + - - - - - - - + + - - - + + + + + + + + + @@ -435,72 +431,79 @@ ./initial/@body else ./@name"/> - - - - + + - - - + test="$generateReusedConceptsOWLcore or $enumerationAttributePrefix = $internalModelPrefixesList"> + + + - + - - - - - - - + + + + + + + - + + + + + + - - - - - - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - + + + + + + + + + diff --git a/src/reasoning-layer-lib/connectors-reasoning-layer.xsl b/src/reasoning-layer-lib/connectors-reasoning-layer.xsl index 238615b8..d8665f2d 100644 --- a/src/reasoning-layer-lib/connectors-reasoning-layer.xsl +++ b/src/reasoning-layer-lib/connectors-reasoning-layer.xsl @@ -10,7 +10,7 @@ xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:dct="http://purl.org/dc/terms/" - xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:functx="http://www.functx.com" + xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:functx="http://www.functx.com" xmlns:f="http://https://github.com/costezki/model2owl#" version="3.0"> @@ -25,10 +25,15 @@ + + + + + ($generateReusedConceptsOWLrestrictions or + ($sourcePrefix = $internalModelPrefixesList and $targetPrefix = $internalModelPrefixesList))"> @@ -43,10 +48,14 @@ + + + + ($generateReusedConceptsOWLrestrictions or + ($sourcePrefix = $internalModelPrefixesList and $targetPrefix = $internalModelPrefixesList))"> @@ -54,7 +63,11 @@ - + @@ -66,30 +79,43 @@ - - - - - - - + + + + + + + + - - + - Applying reasoning layer rules to generalisation connectors with distinct targets + Applying reasoning layer rules to generalisation connectors with distinct + targets - + - - - + + + + + + + + + + + - - + + Applying reasoning layer rules to connectors with distinct names [Dependency and @@ -100,20 +126,24 @@ + - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -366,9 +396,20 @@ select="f:buildURIfromLexicalQName($generalisation/source/model/@name)"/> - - - + + + + + + + + + @@ -401,6 +442,7 @@ select="f:getConnectorByIdRef($targetConnectorIdref, root($generalisation))"/> + - - - - - - + + + + + + + + + + @@ -615,30 +667,27 @@ + + + + - - - - - - - - - - - - - - + test="f:getElementByIdRef($generalisation/source/@xmi:idref, root($generalisation)) and count($subClasses) > 1"> + + + + + + + + + + - + - + This will override the common selector when applying templates diff --git a/src/reasoning-layer-lib/elements-reasoning-layer.xsl b/src/reasoning-layer-lib/elements-reasoning-layer.xsl index c7dcaa7d..066c15ee 100644 --- a/src/reasoning-layer-lib/elements-reasoning-layer.xsl +++ b/src/reasoning-layer-lib/elements-reasoning-layer.xsl @@ -26,9 +26,16 @@ Applying reasoning layer rule to all attributes - - - + + + + + + + + + @@ -38,19 +45,25 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -302,16 +315,22 @@ - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/shacl-shape-lib/connectors-shacl-shape.xsl b/src/shacl-shape-lib/connectors-shacl-shape.xsl index c7b6bb57..91ae33be 100644 --- a/src/shacl-shape-lib/connectors-shacl-shape.xsl +++ b/src/shacl-shape-lib/connectors-shacl-shape.xsl @@ -32,8 +32,16 @@ + + + + test=" + not(./source/model/@type = 'ProxyConnector' or ./target/model/@type = 'ProxyConnector') and ( + $generateReusedConceptsSHACL = fn:true() + or + ($sourcePrefix = $internalModelPrefixesList and $targetPrefix = $internalModelPrefixesList) + )"> @@ -54,9 +62,16 @@ - + + + + test=" + not(./source/model/@type = 'ProxyConnector' or ./target/model/@type = ('ProxyConnector', 'Object')) and ( + $generateReusedConceptsSHACL = fn:true() + or + ($sourcePrefix = $internalModelPrefixesList and $targetPrefix = $internalModelPrefixesList) + )"> @@ -76,7 +91,7 @@ - diff --git a/src/shacl-shape-lib/elements-shacl-shape.xsl b/src/shacl-shape-lib/elements-shacl-shape.xsl index 171349f8..7867234c 100644 --- a/src/shacl-shape-lib/elements-shacl-shape.xsl +++ b/src/shacl-shape-lib/elements-shacl-shape.xsl @@ -21,17 +21,17 @@ - - + + - Rule T.06. Comment — in data shape layer. Specify an annotation axiom (comment or description) - on the SHACL shape for the UML Comment associated to a UML element. + Rule T.06. Comment — in data shape layer. Specify an annotation axiom (comment or + description) on the SHACL shape for the UML Comment associated to a UML element. Selector to run core layer transfomation rules for commnents - + - + @@ -40,7 +40,7 @@ - + @@ -48,10 +48,10 @@ + if ($connectorFound/target/role/not(@name) = fn:true()) then + () + else + f:buildPropertyShapeURI($connectorFound/source/model/@name, $connectorFound/target/role/@name)"/> @@ -63,16 +63,16 @@ + if ($connectorFound/target/role/not(@name) = fn:true()) then + () + else + f:buildPropertyShapeURI($connectorFound/source/model/@name, $connectorFound/target/role/@name)"/> + if ($connectorFound/source/role/not(@name) = fn:true()) then + () + else + f:buildPropertyShapeURI($connectorFound/target/model/@name, $connectorFound/source/role/@name)"/> @@ -92,116 +92,121 @@ - - - - + + + + - Rule C.02. Class — in data shape layer. Specify a SHACL NodeShape declaration axiom - for each UML Class. The URIs of the node shape and of the OWL class they refer to, - are deterministically generated from the UML Class name. + Rule C.02. Class — in data shape layer. Specify a SHACL NodeShape declaration axiom + for each UML Class. The URIs of the node shape and of the OWL class they refer to, are + deterministically generated from the UML Class name. - + + + + + + + - - + + + + + - - - + + + + + + + + + + + - - - - - - - - - - + - + - - - - - - + - + Applying shape layer rules to attributes - - + - - - - - - - - - - - - + + + + + + + + + + + + + + - Rule C.06. Class attribute — in data shape layer. - Specify a SHACL PropertyShape declaration axiom for each attribute. - + Rule C.06. Class attribute — in data shape layer. Specify a SHACL PropertyShape + declaration axiom for each attribute. + - + - + - - + select="f:buildPropertyShapeURI($className, $attribute/@name)"/> + + - + @@ -218,37 +223,39 @@ - + - Rule C.03. Abstract class — in data shape layer. Specify a SHACL NodeShape declaration axiom - for each abstract UML Class, with a SPARQL constraint that selects all instances of this class. + Rule C.03. Abstract class — in data shape layer. Specify a SHACL NodeShape + declaration axiom for each abstract UML Class, with a SPARQL constraint that selects all + instances of this class. - SELECT ?this WHERE { ?this a <> . } + SELECT ?this WHERE { ?this a <> . + } - - Rule C.08. Attribute type — in data shape layer . Within the SHACL PropertyShape corresponding to an attribute of a UML Class, - specify property constraints indicating the range class or datatype. + + Rule C.08. Attribute type — in data shape layer . Within the SHACL PropertyShape + corresponding to an attribute of a UML Class, specify property constraints indicating + the range class or datatype. - - + + - + - + select="f:buildPropertyShapeURI($className, $attribute/@name)"/> + - + f:buildURIfromLexicalQName($datatype)"/> + @@ -276,10 +282,10 @@ - + f:buildURIfromLexicalQName($attributeType)"/> + @@ -287,17 +293,12 @@ - Rule C.11. Attribute range shape — in data shape layer . Within the SHACL Node Shape - corresponding to the UML class, specify property constraints, corresponding to each - attribute, indicating the minimum and maximum cardinality, only where min and max are - different from * (any) and multiplicity is not [1..1]. - 1. exact cardinality, e.g. [2..2] - 2. minimum cardinality only, e.g. [1..*] - 3. maximum cardinality only, e.g. [*..2] - 4. minimum and maximum cardinality , e.g. [1..2] - - - + Rule C.11. Attribute range shape — in data shape layer . Within the SHACL Node + Shape corresponding to the UML class, specify property constraints, corresponding to + each attribute, indicating the minimum and maximum cardinality, only where min and max + are different from * (any) and multiplicity is not [1..1]. 1. exact cardinality, e.g. + [2..2] 2. minimum cardinality only, e.g. [1..*] 3. maximum cardinality only, e.g. [*..2] + 4. minimum and maximum cardinality , e.g. [1..2] @@ -313,7 +314,7 @@ + select="f:buildPropertyShapeURI($className, $attribute/@name)"/> @@ -339,9 +340,9 @@ - + - + diff --git a/test/ePO-default-config/config-parameters.xsl b/test/ePO-default-config/config-parameters.xsl index f7b05a0e..d55e2ae2 100644 --- a/test/ePO-default-config/config-parameters.xsl +++ b/test/ePO-default-config/config-parameters.xsl @@ -71,14 +71,18 @@ - - + + - + + + + + From 150b9c11ef55a59fead1d7d259dadc856e93c62e Mon Sep 17 00:00:00 2001 From: Dragos0000 Date: Mon, 2 Sep 2024 16:16:03 +0100 Subject: [PATCH 2/6] control flag for conventions and fixed glossary --- .../association-html-conventions.xsl | 8 +- .../class-attributes-html-conventions.xsl | 163 +++++++++--------- .../class-attributes-with-same-name.xsl | 2 + .../class-html-conventions.xsl | 159 ++++++++--------- .../connectors-with-same-name.xsl | 141 +++++++-------- .../data-type-html-conventions.xsl | 152 ++++++++-------- .../dependency-html-conventions.xsl | 6 +- .../enumeration-html-conventions.xsl | 150 ++++++++-------- .../generalization-html-conventions.xsl | 6 +- .../object-html-conventions.xsl | 6 +- .../realisation-html-conventions.xsl | 58 ++++--- src/html-model-glossary/glossary.xsl | 8 +- test/ePO-default-config/config-parameters.xsl | 3 +- 13 files changed, 449 insertions(+), 413 deletions(-) diff --git a/src/html-conventions-lib/association-html-conventions.xsl b/src/html-conventions-lib/association-html-conventions.xsl index a75f73b7..8ab82ef3 100644 --- a/src/html-conventions-lib/association-html-conventions.xsl +++ b/src/html-conventions-lib/association-html-conventions.xsl @@ -24,8 +24,14 @@ + + + + - + + diff --git a/src/html-conventions-lib/class-attributes-html-conventions.xsl b/src/html-conventions-lib/class-attributes-html-conventions.xsl index d224a37e..20722b7d 100644 --- a/src/html-conventions-lib/class-attributes-html-conventions.xsl +++ b/src/html-conventions-lib/class-attributes-html-conventions.xsl @@ -32,85 +32,88 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -126,9 +129,9 @@ - - - + + + diff --git a/src/html-conventions-lib/class-attributes-with-same-name.xsl b/src/html-conventions-lib/class-attributes-with-same-name.xsl index d5393357..129a150a 100644 --- a/src/html-conventions-lib/class-attributes-with-same-name.xsl +++ b/src/html-conventions-lib/class-attributes-with-same-name.xsl @@ -30,6 +30,7 @@ + @@ -61,6 +62,7 @@ + diff --git a/src/html-conventions-lib/class-html-conventions.xsl b/src/html-conventions-lib/class-html-conventions.xsl index 05c903ac..3c33d4d6 100644 --- a/src/html-conventions-lib/class-html-conventions.xsl +++ b/src/html-conventions-lib/class-html-conventions.xsl @@ -25,87 +25,90 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -113,8 +116,8 @@ -

- +

+

diff --git a/src/html-conventions-lib/connectors-with-same-name.xsl b/src/html-conventions-lib/connectors-with-same-name.xsl index 840988f3..eeb1364f 100644 --- a/src/html-conventions-lib/connectors-with-same-name.xsl +++ b/src/html-conventions-lib/connectors-with-same-name.xsl @@ -17,48 +17,50 @@ - Applying the checkers to a group of connectors with same name - + Applying the checkers to a group of connectors with same name -

Connectors with multiple usages

+

Connectors with multiple usages

- + - - - - - - - - - - - - - - - - - - -
-
- -
-
- + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ -
- - - -
+
+ + + +
+
@@ -67,7 +69,8 @@ - [connectors-with-same-name-multiplicity-1] - Check the multiplicity values from a group of connectors with same name + [connectors-with-same-name-multiplicity-1] - Check the multiplicity values from a + group of connectors with same name @@ -85,22 +88,22 @@ if (f:areStringsEqual($multiplicityValues) and $allConnectorsHaveMultiplicityValue) then () else - f:generateWarningMessage( - 'When a property is reused in multiple contexts the multiplicity is expected to be the same.', - '//connectors', - 'connectors-with-same-name-multiplicity-1', - 'CMC-R12', - '<a href="https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r12" target="_blank">CMC-R12</a>' - - )" + f:generateWarningMessage( + 'When a property is reused in multiple contexts the multiplicity is expected to be the same.', + '//connectors', + 'connectors-with-same-name-multiplicity-1', + 'CMC-R12', + '<a href="https://semiceu.github.io/style-guide/1.0.0/gc-conceptual-model-conventions.html#sec:cmc-r12" target="_blank">CMC-R12</a>' + + )" /> - [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 + [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 @@ -119,14 +122,14 @@ if ($connector/documentation/@value) then fn:concat($connector/documentation/@value, ' (', f:getConnectorName($connector), ') ') else - fn:concat('...', ' (', f:getConnectorName($connector), ') ')"/> + fn:concat('...', ' (', f:getConnectorName($connector), ') ')"/> - - + + - [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. + [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. @@ -163,19 +166,19 @@ select="f:getConnectorByName($connectorName, $root)"/> - + diff --git a/src/html-conventions-lib/data-type-html-conventions.xsl b/src/html-conventions-lib/data-type-html-conventions.xsl index 49e82916..b7e3a539 100644 --- a/src/html-conventions-lib/data-type-html-conventions.xsl +++ b/src/html-conventions-lib/data-type-html-conventions.xsl @@ -32,83 +32,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/html-conventions-lib/dependency-html-conventions.xsl b/src/html-conventions-lib/dependency-html-conventions.xsl index 408fd7f1..b11c3bb5 100644 --- a/src/html-conventions-lib/dependency-html-conventions.xsl +++ b/src/html-conventions-lib/dependency-html-conventions.xsl @@ -24,8 +24,12 @@ + + + - + diff --git a/src/html-conventions-lib/enumeration-html-conventions.xsl b/src/html-conventions-lib/enumeration-html-conventions.xsl index 7e32199c..ebc40e55 100644 --- a/src/html-conventions-lib/enumeration-html-conventions.xsl +++ b/src/html-conventions-lib/enumeration-html-conventions.xsl @@ -24,94 +24,96 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - + + + + +

- +

diff --git a/src/html-conventions-lib/generalization-html-conventions.xsl b/src/html-conventions-lib/generalization-html-conventions.xsl index 6684212b..e6b85242 100644 --- a/src/html-conventions-lib/generalization-html-conventions.xsl +++ b/src/html-conventions-lib/generalization-html-conventions.xsl @@ -25,8 +25,12 @@ + + + - + diff --git a/src/html-conventions-lib/object-html-conventions.xsl b/src/html-conventions-lib/object-html-conventions.xsl index 2af23701..c31a65e7 100644 --- a/src/html-conventions-lib/object-html-conventions.xsl +++ b/src/html-conventions-lib/object-html-conventions.xsl @@ -25,12 +25,13 @@ - + + @@ -108,13 +109,14 @@ +

- +

diff --git a/src/html-conventions-lib/realisation-html-conventions.xsl b/src/html-conventions-lib/realisation-html-conventions.xsl index b566b66d..554f1d33 100644 --- a/src/html-conventions-lib/realisation-html-conventions.xsl +++ b/src/html-conventions-lib/realisation-html-conventions.xsl @@ -26,25 +26,30 @@ + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -166,7 +171,8 @@ - [realisation-source-target-types-5] - The realisation can be provided only from an Object to a Class or Enumeration + [realisation-source-target-types-5] - The realisation can be provided only from an + Object to a Class or Enumeration @@ -176,15 +182,15 @@ diff --git a/src/html-model-glossary/glossary.xsl b/src/html-model-glossary/glossary.xsl index 6e086461..d1acf902 100644 --- a/src/html-model-glossary/glossary.xsl +++ b/src/html-model-glossary/glossary.xsl @@ -221,7 +221,7 @@ if (f:getElementByIdRef(./target/@xmi:idref, $root)/@name) then f:getElementByIdRef(./target/@xmi:idref, $root)/@name else - if ($reference-to-external-classes-in-glossary) then + if ($generateReusedConceptsGlossary) then fn:concat(./target/model/@name, ' (external)') else ()"/> @@ -230,7 +230,7 @@ if (f:getElementByIdRef(./source/@xmi:idref, $root)/@name) then f:getElementByIdRef(./source/@xmi:idref, $root)/@name else - if ($reference-to-external-classes-in-glossary) then + if ($generateReusedConceptsGlossary) then fn:concat(./source/model/@name, ' (external)') else ()"/> @@ -271,7 +271,7 @@ if (f:getElementByIdRef($connectorsWithSameName/target/@xmi:idref, $root)/@name) then f:getElementByIdRef($connectorsWithSameName/target/@xmi:idref, $root)/@name else - if ($reference-to-external-classes-in-glossary) then + if ($generateReusedConceptsGlossary) then fn:concat($connectorsWithSameName/target/model/@name, ' (external)') else ()"/> @@ -280,7 +280,7 @@ if (f:getElementByIdRef($connectorsWithSameName/source/@xmi:idref, $root)/@name) then f:getElementByIdRef($connectorsWithSameName/source/@xmi:idref, $root)/@name else - if ($reference-to-external-classes-in-glossary) then + if ($generateReusedConceptsGlossary) then fn:concat($connectorsWithSameName/source/model/@name, ' (external)') else ()"/> diff --git a/test/ePO-default-config/config-parameters.xsl b/test/ePO-default-config/config-parameters.xsl index d55e2ae2..72d7b702 100644 --- a/test/ePO-default-config/config-parameters.xsl +++ b/test/ePO-default-config/config-parameters.xsl @@ -77,7 +77,7 @@ - + @@ -85,7 +85,6 @@ - From b0a9af90c0361fc610bd3887bb30f13a3f5bb7e0 Mon Sep 17 00:00:00 2001 From: Dragos0000 Date: Tue, 3 Sep 2024 15:10:22 +0100 Subject: [PATCH 3/6] readjusted reused concepts filters --- Makefile | 2 +- src/common/fetchers.xsl | 9 +++ .../association-html-conventions.xsl | 9 +-- .../class-attributes-html-conventions.xsl | 4 +- .../class-attributes-with-same-name.xsl | 3 +- .../class-html-conventions.xsl | 4 +- .../connectors-with-same-name.xsl | 4 +- .../data-type-html-conventions.xsl | 4 +- .../dependency-html-conventions.xsl | 7 +- .../enumeration-html-conventions.xsl | 4 +- .../generalization-html-conventions.xsl | 8 +-- .../object-html-conventions.xsl | 3 +- .../realisation-html-conventions.xsl | 9 +-- src/owl-core-lib/connectors-owl-core.xsl | 10 +-- src/owl-core-lib/elements-owl-core.xsl | 66 +------------------ .../connectors-reasoning-layer.xsl | 28 ++++---- .../connectors-shacl-shape.xsl | 15 ++--- test/ePO-default-config/config-parameters.xsl | 9 ++- .../unitTests/test-common/test-fetchers.xspec | 14 ++++ 19 files changed, 68 insertions(+), 144 deletions(-) diff --git a/Makefile b/Makefile index 3d60a920..80df4822 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ owl-core: @ls -lh ${OUTPUT_FOLDER_PATH}/${XMI_INPUT_FILENAME_WITHOUT_EXTENSION}.rdf owl-restrictions: @java -jar ${SAXON} -s:${XMI_INPUT_FILE_PATH} -xsl:${MODEL2OWL_FOLDER}/src/owl-restrictions.xsl -o:${OUTPUT_FOLDER_PATH}/${XMI_INPUT_FILENAME_WITHOUT_EXTENSION}_restrictions.rdf - @echo Output owl restrictions file: + @echo Output owl restrictions file: @ls -lh ${OUTPUT_FOLDER_PATH}/${XMI_INPUT_FILENAME_WITHOUT_EXTENSION}_restrictions.rdf shacl: @java -jar ${SAXON} -s:${XMI_INPUT_FILE_PATH} -xsl:${MODEL2OWL_FOLDER}/src/shacl-shapes.xsl -o:${OUTPUT_FOLDER_PATH}/${XMI_INPUT_FILENAME_WITHOUT_EXTENSION}_shapes.rdf diff --git a/src/common/fetchers.xsl b/src/common/fetchers.xsl index a97f2ff2..2a482823 100644 --- a/src/common/fetchers.xsl +++ b/src/common/fetchers.xsl @@ -329,4 +329,13 @@ + + Fetch role name value from a connector. It can be either in source or in target + + + + + + + \ No newline at end of file diff --git a/src/html-conventions-lib/association-html-conventions.xsl b/src/html-conventions-lib/association-html-conventions.xsl index 8ab82ef3..491fb159 100644 --- a/src/html-conventions-lib/association-html-conventions.xsl +++ b/src/html-conventions-lib/association-html-conventions.xsl @@ -24,14 +24,7 @@ - - - - - - @@ -129,7 +122,7 @@ - + diff --git a/src/html-conventions-lib/class-attributes-html-conventions.xsl b/src/html-conventions-lib/class-attributes-html-conventions.xsl index 20722b7d..2c2368cf 100644 --- a/src/html-conventions-lib/class-attributes-html-conventions.xsl +++ b/src/html-conventions-lib/class-attributes-html-conventions.xsl @@ -32,8 +32,6 @@ - @@ -113,7 +111,7 @@ - + diff --git a/src/html-conventions-lib/class-attributes-with-same-name.xsl b/src/html-conventions-lib/class-attributes-with-same-name.xsl index 129a150a..4ac532a6 100644 --- a/src/html-conventions-lib/class-attributes-with-same-name.xsl +++ b/src/html-conventions-lib/class-attributes-with-same-name.xsl @@ -30,7 +30,6 @@ - @@ -62,7 +61,7 @@ - + diff --git a/src/html-conventions-lib/class-html-conventions.xsl b/src/html-conventions-lib/class-html-conventions.xsl index 3c33d4d6..8901c701 100644 --- a/src/html-conventions-lib/class-html-conventions.xsl +++ b/src/html-conventions-lib/class-html-conventions.xsl @@ -31,8 +31,6 @@ - @@ -108,7 +106,7 @@ - + diff --git a/src/html-conventions-lib/connectors-with-same-name.xsl b/src/html-conventions-lib/connectors-with-same-name.xsl index eeb1364f..af0a2064 100644 --- a/src/html-conventions-lib/connectors-with-same-name.xsl +++ b/src/html-conventions-lib/connectors-with-same-name.xsl @@ -28,8 +28,6 @@ - @@ -62,7 +60,7 @@ - + diff --git a/src/html-conventions-lib/data-type-html-conventions.xsl b/src/html-conventions-lib/data-type-html-conventions.xsl index b7e3a539..f282ce2c 100644 --- a/src/html-conventions-lib/data-type-html-conventions.xsl +++ b/src/html-conventions-lib/data-type-html-conventions.xsl @@ -32,8 +32,6 @@ - @@ -110,7 +108,7 @@ - + diff --git a/src/html-conventions-lib/dependency-html-conventions.xsl b/src/html-conventions-lib/dependency-html-conventions.xsl index b11c3bb5..25281138 100644 --- a/src/html-conventions-lib/dependency-html-conventions.xsl +++ b/src/html-conventions-lib/dependency-html-conventions.xsl @@ -24,12 +24,7 @@ - - - - @@ -116,7 +111,7 @@ - + diff --git a/src/html-conventions-lib/enumeration-html-conventions.xsl b/src/html-conventions-lib/enumeration-html-conventions.xsl index ebc40e55..38b650ff 100644 --- a/src/html-conventions-lib/enumeration-html-conventions.xsl +++ b/src/html-conventions-lib/enumeration-html-conventions.xsl @@ -30,8 +30,6 @@ - @@ -106,7 +104,7 @@ - + diff --git a/src/html-conventions-lib/generalization-html-conventions.xsl b/src/html-conventions-lib/generalization-html-conventions.xsl index e6b85242..664be8b0 100644 --- a/src/html-conventions-lib/generalization-html-conventions.xsl +++ b/src/html-conventions-lib/generalization-html-conventions.xsl @@ -25,12 +25,8 @@ - - - - + @@ -52,7 +48,7 @@ - + diff --git a/src/html-conventions-lib/object-html-conventions.xsl b/src/html-conventions-lib/object-html-conventions.xsl index c31a65e7..8a216c3c 100644 --- a/src/html-conventions-lib/object-html-conventions.xsl +++ b/src/html-conventions-lib/object-html-conventions.xsl @@ -31,7 +31,6 @@ - @@ -109,7 +108,7 @@ - + diff --git a/src/html-conventions-lib/realisation-html-conventions.xsl b/src/html-conventions-lib/realisation-html-conventions.xsl index 554f1d33..de7ec555 100644 --- a/src/html-conventions-lib/realisation-html-conventions.xsl +++ b/src/html-conventions-lib/realisation-html-conventions.xsl @@ -26,14 +26,7 @@ - - - - - - @@ -49,7 +42,7 @@ - + diff --git a/src/owl-core-lib/connectors-owl-core.xsl b/src/owl-core-lib/connectors-owl-core.xsl index 5afbbf1a..da54d23a 100644 --- a/src/owl-core-lib/connectors-owl-core.xsl +++ b/src/owl-core-lib/connectors-owl-core.xsl @@ -93,7 +93,7 @@ select="fn:substring-before(./target/model/@name, ':')"/> + test="$generateReusedConceptsOWLcore or $sourcePrefix = $internalModelPrefixesList"> @@ -150,7 +150,7 @@ select="fn:substring-before($targetConnectorTargetName, ':')"/> + test="$generateReusedConceptsOWLcore or $sourceConnectorTargetNamePrefix = $internalModelPrefixesList"> @@ -189,7 +189,7 @@ select="fn:substring-before($sourceConnectorSourceName, ':')"/> + test="$generateReusedConceptsOWLcore or $sourceConnectorSourceNamePrefix = $internalModelPrefixesList"> @@ -211,8 +211,10 @@ test=" f:getConnectorByName(., $root)/source/model/@type != 'ProxyConnector' and f:getConnectorByName(., $root)/target/model/@type != 'ProxyConnector' and f:getConnectorByName(., $root)/properties/@ea_type = ('Association', 'Dependency')"> + + + test="$generateReusedConceptsOWLcore or fn:substring-before($connectorRoleName, ':') = $internalModelPrefixesList"> diff --git a/src/owl-core-lib/elements-owl-core.xsl b/src/owl-core-lib/elements-owl-core.xsl index 0f4767e4..9224c236 100644 --- a/src/owl-core-lib/elements-owl-core.xsl +++ b/src/owl-core-lib/elements-owl-core.xsl @@ -355,8 +355,6 @@ select="fn:normalize-space(f:formatDocString(./properties/@documentation))"/> - @@ -383,34 +381,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -441,8 +412,7 @@ - + @@ -472,38 +442,8 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/reasoning-layer-lib/connectors-reasoning-layer.xsl b/src/reasoning-layer-lib/connectors-reasoning-layer.xsl index d8665f2d..1ad48525 100644 --- a/src/reasoning-layer-lib/connectors-reasoning-layer.xsl +++ b/src/reasoning-layer-lib/connectors-reasoning-layer.xsl @@ -25,15 +25,13 @@ - - - + + fn:substring-before($connectorRoleName, ':') = $internalModelPrefixesList)"> @@ -48,14 +46,12 @@ - - - + + fn:substring-before($connectorRoleName, ':') = $internalModelPrefixesList)"> @@ -67,7 +63,7 @@ test=" ./source/model/@type = 'Class' and ./target/model/@type = 'Enumeration' and ($generateReusedConceptsOWLrestrictions or - ($sourcePrefix = $internalModelPrefixesList and $targetPrefix = $internalModelPrefixesList))"> + fn:substring-before($connectorRoleName, ':') = $internalModelPrefixesList)"> @@ -106,7 +102,7 @@ select="fn:substring-before(./target/model/@name, ':')"/> + test="$generateReusedConceptsOWLrestrictions or $sourcePrefix = $internalModelPrefixesList"> @@ -129,8 +125,10 @@ + + + test="$generateReusedConceptsOWLrestrictions or fn:substring-before($connectorRoleName, ':') = $internalModelPrefixesList"> @@ -404,7 +402,7 @@ + $sourcePrefix = $internalModelPrefixesList"> @@ -451,10 +449,12 @@ select="f:buildURIfromLexicalQName($sourceConnector/target/role/@name)"/> + + + fn:substring-before($sourceConnector/source/model/@name, ':') = $internalModelPrefixesList"> @@ -462,7 +462,7 @@ + fn:substring-before($targetConnector/source/model/@name, ':') = $internalModelPrefixesList"> diff --git a/src/shacl-shape-lib/connectors-shacl-shape.xsl b/src/shacl-shape-lib/connectors-shacl-shape.xsl index 91ae33be..9b94df98 100644 --- a/src/shacl-shape-lib/connectors-shacl-shape.xsl +++ b/src/shacl-shape-lib/connectors-shacl-shape.xsl @@ -32,16 +32,14 @@ - - - + + + fn:substring-before($connectorRoleName, ':') = $internalModelPrefixesList)"> @@ -62,16 +60,13 @@ - - - + + fn:substring-before($connectorRoleName, ':') = $internalModelPrefixesList)"> diff --git a/test/ePO-default-config/config-parameters.xsl b/test/ePO-default-config/config-parameters.xsl index 72d7b702..58c85959 100644 --- a/test/ePO-default-config/config-parameters.xsl +++ b/test/ePO-default-config/config-parameters.xsl @@ -78,11 +78,10 @@ - - - - - + + + + diff --git a/test/unitTests/test-common/test-fetchers.xspec b/test/unitTests/test-common/test-fetchers.xspec index 25076944..016bf9fa 100644 --- a/test/unitTests/test-common/test-fetchers.xspec +++ b/test/unitTests/test-common/test-fetchers.xspec @@ -278,4 +278,18 @@ + + + + + + + + + + + + + + From 956b0e8c95dd29928ec72ee7df86cb0524f149fa Mon Sep 17 00:00:00 2001 From: Dragos0000 Date: Thu, 5 Sep 2024 15:51:20 +0100 Subject: [PATCH 4/6] readjusted reused concepts filters + readme --- README.md | 12 +++++++++--- src/owl-core-lib/connectors-owl-core.xsl | 14 ++++---------- test/ePO-default-config/config-parameters.xsl | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 52a2fe20..e8b8dc36 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ The following capabilities are addressed: * UML -> OWL 2 (lightweight ontology suitable as a Core Vocabulary) * UML -> OWL 2 (heavyweight ontology with additional axioms suitable for reasoning purposes) * UML -> SHACL (data shapes suitable for validation) +* UML -> SVRL (Compliance report in SVRL format) This work is developed in the context of [eProcurement ontology project](https://github.com/eprocurementontology/eprocurementontology) financed by the Digital Europe Programme and led by the [Publications Office of the European Union](https://op.europa.eu/en/). @@ -38,11 +39,12 @@ This work is developed in the context of [eProcurement ontology project](https:/ * The **transformation rules** from UML into OWL and SHACL are provided in the [UML2OWL transformation rules](https://meaningfy-ws.github.io/model2owl-docs/public-review/transformation/uml2owl-transformation.html). ### Scripts -* [html-conventions-report.xsl](src/html-conventions-report.xsl) is the script checking the conformance to the technical conventions of the conceptual model. +* [html-conventions-report.xsl](src/html-conventions-report.xsl) is the script checking the conformance to the technical conventions of the conceptual model. (HTML) * [html-model-glossary.xsl](src/html-model-glossary.xsl) is the script for creating a glossary of the conceptual model. * [owl-core.xsl](src/owl-core.xsl) is the transformation script for the core OWL ontology. * [shacl-shapes.xsl](src/shacl-shapes.xsl) is the transformation script for the SHACL data shape constraints. * [owl-restrictions.xsl](src/owl-restrictions.xsl) is the transformation script for the restrictions of OWL ontology (on classes and properties). +* [svrl-conventions-report.xsl](src/svrl-conventions-report.xsl) is the script checking the conformance to the technical conventions of the conceptual model. (SVRL) ### Script unit tests @@ -83,7 +85,11 @@ make owl-core XMI_INPUT_FILE_PATH=/home/mypc/work/model2owl/file1.xml OUTPUT_FOL * parameters: * XMI_INPUT_FILE_PATH - path to the xmi file * OUTPUT_GLOSSARY_PATH - path to the folder that stores the output -* **generate-convention-report** - this generates the compliance report from the UML export (xml/xmi) +* **generate-convention-report** - this generates the compliance report from the UML export (xml/xmi) in HTML format + * parameters: + * XMI_INPUT_FILE_PATH - path to the xmi file + * OUTPUT_CONVENTION_REPORT_PATH - path to the folder that stores the output +* **generate-convention-SVRL-report** - this generates the compliance report from the UML export (xml/xmi) in SVRL format * parameters: * XMI_INPUT_FILE_PATH - path to the xmi file * OUTPUT_CONVENTION_REPORT_PATH - path to the folder that stores the output @@ -214,7 +220,7 @@ Example make owl-core XMI_INPUT_FILE_PATH=/home/mypc/work/model2owl/file1.xml OUTPUT_FOLDER_PATH=./my-folder ``` ## Online -To use model2owl in an automatic way, we have created a github repository [model2owl-boilerplate](https://github.com/meaningfy-ws/model2owl-boilerplate) that will no longer require for you to install or to execute anything. +To use model2owl in an automatic way, we have created a github repository [model2owl-boilerplate](https://github.com/OP-TED/model2owl-boilerplate) that will no longer require for you to install or to execute anything. Follow the instructions found there for using this model2owl automation. # Contributing diff --git a/src/owl-core-lib/connectors-owl-core.xsl b/src/owl-core-lib/connectors-owl-core.xsl index da54d23a..63b1a56d 100644 --- a/src/owl-core-lib/connectors-owl-core.xsl +++ b/src/owl-core-lib/connectors-owl-core.xsl @@ -64,7 +64,7 @@ - + - - - - - + - @@ -317,10 +309,12 @@ + + diff --git a/test/ePO-default-config/config-parameters.xsl b/test/ePO-default-config/config-parameters.xsl index 58c85959..ee04f9cd 100644 --- a/test/ePO-default-config/config-parameters.xsl +++ b/test/ePO-default-config/config-parameters.xsl @@ -77,15 +77,15 @@ - + - + - + From 9b7e2c8b637586ba04e108f82ec9b827cc3b2ae0 Mon Sep 17 00:00:00 2001 From: Dragos0000 Date: Thu, 5 Sep 2024 16:02:55 +0100 Subject: [PATCH 5/6] test script fix --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 42d5e588..9b23f2de 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -20,7 +20,7 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Build and Run Tests - run: mvn install + run: mvn clean install -X - name: current dir run: pwd - name: current dir From 8f924445256b4e9eb7f86ee59c3316e537e42852 Mon Sep 17 00:00:00 2001 From: Dragos0000 Date: Thu, 5 Sep 2024 16:17:24 +0100 Subject: [PATCH 6/6] tests --- .github/workflows/unit-tests.yml | 2 +- test/ePO-default-config/config-parameters.xsl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 9b23f2de..e81ec8c6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -20,7 +20,7 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Build and Run Tests - run: mvn clean install -X + run: mvn clean install - name: current dir run: pwd - name: current dir diff --git a/test/ePO-default-config/config-parameters.xsl b/test/ePO-default-config/config-parameters.xsl index ee04f9cd..d574cb3b 100644 --- a/test/ePO-default-config/config-parameters.xsl +++ b/test/ePO-default-config/config-parameters.xsl @@ -78,10 +78,10 @@ - - - - + + + +