# Need help with R2RML

**URL:** <https://community.stardog.com/t/need-help-with-r2rml/885>\
**Category:** Support\
**Created:** [March 22, 2018, 7:01pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885 "2018-03-22T19:01:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [March 22, 2018, 7:01pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/1 "2018-03-22T19:01:24Z")

</div>

Hi Team,

I am trying to convert relational database to rdf/ttl/n3 format. I dont have any ttl file for the same and I just want to export the relational database schema into an rdf. Is it possible to do with Stardog?

Thank you!

---

<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:** [March 22, 2018, 7:07pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/2 "2018-03-22T19:07:58Z")

</div>

Hi Smrati,

Once you’ve created your virtual graph, you can import the statements like so:

```auto
insert {
  ?s ?p ?o
}
where {
  graph <virtual://vg> {
    ?s ?p ?o
  }
}

```

Hope this helps,  
Jess

---

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [March 22, 2018, 7:13pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/3 "2018-03-22T19:13:17Z")

</div>

Thank you so much for the response!  
I am sorry but I did not understand the above mentioned command!  
I have created virtual graph from the relational database but it has the data from the database. I just want the schema/metadata from the DB.

Thank you!

---

<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:** [March 22, 2018, 7:16pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/4 "2018-03-22T19:16:51Z")

</div>

We don’t currently expose the schema to SPARQL queries. You are able to export the generated mappings using the `virtual mappings` command. This contains the set of tables and fields. What do you need to do with the metadata? Perhaps there is another approach.

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [March 22, 2018, 7:26pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/5 "2018-03-22T19:26:17Z")

</div>

I started putting together [mappings](https://github.com/semantalytics/information-schema-r2rml/blob/master/mysql.r2rml) for the information\_schema table a while ago. I never got around to completing it so it still needs some work but if you wanted to finish it, it might get you what you're looking for. A helping hand with PR's would always be appreciated.

Right now it's pretty much what you'd get with the default mappings but I put this together before default mappings and I was planning on slowly migrating it over to a more sensible mapping later.

---

<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:** [March 22, 2018, 7:30pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/6 "2018-03-22T19:30:34Z")

</div>

Which database did you test it on? This won’t work consistently as we don’t always get the metadata from the JDBC drivers for INFORMATION\_SCHEMA.

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [March 22, 2018, 7:32pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/7 "2018-03-22T19:32:30Z")

</div>

I think it was MySQL or some variant. I didn’t get the chance to test anything extensively. Then I’m glad I didn’t spend much time on it. That’s a shame. It would have been cool if that would be something you could do.

---

<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:** [April 5, 2018, 7:32pm UTC](https://community.stardog.com/t/need-help-with-r2rml/885/8 "2018-04-05T19:32:49Z")

</div>

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