Skip to content

Several fixes and improvements to get it working on telematics XSD and railml XSD's#5

Open
MathiasVDA wants to merge 12 commits into
dtai-kg:mainfrom
Matdata-eu:main
Open

Several fixes and improvements to get it working on telematics XSD and railml XSD's#5
MathiasVDA wants to merge 12 commits into
dtai-kg:mainfrom
Matdata-eu:main

Conversation

@MathiasVDA
Copy link
Copy Markdown

Hello @dachafra @andimou @xuemduan

I'm working on converting the Telematics XSD files into RDF (ontology, shacl, skos). I was trying to get the published version of xsd2shacl working but it failed. So I forked the project and started working on the code until it gave a valid output. This PR contains the fixes needed to both produce valid output for the TAF_TSI xsd files and the railml infrastructure 3.3 xsd file. It's likely I will find other issues later but for now, this is a nice improvement.

My commit messages should be clear enough as to why the change was done. But feel free to ask any questions here in this PR.

@MathiasVDA
Copy link
Copy Markdown
Author

@gatemezing
fyi

@dachafra dachafra requested a review from xuemduan March 19, 2025 07:30
@dachafra
Copy link
Copy Markdown
Collaborator

dachafra commented Mar 19, 2025

Hi @MathiasVDA
Thanks for the contribution! Please note that xsd2shacl is now managed by Poetry, so there is no requirements.txt file. If there are any new dependencies, please add them to the pyproject.toml file.

@MathiasVDA
Copy link
Copy Markdown
Author

This is the first time I'm working with something that uses poetry. Could you give me a hint as to how I should use it to test the processing of an xsd file without compiling the code first?

@dachafra
Copy link
Copy Markdown
Collaborator

The dependencies are defined here, but I think you don't need to add any because they are already defined.

For using poetry instead of requirements.txt:

pip install poetry
poetry install 

See documentation here. If you want to build the package: poetry build
Then is just python3 -m xsd2shacl [OPTIONS]

@MathiasVDA
Copy link
Copy Markdown
Author

Yes but how do I test the code without building? :)

That's why I added the requirement file, I just consider the class as any other python class and call it from a test python script.

@dachafra
Copy link
Copy Markdown
Collaborator

poetry install works in the same way as pip install -r requirements.txt. In any case, if you want to use requirements.txt for local testing is perfectly okay, but please, do not include it in the PR ;-)

@MathiasVDA
Copy link
Copy Markdown
Author

It's removed. But I think the poetry pyproject.toml file is missing setuptools
(I can't remember the error I got when trying to use the scripts after doing poetry install)

@dachafra
Copy link
Copy Markdown
Collaborator

Poetry is the replacement of setuptools, it shouldn't be required asaik

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