Repository navigation
CSV datamapping - #1576
CSV datamapping#1576danielpeintner wants to merge 10 commits into
Conversation
danielpeintner
left a comment
There was a problem hiding this comment.
Some early comments
| ContentSerdes.getMediaType(this.#content.type) === "text/csv" | ||
| ? csvBindingOptionsFromForm(this.form as unknown as Record<string, unknown>) | ||
| : undefined; |
There was a problem hiding this comment.
Do you think we can find a more generic approach that works beyond text/csv ?
There was a problem hiding this comment.
Yes. I’ll remove the text/csv check and pass the decoding context through for every media type. CsvCodec will extract and validate its own form settings, keeping format-specific handling out of InteractionOutput.
|
@wiresio I think this is an excellent start and proof of concept for CSV data handling. 👍 Some points
@egekorkan @relu91 any comment? |
| "@context": [ | ||
| "https://www.w3.org/2019/wot/td/v1", | ||
| { | ||
| "csvv": "https://www.w3.org/wot/payload-binding/csv/v1#", |
There was a problem hiding this comment.
I would not use real looking URLs here. example.org etc would be less misleading
There was a problem hiding this comment.
would be better to format the TDs
There was a problem hiding this comment.
I don't see a URI scheme and the hrefs are relative. file:// should be used instead (seeing the client code)
There was a problem hiding this comment.
Used this in the client code:
// Set the base URL for the data directory instead of writing "file://" with full path to the href directly
thingDescription.base = dataDirectory;
There was a problem hiding this comment.
not sure about the level of this code. Shouldn't it be more in the codecs somehow? We cannot have a new binding in this level all the time I think?
There was a problem hiding this comment.
I think @egekorkan is right. It belongs to the codecs.
Some more toughts:
- Currently we have the situation that most (not all) codecs are in the core. Do we want to have this in the core or should it be somewhere else?
- Maybe another remark about the naming. The file currently reads csv-binding. Binding might be misleading. What do you think?
There was a problem hiding this comment.
We could
- move csv-binding.ts to packages/core/src/codecs/csv-options.ts
- rename CsvBindingOptions to CsvCodecOptions
That keeps the parsing separate from the codec implementation without suggesting a new binding layer.
There was a problem hiding this comment.
maybe it would be good to make one Thing file based and the other one HTTP? HTTP would serve the csv file over an endpoint and some uri variables can be used for date time filtering? Still csv response though
There was a problem hiding this comment.
I can create a mock InfluxDB server and then a corresponding client. Maybe also a nice task for the plugfest.
There was a problem hiding this comment.
would be good to test this for other protocols and media types as well
There was a problem hiding this comment.
Currently only user story 2 with CSV is tested. More to come during the plugfest :-)
|
We discussed in the committer call and resolved that this is an experiment. Therefore, we converted this PR to a draft. |
Let's keep it on this PR draft for the moment. Will fix coding style and add "CSV" (as experimental). |
No description provided.