# Named virtual graphs

**URL:** <https://community.stardog.com/t/named-virtual-graphs/4171>\
**Category:** Support\
**Created:** [January 8, 2023, 4:41am UTC](https://community.stardog.com/t/named-virtual-graphs/4171 "2023-01-08T04:41:40Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![saboris](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@saboris](https://community.stardog.com/u/saboris)\
**Post date:** [January 8, 2023, 4:41am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/1 "2023-01-08T04:41:40Z")

</div>

Hi,

Is it possible to somehow achieve something like the following with virtual graphs:

```auto
mapping from sql {
  SELECT FROM `mydatasource`.`products` P
}
to {
  graph ?graph {
    ?product a commercial:Product .
    ?product rdfs:label ?product_name
  }
}
where {
  BIND(template("http://www.onlineshopforall.com/stores/id={store_id}") AS ?graph)
  BIND(template("http://www.onlineshopforall.com/products/id={product_id}") AS ?product)
}

```

That is, I'd like for some of the triples in a virtual graph to sit in a named graph, also derived from my relational source. In other words, I'd like to be working with "virtual quads" not only "virtual triples". Is that possible?

When I try the above, the effect is that the virtual graph is empty with no warning or error (well, perhaps in the server logs, but I don't have access to them).

Thanks much in advance!  
Boris

---

<div class="post-metadata">

**Author:** ![Lars\_Heling](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/lars_heling/32/1657_2.png) [@Lars\_Heling](https://community.stardog.com/u/Lars_Heling)\
**Post date:** [January 9, 2023, 8:28am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/2 "2023-01-09T08:28:39Z")

</div>

Hi Boris,

named graphs (or _virtual quads_) are currently not supported as part of Virtual Graph mappings. See also the end of this section in the docs: [Virtual Graphs | Stardog Documentation Latest](https://docs.stardog.com/virtual-graphs/#querying-virtual-graphs)  
However, you can specify multiple Virtual Graphs for the same data source which you can query just like named graphs. Alternatively, in your example, you can add an additional triple to each product in the mapping to indicate the products' `store_id`. Then using an INSERT query you can materialize the data into a named graph in a DB. This would look something like this:

```auto
INSERT {
    GRAPH ?storeId { 
        ....
    }
}
WHERE {
    ?product a commercial:Product .
    ?product commercial:storeId ?storeId
}

```

I hope this helps.  
Best regards,

Lars

---

<div class="post-metadata">

**Author:** ![saboris](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@saboris](https://community.stardog.com/u/saboris)\
**Post date:** [January 9, 2023, 5:13pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/3 "2023-01-09T17:13:27Z")

</div>

Hi,

Thanks for the clarification. Yes, will consider alternatives such materialization.

Best,  
Boris

---

<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:** [February 5, 2023, 2:03pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/4 "2023-02-05T14:03:37Z")

</div>



---

<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:** [March 5, 2023, 5:49pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/5 "2023-03-05T17:49:48Z")

</div>



---

<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 3, 2023, 4:09am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/6 "2023-04-03T04:09:52Z")

</div>



---

<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:** [May 3, 2023, 8:05am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/7 "2023-05-03T08:05:35Z")

</div>



---

<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:** [June 2, 2023, 6:36pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/8 "2023-06-02T18:36:38Z")

</div>



---

<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 5, 2023, 3:17pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/9 "2023-07-05T15:17:58Z")

</div>



---

<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 8, 2023, 12:22pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/10 "2023-08-08T12:22:50Z")

</div>



---

<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:** [September 16, 2023, 11:00am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/11 "2023-09-16T11:00:07Z")

</div>



---

<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:** [October 29, 2023, 7:36pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/12 "2023-10-29T19:36:59Z")

</div>



---

<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:** [December 17, 2023, 5:21am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/13 "2023-12-17T05:21:24Z")

</div>



---

<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:** [February 9, 2024, 1:38am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/14 "2024-02-09T01:38:25Z")

</div>



---

<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 6, 2024, 1:31pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/15 "2024-04-06T13:31:05Z")

</div>



---

<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 14, 2024, 12:18pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/16 "2024-07-14T12:18:12Z")

</div>



---

<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:** [January 18, 2025, 10:17am UTC](https://community.stardog.com/t/named-virtual-graphs/4171/17 "2025-01-18T10:17:29Z")

</div>



---

<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 25, 2025, 1:43pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/18 "2025-08-25T13:43:42Z")

</div>



---

<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 21, 2026, 5:12pm UTC](https://community.stardog.com/t/named-virtual-graphs/4171/19 "2026-04-21T17:12:16Z")

</div>


