# Import N-quads files to stardog

**URL:** <https://community.stardog.com/t/import-n-quads-files-to-stardog/3194>\
**Category:** Support\
**Created:** [August 9, 2021, 9:03pm UTC](https://community.stardog.com/t/import-n-quads-files-to-stardog/3194 "2021-08-09T21:03:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malak](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@Malak](https://community.stardog.com/u/Malak)\
**Post date:** [August 9, 2021, 9:03pm UTC](https://community.stardog.com/t/import-n-quads-files-to-stardog/3194/1 "2021-08-09T21:03:47Z")

</div>

Hello everyone !

I'm currently trying to migrate from Fuseki to Stardog so I'm trying to migrate data.

I notice I can load data to stardog from files using Stardog studio but the problem is that all triple end up in the default graph or one new named graph instead of importing every triple in their respective named graph described by my files.

Is it a bug and does this feature exist with stardog ? How can I import all my named graph from my N-quads files ?

Thanks for the help !

---

<div class="post-metadata">

**Author:** ![dlbis](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/dlbis/32/721_2.png) [@dlbis](https://community.stardog.com/u/dlbis)\
**Post date:** [August 16, 2021, 11:40am UTC](https://community.stardog.com/t/import-n-quads-files-to-stardog/3194/2 "2021-08-16T11:40:46Z")

</div>

For a full export of all named graphs, I use a NQUADS export as in: stardog data export -f NQUADS -g ALL -p $PSW-u $USR -v $SERVER/$DB \<path/file.nq\>

Then, for the import, a data add: stardog data add -f NQUADS -p $PSW -u $USR $SERVER/$DB \<path/file.nq\>

And those two operations get all the triples at the right place (in the right named graph)

---

<div class="post-metadata">

**Author:** ![dlbis](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/dlbis/32/721_2.png) [@dlbis](https://community.stardog.com/u/dlbis)\
**Post date:** [August 16, 2021, 11:48am UTC](https://community.stardog.com/t/import-n-quads-files-to-stardog/3194/3 "2021-08-16T11:48:00Z")

</div>

As you already have a valid NQUADS file, you can skip the first part and do only the second.

---

<div class="post-metadata">

**Author:** ![dlbis](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/dlbis/32/721_2.png) [@dlbis](https://community.stardog.com/u/dlbis)\
**Post date:** [August 16, 2021, 11:55am UTC](https://community.stardog.com/t/import-n-quads-files-to-stardog/3194/4 "2021-08-16T11:55:38Z")

</div>

And you can use Stardog Studio **Load Data** command too, instead of the CLI command. You have to provide a **valid NQUADS file** and select the **NQUADS file format**. And the result is the same as with the CLI command.

---

<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:** [August 30, 2021, 11:55am UTC](https://community.stardog.com/t/import-n-quads-files-to-stardog/3194/5 "2021-08-30T11:55:58Z")

</div>

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