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

Feature request: option to not change subject ordering #44

Open
fkleedorfer opened this issue Jan 28, 2025 · 3 comments
Open

Feature request: option to not change subject ordering #44

fkleedorfer opened this issue Jan 28, 2025 · 3 comments

Comments

@fkleedorfer
Copy link
Contributor

When authoring shacl, the subject ordering of turtle-formatter gets in the way when named property shapes are used. Usually, property shapes are written as blank nodes, but if they occur multiple times, it is often better to give them their own URIs and make them 'top-level entities', so to speak. Now for ease of editing you would like to keep those property shapes close to the node shapes that they are used in. Otherwise, when making one change, a lot of scrolling or searching in the file may be required, which increases the cognitive load on the person doing it (ie, it's a pain in the neck) and may lead to editing errors.

Similar requirements may exist in other modelling domains, where you might want to keep e.g. members of a family close togehter, or maybe parts of an engine in close proximity of each other.

The current ordering options do not support such use cases very well.

I might be interested in providing a solution, but if so, it will take time. Meanwhile, if anyone has additional requirements or ideas for an algorithm (@ralphtq) , please comment!

@atextor
Copy link
Owner

atextor commented Jan 28, 2025

Hi @fkleedorfer,
I understand the request. However, I'm not convinced yet that this is SHACL-specific. Can we generalized the topic to: "Add an option to keep existing subject order", i.e., not have the subjects sorted?

@fkleedorfer
Copy link
Contributor Author

That would indeed be an easy way of achieving a custom ordering.

@fkleedorfer fkleedorfer changed the title Feature request: special subject ordering for SHACL Feature request: option to not change subject ordering Jan 28, 2025
@atextor
Copy link
Owner

atextor commented Jan 28, 2025

What is needed for that is the ability to keep line information (provided by a custom parser) with each resource. After that, it's quite trivial; you just render resources sorted by their original line. I've commented about this here on issue #2 (because retaining comments also requires custom parsing). As mentioned in that comment, incidentally I've already implemented this approach in the Eclipse Semantic Modeling Toolkit so I know it works :-) but the implementation there is not generically applicable to RDF.

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

No branches or pull requests

2 participants