CSV import using SMS2 from Studio not from CLI

I've done CSV import with SMS2 from CLI and via REST API (thank you - nice feature).

  • Is it possible to import CSV from Studio by specifying the SMS2 mapping file?

I see some generic load csv capabilities here but nothing that could take a SMS2 file like this one

Hi R3000,

could you please share more details, how do you perform a CSV import via the REST API?

Thank you in advance.

Konstantin,

Jess has provided an example using curl please see How to Import CSV with SMS2 using HTTP POST call? - #4 by jess

Regards,
Radu

Thank you very match. It works perfectly. Unfortunately I have to specify also some properties, e.g. we have different delimiter ";", instead of ",". Do you have an idea, how the corresponding parameter is named?

Thank you in advance.

You should create a properties file (just as with CLI) and then include it with the name options in your cURL call:

-F "options=<csv.properties"

Again many thanks. Seems that -F parameters are order dependent, but it works. Where is this interface documented? I found only this https://stardog.docs.apiary.io/#reference/virtual-graphs/virtual-graph-management/post but it only applies to jdbc connections.

Back to my original question @jess - would you have an answer to this question:

  • Is it possible to import CSV from Studio by specifying the SMS2 mapping file?

I see some generic load csv capabilities here but nothing that could take a SMS2 file like this one in Studio and allow one to import the CSV.

Hi Radu,

There is not currently a way to specify a mappings file as part of the CSV import flow within Studio. Adding this capability is something we have discussed and will likely do at some point in the future. For now, however, you'll have to use the CLI to import CSV files with mappings.

Thanks,
Jason

Jason - thank you for your prompt answer will use the HTTP POST API instead.

P.S. Stardog engineers are spoiled by collocating server and studio on the same machine. Real world is different :wink:

Radu,

What issue are you facing with the server and Studio not being collocated? We don't require them to be or the Stardog CLI for that matter.

Best,
Noah

Noah,

No issue really - just a witty comment. But if you make a rule today to not allow collocating server and studio on the same machine then this feature will most likely be rolled out next week :wink:

It is all good - just trying to improve the product usage in the field.

Regards,
Radu

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.