Need help with R2RML

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!

Hi Smrati,

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

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

Hope this helps,
Jess

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!

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.

I started putting together mappings 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.

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.

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.

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