Skip to content

Spreadsheet output type for sparql results #5290

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

Open
JervenBolleman opened this issue Apr 9, 2025 · 7 comments · May be fixed by #5315
Open

Spreadsheet output type for sparql results #5290

JervenBolleman opened this issue Apr 9, 2025 · 7 comments · May be fixed by #5315
Assignees
Labels
📶 enhancement issue is a new feature or improvement

Comments

@JervenBolleman
Copy link
Contributor

JervenBolleman commented Apr 9, 2025

Problem description

While tsv, and csv are ok. We can create nicer results by directly generation a spreadsheet.

Preferred solution

Generate a styled XLSX with data and formatting done by the server.
This would include having links in cells for IRIs, which show localnames or prefixed IRIs instead of the full value.
Datatypes are converted to the right cell types.
Headers are setup, pivot tables might be created.

Are you interested in contributing a solution yourself?

Yes

Anything else?

Adding the metadata of which server evaluated the query, the query, when, runtime etc. would be nice to add to the File properties.

@JervenBolleman JervenBolleman added the 📶 enhancement issue is a new feature or improvement label Apr 9, 2025
JervenBolleman added a commit that referenced this issue Apr 9, 2025
Uses apache POI for xlsx support, very basic formatting.

Signed-off-by: Jerven Bolleman <[email protected]>
@JervenBolleman
Copy link
Contributor Author

I have a basic proof of concept that works, but not all datatypes are nicely formatted and I would like some help there.
Specifically about how to create links to maps and if we can introduce pivot tables directly during the workbook generation.
Also this is not a streaming format so might cause issues due to much ram usage.

@JervenBolleman JervenBolleman self-assigned this Apr 9, 2025
@JervenBolleman
Copy link
Contributor Author

We should also support Open Document Format spreadsheets.

JervenBolleman added a commit that referenced this issue Apr 9, 2025
Uses apache POI for xlsx support, very basic formatting.

Signed-off-by: Jerven Bolleman <[email protected]>
@barthanssens
Copy link
Contributor

Out of curiosity, are you considering using e.g. https://github.com/tdf/odftoolkit ?

There's also https://www.jopendocument.org (but that one is AGPL )

@JervenBolleman
Copy link
Contributor Author

@barthanssens for ooxml you can see I am using apache poi, for ODF I have not even thought about it yet.

JervenBolleman added a commit that referenced this issue Apr 9, 2025
@barthanssens
Copy link
Contributor

barthanssens commented Apr 9, 2025

Finding a well-supported Java library for ODF, with a suitable license can be a problem (ODF Toolkit ODFDOM-API is the best bet IMHO)

Luckily ODF is easier to produce than OOXML, and it is possible to have a single XML ODF (instead of a series XML files in a ZIP container), so if everything else fails, it should not be too complicated to develop a writer

(Aspose.Cells is another library supporting ODF, but not free / open source)

JervenBolleman added a commit that referenced this issue Apr 11, 2025
JervenBolleman added a commit that referenced this issue Apr 22, 2025
Rather basic reverse engineered via LiberOffice converting the XLSX.
@JervenBolleman
Copy link
Contributor Author

@barthanssens I went for the more raw approach for ODS. Could you try it out for me?

@JervenBolleman
Copy link
Contributor Author

@hmottestad is this kind of feature ok for a minor release?

@JervenBolleman JervenBolleman linked a pull request Apr 22, 2025 that will close this issue
5 tasks
@JervenBolleman JervenBolleman linked a pull request Apr 22, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📶 enhancement issue is a new feature or improvement
Projects
None yet
2 participants