# How to materialize a MongoDB virtual graph?

**URL:** https://community.stardog.com/t/how-to-materialize-a-mongodb-virtual-graph/1813
**Category:** Support
**Created:** [August 6, 2019, 3:30pm UTC](https://community.stardog.com/t/how-to-materialize-a-mongodb-virtual-graph/1813 "2019-08-06T15:30:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)
#### Post date: [August 6, 2019, 3:30pm UTC](https://community.stardog.com/t/how-to-materialize-a-mongodb-virtual-graph/1813/1 "2019-08-06T15:30:09Z")

</div>

Ok I have created a rudementary SMS2 mapping for a mongodb virtual graph - it works and it is nice 🙂 thank you for your help.

Now I need to map its triples to some other materialized triples. My guess I should first materialize the mongodb virtual graph, right? How can I do that?

Thanks,  
Radu

---

<div class="post-metadata">

### Author: ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)
#### Post date: [August 6, 2019, 4:30pm UTC](https://community.stardog.com/t/how-to-materialize-a-mongodb-virtual-graph/1813/2 "2019-08-06T16:30:38Z")

</div>

Radu,

Whether or not you need to materialize the virtual graph depends on what you want to do with it. You can include the triples as-is in a SPARQL query just by including a `GRAPH` block:

```auto
SELECT * WHERE {
  GRAPH <virtual://myAwesomeVirtualGraph> {
    ?s :myProp ?o
  }
  # Note that you can reuse the variables above to join with other data
  ?s :something ?else .
  ?o :another ?thing
}

```

If you want to materialize your triples, probably the easiest method would be with a SPARQL update query:

```auto
COPY <virtual://myAwesomeVirtualGraph> TO <http://stardog.com/some/other/graph>

```

---

<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 20, 2019, 4:30pm UTC](https://community.stardog.com/t/how-to-materialize-a-mongodb-virtual-graph/1813/3 "2019-08-20T16:30:42Z")

</div>

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