SPARQL on virtual graph

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.

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

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!

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

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

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

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