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

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:

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:

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.


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

and load you example with the command

stardog-admin virtual import myDB csv1.csv
stardog-admin virtual import myDB csv2.csv

All seems fine

❯ stardog query myDB "select ?p ?o {<>  ?p ?o }
|                   p                   |               o               |
| rdf:type                              | |
|      | "1.5"                         |
| | "4"                           |
|       | "23"                          |
|     | "Ford"                        |
|    | "James"                       |

Can you elaborate more on how you are loading it?

1 Like

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.

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