# Combining virtual graphs and the other graphs

**URL:** <https://community.stardog.com/t/combining-virtual-graphs-and-the-other-graphs/1758>\
**Category:** Support\
**Created:** [June 26, 2019, 3:10pm UTC](https://community.stardog.com/t/combining-virtual-graphs-and-the-other-graphs/1758 "2019-06-26T15:10:49Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [June 26, 2019, 3:10pm UTC](https://community.stardog.com/t/combining-virtual-graphs-and-the-other-graphs/1758/1 "2019-06-26T15:10:49Z")

</div>

Hi,

We have several named graphs (triples physically loaded in the triple store) and we have created one virtual graph on a relational database. As the information in the virtual graph is completing what we have in one of the named graph, we need to combine both graphs in our queries.

If I am using the following syntax, I am able to combine the graphs and get all the triples.

> select \*  
> where {  
> {graph virtual://drm { [http://www.com/organization/drm/1234](http://www.com/organization/drm/1234) ?p ?o }}  
> union  
> {graph [http://www.com/graphs/org](http://www.com/graphs/org) { [http://www.com/organization/drm/1234](http://www.com/organization/drm/1234) ?p ?o }} }

But if I am using that other syntax, only the triples of the non virtual graph are returned. And there is a warning in the log.

> select \*  
> from virtual://drm  
> from [http://www.com/graphs/org](http://www.com/graphs/org)  
> where { [http://www.com/organization/drm/1234](http://www.com/organization/drm/1234) ?p ?o }

> WARN 2019-06-26 13:49:35,916 [stardog-user-19] com.complexible.stardog.plan.optimizer.VirtualGraphProcessor:getDefaultVirtualGraph(119): There can only be a single virtual graph in the query dataset: {} [virtual://drm, [http://www.com/graphs/org](http://www.com/graphs/org)]

- Is there a way to make something like the second syntax working?
- And maybe also to add a second virtual graph in the query?
- Could that second virtual graph be non relational (MongoDB or Cassandra)?

Thanks!

---

<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:** [June 26, 2019, 3:39pm UTC](https://community.stardog.com/t/combining-virtual-graphs-and-the-other-graphs/1758/2 "2019-06-26T15:39:28Z")

</div>

Hi Daniel,

We are working on this right now and will release it in 1-2 months. You will be able to include any number and type of virtual graphs in the dataset specification.

Best,  
Jess

---

<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:** [July 10, 2019, 3:39pm UTC](https://community.stardog.com/t/combining-virtual-graphs-and-the-other-graphs/1758/3 "2019-07-10T15:39:29Z")

</div>

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