Skip to content

Commit

Permalink
Merge pull request #208 from OP-TED/feature/M2O1-7
Browse files Browse the repository at this point in the history
reused concepts filter and readme changes
  • Loading branch information
Dragos0000 authored Sep 5, 2024
2 parents e3ba4f7 + 8f92444 commit 3ce1822
Show file tree
Hide file tree
Showing 24 changed files with 994 additions and 894 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- name: current dir
run: pwd
- name: current dir
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/common/fetchers.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,13 @@
<xsl:sequence select="$element/tags/tag"/>
</xsl:function>

<xd:doc>
<xd:desc> Fetch role name value from a connector. It can be either in source or in target</xd:desc>
<xd:param name="connector"/>
</xd:doc>
<xsl:function name="f:getRoleNameFromConnector" as="xs:string">
<xsl:param name="connector"/>
<xsl:sequence select="($connector/source/role/@name, $connector/target/role/@name)[1]"/>
</xsl:function>

</xsl:stylesheet>
3 changes: 1 addition & 2 deletions src/html-conventions-lib/association-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

<xsl:template match="connector[./properties/@ea_type = 'Association']">
<xsl:variable name="associationChecks" as="item()*">
<xsl:if test="f:checkIfConnectorTargetAndSourceElementsExists(.)">
<!-- Start of common connectors checkers rules -->
<xsl:call-template name="connectorNamingFormat">
<xsl:with-param name="connector" select="."/>
Expand Down Expand Up @@ -123,7 +122,7 @@
<xsl:with-param name="isDependency" select="fn:false()"/>
</xsl:call-template>
<!-- End of specific checker rules-->
</xsl:if>

</xsl:variable>
<xsl:if test="boolean($associationChecks)">
<xsl:choose>
Expand Down
161 changes: 81 additions & 80 deletions src/html-conventions-lib/class-attributes-html-conventions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,84 +33,85 @@

<xsl:variable name="classAttributeChecks" as="item()*">

<!-- Start of common checkers rules -->
<xsl:call-template name="namingFormat">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingNamePrefix">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingLocalSegmentName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="invalidNamePrefix">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="undefinedPrefix">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="invalidNameLocalSegment">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="invalidFirstCharacterInLocalSegment">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="delimitersInTheLocalSegment">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingDescription">
<xsl:with-param name="element" select="."/>
<xsl:with-param name="elementType" select="'classAttribute'"/>
</xsl:call-template>
<xsl:call-template name="stereotypeProvided">
<xsl:with-param name="elementType" select="'classAttribute'"/>
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="unknownStereotypeProvided">
<xsl:with-param name="element" select="."/>
<xsl:with-param name="elementType" select="'classAttribute'"/>
</xsl:call-template>
<xsl:call-template name="invalidTagName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingTagValue">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingTagName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingPrefixTagName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="namePlural">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="elementUniqueName">
<xsl:with-param name="element" select="."/>
<xsl:with-param name="isAttribute" select="fn:true()"/>
</xsl:call-template>
<!-- End of common checkers rules -->
<!-- Start of specific checker rules-->
<!-- Start of common checkers rules -->
<xsl:call-template name="namingFormat">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingNamePrefix">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingLocalSegmentName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="invalidNamePrefix">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="undefinedPrefix">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="invalidNameLocalSegment">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="invalidFirstCharacterInLocalSegment">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="delimitersInTheLocalSegment">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingDescription">
<xsl:with-param name="element" select="."/>
<xsl:with-param name="elementType" select="'classAttribute'"/>
</xsl:call-template>
<xsl:call-template name="stereotypeProvided">
<xsl:with-param name="elementType" select="'classAttribute'"/>
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="unknownStereotypeProvided">
<xsl:with-param name="element" select="."/>
<xsl:with-param name="elementType" select="'classAttribute'"/>
</xsl:call-template>
<xsl:call-template name="invalidTagName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingTagValue">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingTagName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="missingPrefixTagName">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="namePlural">
<xsl:with-param name="element" select="."/>
</xsl:call-template>
<xsl:call-template name="elementUniqueName">
<xsl:with-param name="element" select="."/>
<xsl:with-param name="isAttribute" select="fn:true()"/>
</xsl:call-template>
<!-- End of common checkers rules -->
<!-- Start of specific checker rules-->

<xsl:call-template name="classAttributeNameStartsWithLowerCase">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeMultiplicityIncorrectFormat">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeIncorrectDatatype">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeMissingMultiplicity">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeNonPublic">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<!-- End of specific checker rules-->
<xsl:call-template name="classAttributeNameStartsWithLowerCase">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeMultiplicityIncorrectFormat">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeIncorrectDatatype">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeMissingMultiplicity">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<xsl:call-template name="classAttributeNonPublic">
<xsl:with-param name="classAttribute" select="."/>
</xsl:call-template>
<!-- End of specific checker rules-->

</xsl:variable>
<xsl:if test="boolean($classAttributeChecks)">
<xsl:choose>
Expand All @@ -126,9 +127,9 @@
<xsl:copy-of select="$classAttributeChecks"/>
</xsl:otherwise>
</xsl:choose>




</xsl:if>
</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
</xsl:choose>
</xsl:if>
</xsl:if>

</xsl:for-each>
</xsl:template>

Expand Down
Loading

0 comments on commit 3ce1822

Please sign in to comment.