# How to add more data to the existing Stardog database though csv file

**URL:** <https://community.stardog.com/t/how-to-add-more-data-to-the-existing-stardog-database-though-csv-file/3093>\
**Category:** Support\
**Created:** [June 12, 2021, 10:27am UTC](https://community.stardog.com/t/how-to-add-more-data-to-the-existing-stardog-database-though-csv-file/3093 "2021-06-12T10:27:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![namannhr](https://avatars.discourse-cdn.com/v4/letter/n/a6a055/32.png) [@namannhr](https://community.stardog.com/u/namannhr)\
**Post date:** [June 12, 2021, 10:27am UTC](https://community.stardog.com/t/how-to-add-more-data-to-the-existing-stardog-database-though-csv-file/3093/1 "2021-06-12T10:27:04Z")

</div>

Hi stardog team,

I want to know how can we add more data through new csv file to the existing database. I have written an example of the issue I am facing. Please help:

I have a stardog database that I have created by importing csv file. Let's say the csv file is:

Car\_id,Car\_name,Car\_owner  
23 , Ford , James  
31 , BMW , Dane  
14 , Fiat , Mary

The above csv file create three instances of class car with IRI as Car\_id

Now, I want to add more details about those cars with a new csv file in the same database. New csv is:

Car\_id,Car\_Capacity,Car\_age  
23 , 4 ,1.5  
31 , 2 ,2  
14 , 6 ,0.5

I want to add this new data such that the previous 3 nodes with Car\_id IRI has now additional details of Car\_Capacity and Car\_age, without creating again 3 new nodes.

So, finally I want these 3 Car\_id IRI to have 4 attributes : Car\_Name, Car\_owner , Car\_Capacity and Car\_age.

Can you please help me in solving above problem.

Thanks

---

<div class="post-metadata">

**Author:** ![serge](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/serge/32/376_2.png) [@serge](https://community.stardog.com/u/serge)\
**Post date:** [June 13, 2021, 2:47pm UTC](https://community.stardog.com/t/how-to-add-more-data-to-the-existing-stardog-database-though-csv-file/3093/2 "2021-06-13T14:47:25Z")

</div>

Thought I prefer building my own mapping, I assume that you are using the auto generated map.

Therefore, If I take your csv (and remove space beside comma), and use the following properties

```auto
#cars.properties
base=http://example.com/cars#
csv.class=http://example.com/class/Cars
unique.key.sets=(Car_id)

```

and load you example with the command

```auto
stardog-admin virtual import myDB cars.properties csv1.csv
stardog-admin virtual import myDB cars.properties csv2.csv

```

All seems fine

```auto
❯ stardog query myDB "select ?p ?o {<http://example.com/cars#/Car_id=23> ?p ?o }
"
+---------------------------------------+-------------------------------+
| p | o |
+---------------------------------------+-------------------------------+
| rdf:type | http://example.com/class/Cars |
| http://example.com/cars##Car_age | "1.5" |
| http://example.com/cars##Car_Capacity | "4" |
| http://example.com/cars##Car_id | "23" |
| http://example.com/cars##Car_name | "Ford" |
| http://example.com/cars##Car_owner | "James" |
+---------------------------------------+-------------------------------+

```

Can you elaborate more on how you are loading it?

---

<div class="post-metadata">

**Author:** ![namannhr](https://avatars.discourse-cdn.com/v4/letter/n/a6a055/32.png) [@namannhr](https://community.stardog.com/u/namannhr)\
**Post date:** [June 14, 2021, 7:31am UTC](https://community.stardog.com/t/how-to-add-more-data-to-the-existing-stardog-database-though-csv-file/3093/3 "2021-06-14T07:31:48Z")

</div>

Hi Serge,  
Thanks, this solved my doubt. Previously, I am adding the csv file through Stardog studio. There is no option of attaching properties file in studio. After using command line, it works fine. Thanks once again.

---

<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:** [June 28, 2021, 7:32am UTC](https://community.stardog.com/t/how-to-add-more-data-to-the-existing-stardog-database-though-csv-file/3093/4 "2021-06-28T07:32:30Z")

</div>

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