-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
9,631 additions
and
35,372 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: generate conventions and glossary | ||
name: transform UML model | ||
on: | ||
push: | ||
branches: | ||
|
@@ -9,7 +9,6 @@ on: | |
- "implementation/core_person/xmi_conceptual_model/core_person_CM.xml" | ||
- "implementation/core_location/xmi_conceptual_model/core_location_CM.xml" | ||
- "implementation/core_public_organisation/xmi_conceptual_model/core_public_organisation_CM.xml" | ||
|
||
jobs: | ||
report_and_glossary: | ||
runs-on: ubuntu-latest | ||
|
@@ -22,7 +21,7 @@ jobs: | |
|
||
- name: get model2owl | ||
run: | | ||
git clone https://github.com/OP-TED/model2owl.git | ||
git clone --branch 2.2.0 https://github.com/OP-TED/model2owl.git | ||
pwd | ||
- name: get-saxon | ||
|
@@ -73,7 +72,7 @@ jobs: | |
done | ||
ls merge-xmis | ||
make merge-xmi FIRST_XMI_TO_BE_MERGED_FILE_PATH=merge-xmis/core_person_CM.xml | ||
make merge-xmi FIRST_XMI_TO_BE_MERGED_FILE_PATH=merge-xmis/demo_ontology_CM.xml | ||
echo "merged XMI file" | ||
ls output/combined-xmi | ||
|
@@ -89,6 +88,93 @@ jobs: | |
sudo rm -rf model2owl | ||
shell: bash | ||
|
||
- name: commit files | ||
id: commit | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "github-actions" | ||
git pull | ||
git status | ||
git add . | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "::set-output name=push::false" | ||
else | ||
git commit -m "Adding convention report and glossary files" | ||
echo "::set-output name=push::true" | ||
fi | ||
shell: bash | ||
|
||
- name: Push changes | ||
if: steps.commit.outputs.push == 'true' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
transform: | ||
needs: report_and_glossary | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: get model2owl | ||
run: | | ||
git clone --branch 2.2.0 https://github.com/OP-TED/model2owl.git | ||
pwd | ||
- name: get-saxon | ||
run: pwd && cd model2owl && make get-saxon | ||
|
||
- name: get-rdflib | ||
run: cd model2owl && make create-virtual-env && make get-rdflib | ||
|
||
- name: transform step | ||
run: | | ||
AVAILABLE_IMPLEMENTATIONS=(core_person core_location core_public_organisation) | ||
for implementation in "${AVAILABLE_IMPLEMENTATIONS[@]}" | ||
do | ||
echo "-------------------${implementation} transform---------------------------------" | ||
sed -i "s/test\/ePO-default-config/..\/implementation\/${implementation}\/model2owl-config/g" model2owl/config-proxy.xsl | ||
cat model2owl/config-proxy.xsl | ||
CM_FILE_NAME=$(echo "${implementation}_CM.xml") | ||
CM_FILE_PATH=$(echo "implementation/$implementation/xmi_conceptual_model/${CM_FILE_NAME}") | ||
OUTPUT_PATH_OWL=$(echo "implementation/$implementation/owl_ontology/") | ||
OUTPUT_PATH_SHACL=$(echo "implementation/$implementation/shacl_shapes/") | ||
ls -la implementation/$implementation/xmi_conceptual_model/ | ||
echo "CM_FILE_PATH is $CM_FILE_PATH" | ||
echo "OUTPUT_PATH_OWL is $OUTPUT_PATH_OWL" | ||
echo "OUTPUT_PATH_SHACL is $OUTPUT_PATH_SHACL" | ||
cd model2owl | ||
ls -la | ||
echo "+++++++++++++++++transform to rdf++++++++++++++++++++++++++++" | ||
make owl-core XMI_INPUT_FILE_PATH=../$CM_FILE_PATH OUTPUT_FOLDER_PATH=../$OUTPUT_PATH_OWL | ||
make owl-restrictions XMI_INPUT_FILE_PATH=../$CM_FILE_PATH OUTPUT_FOLDER_PATH=../$OUTPUT_PATH_OWL | ||
make shacl XMI_INPUT_FILE_PATH=../$CM_FILE_PATH OUTPUT_FOLDER_PATH=../$OUTPUT_PATH_SHACL | ||
echo "+++++++++++++++++transform to turtle++++++++++++++++++++++++++++" | ||
echo $(ls ../${OUTPUT_PATH_OWL}*.rdf) | ||
make convert-rdf-to-turtle ONTOLOGY_FOLDER_PATH=../$OUTPUT_PATH_OWL | ||
echo $(ls ../${OUTPUT_PATH_SHACL}*.rdf) | ||
make convert-rdf-to-turtle ONTOLOGY_FOLDER_PATH=../$OUTPUT_PATH_SHACL | ||
echo "-------------------end transform---------------------------------" | ||
sed -i "s/..\/implementation\/${implementation}\/model2owl-config/test\/ePO-default-config/g" config-proxy.xsl | ||
cd .. | ||
done | ||
shell: bash | ||
|
||
- name: remove unnecessary files | ||
run: | | ||
sudo rm -rf model2owl | ||
shell: bash | ||
|
||
- name: commit files | ||
id: commit | ||
run: | | ||
|
@@ -101,7 +187,7 @@ jobs: | |
if [ -z "$(git status --porcelain)" ]; then | ||
echo "::set-output name=push::false" | ||
else | ||
git commit -m "Adding convention report and glossary files" | ||
git commit -m "Adding transformation files" | ||
echo "::set-output name=push::true" | ||
fi | ||
shell: bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.