Query through many databases


I’m totally new using stardog. I’ve loaded two databases, dblp and foaf, in two separate databases. I want to “join” these databases but I can’t find out how to do these. Should I define a sort of prefix? Is it possible to do this in stardog?

Thank you very much in advanced.

First, welcome to Stardog’s and the community. Adding your two datasets is amazingly simple thanks to the underlying data representation. You just add both of your data sets to the same database. Simple as that. No need to namespace or transform or manipulate. If there are terms that are used in both datasets you want them to overlap. They should be the same concept and will connect the two datasets allowing you to answer queries across the data.

1 Like


You have multiple options:

  • As mentioned above, you can load both datasets into the same database.

  • Same, but you can load the datasets into separate named graphs then query them both using the GRAPH keyword in SPARQL. This option makes it easier to access either of the datasets in isolation.

  • Keep datasets in different databases and use SPARQL federation. If both databases are managed by the same Stardog instance, you can use the SERVICE keyword with the URI of the form db://database-name instead of the full SPARQL endpoint URL. In that case you’d avoid HTTP overhead during query evaluation (this option is currently under-documented but we’ll fix it soon).



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