# SPARQL on virtual graph

**URL:** <https://community.stardog.com/t/sparql-on-virtual-graph/884>\
**Category:** Support\
**Created:** [March 21, 2018, 4:06pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884 "2018-03-21T16:06:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [March 21, 2018, 4:06pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884/1 "2018-03-21T16:06:00Z")

</div>

I am unable to execute SPARQL on virtual graph. Every time it gives me an error as:  
“The filename, directory name, or volume label syntax is incorrect”  
Not sure if I am doing something wrong.  
I created a virtual graph from MySQL connector and without any .ttl file as mentioned in one the Stardog blogs.

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [March 21, 2018, 4:36pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884/2 "2018-03-21T16:36:18Z")

</div>

Hi Smrati,

I’m not aware of any problems with mappings generation on MySQL. I Googled your error message - it ultimately comes from Windows. One post suggested it could be a problem with a file name - maybe a space or a special character in the path. Can you confirm that you can connect to your MySQL instance with MySQL Workbench or Shell?

It sounds like you are able to create the virtual graph without any error messages and only have problems when you try to run a query. Can you double check the stardog.log file and share any errors from there.

Couple additional things to try… After you `import add` your virtual graph, try:  
`bin/stardog-admin virtual list`  
and  
`bin/stardog-admin virtual mappings virtualgraphname`  
(or if the last command returns `Unsupported join condition`)  
`bin/stardog-admin virtual mappings --format r2rml virtualgraphname`

Thanks,  
-Paul Jackson

---

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [March 21, 2018, 4:52pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884/3 "2018-03-21T16:52:28Z")

</div>

I tried bin/stardog-admin virtual list and bin/stardog-admin virtual mappings --format r2rml virtualgraphname and it displays the virtual graph and the mappings.  
May be there is some mistake witht he syntax that i am using:  
`stardog query <virtual://MyDB> select * { GRAPH <virtual://MyDB> { ?a ?b ?c } }`

Is it the right way?  
I also tried:  
`select * { GRAPH <virtual://ParaStar> { ?a ?b ?c } }`  
This also gave the same error!

I am sorry i am still a novice with the tool!

Thank you!

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [March 21, 2018, 5:05pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884/4 "2018-03-21T17:05:44Z")

</div>

If virtual list returns:

> ```
> $ bin/stardog-admin virtual list
> +-------------------+-----------+
> | Virtual Graphs | Available |
> +-------------------+-----------+
> | virtual://ParaStar | true |
> +-------------------+-----------+
> 
> 1 virtual graphs
> 
> ```

Then this is the correct query. (Reasoning should be off for this query.)  
`select * { GRAPH <virtual://ParaStar> { ?a ?b ?c } }`

Please send us the errors in your stardog.log file.

-Paul

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [March 21, 2018, 5:13pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884/5 "2018-03-21T17:13:58Z")

</div>

I just noticed that you were running this from the command line interface. Please try this:

`bin/stardog query execute MyDB "select * { GRAPH <virtual://ParaStar> { ?a ?b ?c } }"`

This assumes you get output like this:

> ```
> $ bin/stardog-admin virtual list
> +--------------------+-----------+
> | Virtual Graphs | Available |
> +--------------------+-----------+
> | virtual://ParaStar | true |
> +--------------------+-----------+
> 
> 1 virtual graphs
> 
> Paul Jackson@DESKTOP-9RV53BO /cygdrive/c/@cyg/starbench/stardog/dist
> $ bin/stardog-admin db list
> +-----------+
> | Databases |
> +-----------+
> | DB |
> +-----------+
> 
> ```

-Paul

---

<div class="post-metadata">

**Author:** ![smrati.hans](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@smrati.hans](https://community.stardog.com/u/smrati.hans)\
**Post date:** [March 21, 2018, 5:53pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884/6 "2018-03-21T17:53:21Z")

</div>

Thank you!! got the results by using the same!!

---

<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 4, 2018, 5:53pm UTC](https://community.stardog.com/t/sparql-on-virtual-graph/884/7 "2018-04-04T17:53:45Z")

</div>

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