Sparnatural icon indicating copy to clipboard operation
Sparnatural copied to clipboard

Column titles from sh:name

Open ch-sander opened this issue 10 months ago • 6 comments

Currently, the column titles are generated from the IRI names of the shapes in the SHACL specification and then numbered sequentially, I think. However, I want to assign numerical IDs instead of readable names for the shape IRIs in my SHACL specification. The problem is that column labels based solely on these numerical IDs are significantly harder to understand.

Would it be possible to derive the column labels directly from the OWL class, its rdfs:label or from the name of the shape corresponding to the last property or class in the path, e.g. by way of sh:name?

ch-sander avatar Feb 21 '25 16:02 ch-sander

Ultimately, this is not about the column labels but rather about the names of the bound variables, I suppose.

Edit: If I understand correctly, the uniqueness of variable names only needs to be ensured within the query itself. This could be achieved through the numerical sequencing already in use. Additionally, the shape name could be sanitized by removing special characters and spaces to comply with SPARQL syntax.

ch-sander avatar Feb 21 '25 16:02 ch-sander

Are you aware that you can manually edit the column names yourself ?

Image

And that the "Show Column Names" switch is helpful to relate column headers to their positions in the query ?

tfrancart avatar Feb 21 '25 16:02 tfrancart

I wasn’t actually aware that column names could be freely assigned, but I saw that they can be set according to the variable names via a toggle. Fundamentally, this is sufficient, but for the didactic use of the query builder, it would be much more helpful if something human-readable were generated automatically—even if the SHACL shapes only have numerical IRI names.

ch-sander avatar Feb 21 '25 16:02 ch-sander

Obviously, this is just a nice-to-have feature and a suggestion. The functionality of the tool is not affected by this at all.

ch-sander avatar Feb 21 '25 16:02 ch-sander

Editing manually the column names is particularly interesting when you want to save a query (e.g. to feed the saved query dropdown) - so that the query is saved with nice column headers.

tfrancart avatar Feb 21 '25 16:02 tfrancart

Editing manually the column names is particularly interesting when you want to save a query (e.g. to feed the saved query dropdown) - so that the query is saved with nice column headers.

Indeed it is. It's just that my students are intimidated by column headers that are just numbers for queries they create; and I need to switch to numerical IRIs to ensure shapes that don't rely on the owl IRIs, so that the queries can be more robustly exported as JSON. Not sure this is a frequent use case...

ch-sander avatar Feb 21 '25 16:02 ch-sander