-
Notifications
You must be signed in to change notification settings - Fork 1
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
download buttons #1
base: frink
Are you sure you want to change the base?
Conversation
YaphetKG
commented
Feb 16, 2024
- adds download buttons to UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I left a code comment about one change.
src/ldf-client-ui.js
Outdated
header.forEach(function (h, i) { | ||
line.push(v[h]); | ||
}); | ||
csvContent += [line].map(e => e.join(',')) + '\n'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YaphetKG how hard would it be to make this a bit more robust? How should CSV handle comments within values, or newlines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YaphetKG Comunica has built-in support, somewhere, for various output formats including text/csv
(this is an option in the comunica-sparql
CLI tool. Can this be reused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jim, added the csv streaming changes (https://github.com/frink-okn/jQuery-Widget.js/pull/3/files) this are the changes this uses the text/csv format , but i have found that the query needs to be re-executed, to use this. It seems like once another consumer such as for displaying the results on the page, goes over the result set, the result set stream becomes empty to do the csv. Due to this, i have it setup so that the same query is executed again, and a new stream is consumed to generate the csv results.
And i can confirm the file properly quotes comma containing labels
<http://purl.obolibrary.org/obo/CL_4030038>,"CD24-positive, CD-133-positive, vimentin-positive proximal tubular cell",<http://purl.obolibrary.org/obo/UBERON_0002113>,kidney```
This is one result from the ubergraph (Cell types abdominal organs) query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YaphetKG I think we need to find another way to download the results. People will be surprised to have to execute the query twice.
Dynamically choose between SPARQL and TPF datasources under the hood
Csv comunica