Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add or modify Makefile recipes to enable regeneration of *.rdf files and retain expected *.ttl files content #216

Merged
merged 8 commits into from
Sep 24, 2024

Conversation

gkostkowski
Copy link
Collaborator

@gkostkowski gkostkowski commented Sep 18, 2024

rdfpipe utility is now used to regenerate *.rdf files what results in the duplicated imports being discarded. Changes were made in Makefile file and affects generation of *.rdf artefacts (owl-core, owl-restrictions and shacl Makefile recipes) as well as conversion of these to TTL format (convert-rdf-to-turtle). The latter were needed to keep the same TTL output when using the new *.rdf files.

Scope of the changes:

  • New generic convert-between-serialization-formats Makefile recipe
  • The existing owl-core, owl-restrictions and shacl Makefile recipes now include an RDF regeneration step
  • The existing convert-rdf-to-turtle Makefile recipe now uses the same namespaces that are used for XSLT transformation (test/ePO-default-config/namespaces.xml) to provide rdfpipe with prefixes so the output makes use of compact URIs.
  • As the reported issue occurs for EPO v4.2.0 which introduces some new prefixes, these prefixes have also been added to test/ePO-default-config/namespaces.xml so it would be possible to reproduce the fix.

The change fixes #213

…and retain expected *.ttl files content

`rdfpipe` utility is now used to regenerate *.rdf files what results in the
duplicated imports being discarded. Changes were made in Makefile file and
affects generation of *.rdf artefacts (owl-core, owl-restrictions and shacl
Makefile recipes) as well as conversion of these to TTL format
(convert-rdf-to-turtle). The latter were needed to keep the same TTL output
when using the new *.rdf files.

Scope of the changes:
* New generic convert-between-serialization-formats Makefile recipe
* The existing owl-core, owl-restrictions and shacl Makefile recipes now include an RDF regeneration step
* The existing convert-rdf-to-turtle Makefile recipe now uses the same namespaces that are used for XSLT transformation (test/ePO-default-config/namespaces.xml) to provide rdfpipe with prefixes so the output makes use of compact URIs.
* As the reported issue occurs for EPO v4.2.0 which introduces some new prefixes, these prefixes have also been added to test/ePO-default-config/namespaces.xml so it would be possible to reproduce the fix.
@gkostkowski gkostkowski self-assigned this Sep 18, 2024
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move namespace path to the Makefile

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still need to work and discuss on this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change has been made

…to depend on the new file

The new XML contains user namespaces (defined in namespaces.xml) and internal
namespaces (such as core-shape). Both model2owl internals and get_namespaces.sh
relies on that file and not on namespaces.xml. Moreover, model2owl internals now
depends on a new template which generates namespaces declarations based on
enriched file which is passed to the XSLT transformation engine as command line
argument. For now, the path of the new XML file is kept in the Makefile, but
this can be further improved in the future (if we come up with application
internal XSL config or other solution).

Scope of changes:
* new XSL file for generation of the enriched namespaces XML file
* unit test for the above XSL file
* project codebase:
  * new function generating namespaces declarations and references to
    `$namespacePrefixes` replaced with `$internalNamespacePrefixes`
* Makefile changes:
  * new recipe
  * existing 3 recipes generating *.rdf artefacts now include generation of the
    new XML file
  * required adjustments
* Adjustments in the get_namespaces.sh script
… pass new namespaces file as a parameter for the rest of xslt transformation recipes in the project
Document use of the new `NAMESPACES_USER_XML_FILE_PATH` variable.
Any recipe without a docstring (comment documenting its use) that
uses the new variable now got a description.
@gkostkowski gkostkowski merged commit 01dbca8 into develop Sep 24, 2024
2 checks passed
@gkostkowski gkostkowski deleted the feature/M2O1-14 branch September 24, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants