Skip to content

Comments

download buttons#1

Open
YaphetKG wants to merge 10 commits intofrinkfrom
download-button
Open

download buttons#1
YaphetKG wants to merge 10 commits intofrinkfrom
download-button

Conversation

@YaphetKG
Copy link
Collaborator

  • adds download buttons to UI

@YaphetKG YaphetKG requested a review from balhoff February 16, 2024 18:02
Copy link

@balhoff balhoff left a 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.

header.forEach(function (h, i) {
line.push(v[h]);
});
csvContent += [line].map(e => e.join(',')) + '\n';
Copy link

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?

Copy link

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?

Copy link
Collaborator Author

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. 

Copy link

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.

@YaphetKG YaphetKG requested a review from balhoff April 12, 2024 13:25
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

Successfully merging this pull request may close these issues.

3 participants