# CSV import using SMS2 from Studio not from CLI

**URL:** <https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686>\
**Category:** Stardog Studio\
**Created:** [September 3, 2020, 1:50pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686 "2020-09-03T13:50:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [September 3, 2020, 1:50pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/1 "2020-09-03T13:50:01Z")

</div>

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](https://www.stardog.com/blog/importing-exploring-and-exporting-your-data-with-stardog-studio/#:~:text=To%20get%20started%2C%20just%20choose,each%20row%20of%20the%20CSV) but nothing that could take a SMS2 file like [this one](https://github.com/stardog-union/stardog-examples/blob/develop/examples/cli/virtual/csv/cars_mappings.sms)

---

<div class="post-metadata">

**Author:** ![kzanev](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/kzanev/32/824_2.png) [@kzanev](https://community.stardog.com/u/kzanev)\
**Post date:** [September 3, 2020, 2:06pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/2 "2020-09-03T14:06:47Z")

</div>

Hi R3000,

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

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [September 3, 2020, 2:50pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/3 "2020-09-03T14:50:27Z")

</div>

Konstantin,

Jess has provided an example using curl please see [How to Import CSV with SMS2 using HTTP POST call? - #4 by jess](https://community.stardog.com/t/how-to-import-csv-with-sms2-using-http-post-call/2425/4)

Regards,  
Radu

---

<div class="post-metadata">

**Author:** ![kzanev](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/kzanev/32/824_2.png) [@kzanev](https://community.stardog.com/u/kzanev)\
**Post date:** [September 3, 2020, 3:42pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/4 "2020-09-03T15:42:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [September 3, 2020, 3:45pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/5 "2020-09-03T15:45:30Z")

</div>

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

```auto
-F "options=<csv.properties"

```

---

<div class="post-metadata">

**Author:** ![kzanev](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/kzanev/32/824_2.png) [@kzanev](https://community.stardog.com/u/kzanev)\
**Post date:** [September 3, 2020, 4:56pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/6 "2020-09-03T16:56:58Z")

</div>

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](https://stardog.docs.apiary.io/#reference/virtual-graphs/virtual-graph-management/post) but it only applies to jdbc connections.

---

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [September 3, 2020, 5:43pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/7 "2020-09-03T17:43:55Z")

</div>

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](https://www.stardog.com/blog/importing-exploring-and-exporting-your-data-with-stardog-studio/#:~:text=To%20get%20started%2C%20just%20choose,each%20row%20of%20the%20CSV) but nothing that could take a SMS2 file like [this one](https://github.com/stardog-union/stardog-examples/blob/develop/examples/cli/virtual/csv/cars_mappings.sms) in Studio and allow one to import the CSV.

---

<div class="post-metadata">

**Author:** ![jason](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jason/32/226_2.png) [@jason](https://community.stardog.com/u/jason)\
**Post date:** [September 3, 2020, 5:59pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/8 "2020-09-03T17:59:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [September 3, 2020, 6:19pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/9 "2020-09-03T18:19:58Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![noahgorstein](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/noahgorstein/32/584_2.png) [@noahgorstein](https://community.stardog.com/u/noahgorstein)\
**Post date:** [September 3, 2020, 6:52pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/10 "2020-09-03T18:52:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [September 4, 2020, 1:49pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/11 "2020-09-04T13:49:21Z")

</div>

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 😉

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

Regards,  
Radu

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [September 18, 2020, 1:49pm UTC](https://community.stardog.com/t/csv-import-using-sms2-from-studio-not-from-cli/2686/12 "2020-09-18T13:49:23Z")

</div>

Closed on September 18, 2020, 1:49pm UTC

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