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

Idea: Show IRIs with optional label in xlsx IRI-columns #253

Closed
dalito opened this issue Jan 27, 2025 · 1 comment · Fixed by #258
Closed

Idea: Show IRIs with optional label in xlsx IRI-columns #253

dalito opened this issue Jan 27, 2025 · 1 comment · Fixed by #258
Assignees
Labels
enhancement Request for changing or improving existing features
Milestone

Comments

@dalito
Copy link
Member

dalito commented Jan 27, 2025

When working on the xlsx-vocabulary file, numeric IRIs (like we use in voc4cat) make it difficult to immediately know the concept or collection they stand for. This could be solved by using hyperlinks instead of text to represent the IRI in xlsx. The idea how hyperlinks could be used in xlsx is shown with markdown hyperlinks below.

Since URLs may not contain spaces, we can use a space to separate IRI and preferredLabel in the text of the hyperlink. Moreover, I suggest to preferably use the CURIE form in the text-part of the link and the IRI in the link-part, for example:

[ex:001 (prefLabel concept 001)](https://example.org/001)

and if no prefix for a CURIE-notation exists:

[https://example.org/001 (prefLabel concept 001)](https://example.org/001)

Such links could be created automatically in the conversion from turtle to xlsx.

This notation represents the concept in three ways: CURIE, concept-preferred-label and IRI. Typically all three would representing the same concept. However, in reality inconsistent notations will occur and we need to handle them.

I propose to use the simple rule The visible CURIE or IRI takes precedence. - The reasoning behind this is:

  • Strings and hyperlinks can both be used IRI columns in in both cases the truth is what you see.
  • If users edit cells in xlsx they typically only change the text-part of hyperlinks (the link-part takes an extra step and may easily be forgotten). So the text part is most likely what the user wanted.

So for these conflicting notations

  • [ex:001 (prefLabel concept 001)](https://example.org/005)
  • [ex:001 (another label)](https://example.org/001)

voc4cat-tool will just read ex:001 ignoring the other parts.

@dalito dalito added the enhancement Request for changing or improving existing features label Jan 27, 2025
@dalito dalito moved this from New to Backlog (>2 weeks) in Voc4Cat cross-repo view Jan 27, 2025
@dalito dalito self-assigned this Jan 27, 2025
@dalito
Copy link
Member Author

dalito commented Jan 27, 2025

Unfortunately in xlsx the hyperlink is a property of the cell not of the text. This limits the usefulness of the idea to single-value cells like Concept IRI. It is not possible to have multiple different hyperlinks in a single cell as would be required for multivalue-cells like Children IRIs.

Example of adding a hyperlink with openpyxl (this also shows that the hyperlink is a cell attribute, not a text attribute):

wbook.active['A1'].value = 'example'
wbook.active['A1'].hyperlink = "http://www.example.org"
wbook.active['A1'].style = "Hyperlink"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for changing or improving existing features
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

1 participant