humanitiesplusdesign / data-pen

Personal modeling application for Linked Data.
http://hdlab.stanford.edu/fibra
26 stars 0 forks source link

Export table as CSV #122

Closed esjewett closed 7 years ago

jiemakel commented 7 years ago

SPARQL SELECT queries support serializing their results as CSV, which we can make use of if we want.

esjewett commented 7 years ago

That sounds potentially good. We would need the getItems API to have that as an option, I guess. Will have to look into it. /cc @alexsherman

jiemakel commented 7 years ago

We need to figure out how to deal with 1) writing out resources vs their labels and 2) multiple values for a property in the CSV format .

If the labels are unique, we could just write them and reconstruct the IRI later on import. If not, we need to write the IRI/ID (possibly in addition to the label, but really we're talking about the Palladio-style linked tables here really soon).

For multiple values, we can 1) write them in a single cell using a particular separator, 2) multiply the property columns as many times as the maximum subject has values for the property (people in the humanities seem to love doing this in Excel) or 3) we can do what OpenRefine does, and add additional rows for the additional values (where other properties, particularly the ID are empty, which acts as the hint for us that these values still refer to the same subject).