Skip to content

Commit

Permalink
Updated content from feature/EPO-721 branch of the OPT-TED/model2ow…
Browse files Browse the repository at this point in the history
…l repository
  • Loading branch information
csnyulas committed May 26, 2023
1 parent a3bf5ca commit 1931e94
Show file tree
Hide file tree
Showing 46 changed files with 2,530 additions and 39 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc/* linguist-documentation
34 changes: 34 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
push:
branches: [ feature/* , main, hotfix/*, release/* ]
# pull_request:
# branches: [ main, release/* ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and Run Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Build and Run Tests
run: mvn install
- name: current dir
run: pwd
- name: current dir
run: ls -la ./target/surefire-reports
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/target/surefire-reports/test-*.xml'
detailed_summary: true

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ __pycache__/

# Distribution / packaging
.Python
build/
/build/
/node_modules/
develop-eggs/
dist/
downloads/
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Special thanks for all the people who had helped this project so far.
* [Eugeniu Costetchi]([email protected])
* [Dragos Paun]([email protected])


## Contributors

* [Csongor Nyulas]([email protected])
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTORS.md.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributors

Special thanks for all the people who had helped this project so far.

## Developers
*
* [Eugeniu Costetchi]([email protected])
* [Dragos Paun]([email protected])

## Contributors

* [Csongor Nyulas]([email protected])
* [Andreea-Nicoleta Pasare]([email protected])
86 changes: 77 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,90 @@
# model2owl-docs
# model2owl

[Read online](https://meaningfy-ws.github.io/model2owl-docs/0.0.1/index.html)
This project comprises a set of tools for transforming an UML (v2.5) model from its XMI (v2.5.1) serialisation into a formal ontology. This transformation is performed using XSLT stylesheets under the assumption that the UML model conforms to the set of conventions outlined in the documentation.

This repository covers the documentation for [model2owl project](https://github.com/OP-TED/model2owl).
* UML -> OWL 2 (light / complete)
* UML -> SHACL

model2owl if a set of tools for transforming UML (v2.5) model from its XMI (v2.5.1) serialisation into an OWL formal ontology, SHACl data shapes ad glossary. This transformation is performed using XSLT stylesheets under the assumption that the UML model conforms to the set of conventions outlined in the documentation.
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/).

# Contributing
### Documents
* The **architectural design** and the formal specifications are provided in the [Ontology architecture document](docs/ontology-architecture/ontology-architecture.pdf).
* The technical **conventions** for the UML representation of the conceptual model are provided in [UML conventions document](docs/uml-conventions/uml-conventions.pdf)
* An **inventory** of conformance tests derived from the UML conventions document are provided in the [Inventory Worksheet document](docs/checkers-inventory/eProcurement conceptual model checkers inventory.xlsx)
* The **transformation rules** from UML into OWL and SHACL are provided in the [uml2owl transformation document](docs/uml2owl-transformation/uml2owl-transformation.pdf)

### Scripts
* [html-conventions-report.xsl](src/html-conventions-report.xsl) is the script checking the conformance to the technical conventions 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).

### Script unit tests

* [test/unitTest/test-html-conventions-lib](
https://github.com/meaningfy-ws/model2owl/tree/master/test/unitTests/test-html-conventions-lib) is the location of the unit tests for the script checking the conformance to the technical conventions of the conceptual model are
* [test/unitTest/test-owl-core-lib](https://github.com/meaningfy-ws/model2owl/tree/master/test/unitTests/test-owl-core-lib) is the location of the unit tests for the transformation script for the core OWL ontology.

* [test/unitTest/test-shacl-shape-lib](https://github.com/meaningfy-ws/model2owl/tree/master/test/unitTests/test-shacl-shape-lib) is the location of the unit tests for the transformation script for the SHACL data shape constraints.
* [test/unitTest/reasoning-layer-lib](https://github.com/meaningfy-ws/model2owl/tree/master/test/unitTests/reasoning-layer-lib) is the location of the unit tests for the transformation script for the restrictions of OWL ontology (on classes and properties).

## Running the transformation

The scripts developed in this project conform to XSLT 3.0 and can be executed with a corresponding XSLT engine of choice. A recommendation is to use [Saxon-HE](http://saxon.sourceforge.net/), but it is not the only one.

The input eProcurement conceptual model is available in the [eProcurement Ontology project on GitHub](https://github.com/eprocurementontology/eprocurementontology). Note that the XMI (v.2.5.1) output is generated with [Enterprise Architect](https://sparxsystems.com/products/ea/index.html) and was not tested with outputs from other software (although, XMI is an OMG standard). But, this does not restrict the current scripts to this project alone and any UML model that conforms to the specified UML conventions can be transformed into a formal ontology.

We assume that the users of this project are familiar with XML, UML and XSLT technologies and know how to perform an XSLT transformation.

## Automation with Makefile

## Create an virtual environment
pip install virtualenv
virtualenv venv
## Activate your venv
source venv/bin/activate

## Install rdflib inside your virtual environment
pip install rdflib

## Combine multiple XMI / XML UML documents
make merge-xmi

This will merge multiple input XMI / XML UML documents into a single one. The output is located under ../output/combined-xmi/ and will be used to generate a single glossary.

## Generate the glossary from the merged document
make generate-glossary
The glossary will generated and located in the ../output/glossary/

## Repository Structure

* /src - source code of the XSLT scripts generating the HTML conventions report.
* /common , /html-conventions-lib, /reasoning-layer-lib and /shacl-shape-lib contain modules loaded by the main files.
* /static contains JS and CSS styles refereed by HTML reports. It should be copied to wherever the report is saved in order to ensure proper display.
* config-parameters.xsl - the configurations file that may be adjusted as necessary.
* html-conventions-report.xsl - source code of the XSLT scripts generating the HTML conventions report.
* owl-core.xsl - Transformation script for the core ontology
* shacl-shapes.xsl - Transformation script for the SHACL shapes
* owl-restrictions.xsl - Transformation script for the ontology intensional definitions based on the class and property restrictions

* /test - contains unit tests for each XSL module ensuring the correct implementation.
* /test/unitTests - contain XSpec unit tests
* /test/testData - test data used in the unit tests

# Contributing
You are more than welcome to help expand and mature this project.

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we adhere to [Apache code of conduct](https://www.apache.org/foundation/policies/conduct), please follow it in all your interactions with the project.
Please note we adhere to [Apache code of conduct](https://www.apache.org/foundation/policies/conduct), please follow it in all your interactions with the project.

## Licence

The documents, such as reports and specifications, available in the /doc folder, are licenced under a [CC BY 4.0 licence](https://creativecommons.org/licenses/by/4.0/deed.en).

The XSLT (stylesheets) and other scripts are licenced under [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html) licence.



# Licence

The documents, such as reports and specifications are licenced under a [CC BY 4.0 licence](https://creativecommons.org/licenses/by/4.0/deed.en).

The source code and other scripts are licenced under [EUPL v1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12) licence.
24 changes: 24 additions & 0 deletions config-proxy.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
exclude-result-prefixes="xs math xd xsl uml xmi umldi dc fn"
xmlns:uml="http://www.omg.org/spec/UML/20131001"
xmlns:xmi="http://www.omg.org/spec/XMI/20131001"
xmlns:umldi="http://www.omg.org/spec/UML/20131001/UMLDI"
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:functx="http://www.functx.com"
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#"
version="3.0">

<!-- Change below the location of your config parameters file-->

<xsl:import href="test/ePO-default-config/config-parameters.xsl"/>

</xsl:stylesheet>
15 changes: 13 additions & 2 deletions docs/antora.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: ROOT
version: 0.0.1
title: model2owl documentation
version: public-review
title: model2owl Documentation
start_page: ROOT:index.adoc
asciidoc:
attributes:
imagesdir: images
xrefstyle: short@
example-caption: Rule@
example-refsig: Rulota
listing-caption: Listing@
listing-refsig: Listing
table-refsig: Tabella
counter: rule-cnt@
nav:
- modules/ROOT/nav.adoc

Binary file added docs/modules/ROOT/images/f1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/modules/ROOT/images/f9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
** xref:uml/conv-datatypes.adoc[uml:DataType]
** xref:uml/conv-packages.adoc[uml:Package]
** xref:uml/conv-connectors.adoc[UML Connector Elements]
// * xref:checkers/model2owl-checkers.adoc[UML convention checking rules]
* xref:attachment$ePO_UML_conceptual_model_checkers_inventory_V3.xlsx[UML convention checking rules]
* xref:checkers/model2owl-checkers.adoc[UML convention checking rules]
* xref:transformation/uml2owl-transformation.adoc[Transformation Rules]
** xref:transformation/transf-rules1.adoc[Rules for UML Classes and Attributes]
** xref:transformation/transf-rules2.adoc[Rules for UML Connectors]
** xref:transformation/transf-rules3.adoc[Rules for UML Datatypes]
** xref:transformation/transf-rules4.adoc[Rules for UML Descriptors]
* xref:references.adoc[References]
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/epo-context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Generally, the primary application of UML [xref:references.adoc#ref:fowler2004[f

On the other hand, UML is closer than more logic-oriented approaches to the programming languages in which enterprise applications are implemented. For this reason the current specification establishes conventions for interpretation of the UML-based conceptual model.

The UML Conceptual Model of the eProcurement domain serves as the single source of truth, which means that the formal eProcurement ontology is derived from it through a model transformation process. It is possible to generate automatically the formal ontology in RDF format [xref:references.adoc#ref:rdf11[rdf11]] from the XMI (v.2.5.1) serialisation [xref:references.adoc#ref:xmi2.5.1[xmi2.5.1]] of an UML (v.2.5) model [xref:references.adoc#ref:uml2.5[uml2.5]], provided that a set of clear transformation rules are established [xref:references.adoc#ref:costetchi2020c[costetchi2020c]], and that a set of modelling conventions is respected.
The UML Conceptual Model of the eProcurement domain serves as the single source of truth, which means that the formal eProcurement ontology is derived from it through a model transformation process. It is possible to generate automatically the formal ontology in RDF format [xref:references.adoc#ref:rdf11[rdf11]] from the XMI (v.2.5.1) serialisation [xref:references.adoc#ref:xmi2.5.1[xmi2.5.1]] of a UML (v.2.5) model [xref:references.adoc#ref:uml2.5[uml2.5]], provided that a set of clear transformation rules are established [xref:references.adoc#ref:costetchi2020c[costetchi2020c]], and that a set of modelling conventions is respected.

This document provides the UML modelling constraints and a set of conventional and technical recommendations for naming and structuring the UML class diagram elements: packages, classes, data types, enumerations, enumeration items, class attributes, association relation and dependency relation. There are additional elements which will be addressed contextually in the following sections.

Expand Down
Loading

0 comments on commit 1931e94

Please sign in to comment.