Skip to content

Commit

Permalink
readjusted reused concepts filters + readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragos0000 committed Sep 5, 2024
1 parent b0a9af9 commit 956b0e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
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
14 changes: 4 additions & 10 deletions src/owl-core-lib/connectors-owl-core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<xd:desc/>
</xd:doc>
<xsl:template match="connector[./properties/@ea_type = 'Generalization']">
<!-- Filter is applied in the propertyGeneralization function due complexity of the function-->
<!-- This reused concepts filter is applied in the propertyGeneralization function due complexity of the function-->
<xsl:if
test="
./source/model/@type = 'ProxyConnector' and
Expand All @@ -86,16 +86,8 @@
test="
./source/model/@type = 'Class' and
./target/model/@type = 'Class'">
<!-- Extract prefixes for source and target -->
<xsl:variable name="sourcePrefix"
select="fn:substring-before(./source/model/@name, ':')"/>
<xsl:variable name="targetPrefix"
select="fn:substring-before(./target/model/@name, ':')"/>
<!-- Check if either the prefixes match the internal list or generateReusedConcepts is true -->
<xsl:if
test="$generateReusedConceptsOWLcore or $sourcePrefix = $internalModelPrefixesList">
<!-- This reused concepts filter is applied in the template so that the subclasses are also filtered-->
<xsl:call-template name="classGeneralization"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
Expand Down Expand Up @@ -317,10 +309,12 @@
<xsl:if test="f:getElementByIdRef(./source/@xmi:idref, root(.))">

<xsl:for-each select="$subClasses">
<xsl:if test="$generateReusedConceptsOWLcore or fn:substring-before(./@name, ':') = $internalModelPrefixesList">
<xsl:variable name="subClassURI" select="f:buildURIFromElement(.)"/>
<owl:Class rdf:about="{$subClassURI}">
<rdfs:subClassOf rdf:resource="{$superClassURI}"/>
</owl:Class>
</xsl:if>
</xsl:for-each>

</xsl:if>
Expand Down
6 changes: 3 additions & 3 deletions test/ePO-default-config/config-parameters.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@
<xsl:variable name="allowedStrings" select="'^[\w\d-_:]+$'"/>
<!-- Generate reused classes, attributes and connectors-->
<xsl:variable name="internalModelPrefixesList" select="('epo', 'epo-not', 'epo-ord', 'epo-cat', 'epo-con', 'epo-ful')"/>

<!-- This set of variables controls the generation of reused concepts within artifacts. -->
<xsl:variable name="generateReusedConceptsSHACL" select="fn:false()"/>
<xsl:variable name="generateReusedConceptsOWLcore" select="fn:false()"/>
<xsl:variable name="generateReusedConceptsOWLrestrictions" select="fn:false()"/>
<xsl:variable name="generateReusedConceptsGlossary" select="fn:false()"/>


<!-- This variable control if Object and Realisation are generated -->
<xsl:variable name="generateObjectsAndRealisations" select="fn:false()"/>

<!-- Set of variables for convention report-->
<xsl:variable name="conventionReportCopyrightText" select="'Publications Office of the European Union, 2023'"/>
<xsl:variable name="conventionReportAuthor" select="'Publications Office of the European Union'"/>
<xsl:variable name="conventionReportAuthorLocation" select="'Luxembourg'"/>
Expand Down

0 comments on commit 956b0e8

Please sign in to comment.