how to query virtual graphs

13 views
Skip to first unread message

gh....@gmail.com

unread,
Feb 1, 2016, 12:20:18 PM2/1/16
to Stardog
Hi,

I am testing the virtual graph feature of Stardog 4.0.3 (developer version).
I managed to create a virtual graph following the instructions on http://docs.stardog.com/#_virtual_graphs

$ ./stardog-admin virtual list
+----------------+
| Virtual Graphs |
+----------------+
| virtual://dept |
+----------------+

1 virtual graphs

However, when I try to query it, I got a problem

$ ./stardog query  'SELECT * { GRAPH <virtual://dept> { ?person a emp:Employee } }'
No driver was found which supports the connection string: 'SELECT * { GRAPH <virtual://dept> { ?person a emp:Employee } }', please double-check the URL and verify the protocol is correct and try again.

$ ./stardog query dept 'SELECT * { GRAPH <virtual://dept> { ?person a emp:Employee } }'
Database 'dept' does not exist.

How should I issue the query from command line?

Thanks in advance!

Guohui


Zachary Whitley

unread,
Feb 1, 2016, 12:50:46 PM2/1/16
to Stardog
On Mon, Feb 1, 2016 at 12:20 PM, <gh....@gmail.com> wrote:
Hi,

I am testing the virtual graph feature of Stardog 4.0.3 (developer version).
I managed to create a virtual graph following the instructions on http://docs.stardog.com/#_virtual_graphs

$ ./stardog-admin virtual list
+----------------+
| Virtual Graphs |
+----------------+
| virtual://dept |
+----------------+

1 virtual graphs

However, when I try to query it, I got a problem

$ ./stardog query  'SELECT * { GRAPH <virtual://dept> { ?person a emp:Employee } }'
No driver was found which supports the connection string: 'SELECT * { GRAPH <virtual://dept> { ?person a emp:Employee } }', please double-check the URL and verify the protocol is correct and try again.

You need to specify a database name to query against which is correct below.
 

$ ./stardog query dept 'SELECT * { GRAPH <virtual://dept> { ?person a emp:Employee } }'
Database 'dept' does not exist.

How should I issue the query from command line?

It looks like the command is correct and the response is telling you what the problem is. You probably haven't created a database named "dept". An empty one will do. You can't issue a query without specifying a database.

(I did notice looking at the man page for "stardog query" that the execute portion isn't marked as optional "stardog query [execute]" which it is)
 

Thanks in advance!

Guohui


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Guohui Xiao

unread,
Feb 1, 2016, 3:56:33 PM2/1/16
to sta...@clarkparsia.com
Thanks for the tip. I created an empty database and I am able to query.

$ ./stardog query execute dept 'prefix emp: <http://example.com/emp/> SELECT * { GRAPH <virtual://dept> { ?person a emp:Employee } }'
+-----------------------------+
|           person            |
+-----------------------------+
+-----------------------------+

Query returned 1 results in 00:00:00.095

One comment is that I had to use ansi mode in the connection string in dept.properties:

jdbc.url=jdbc\:mysql\://localhost/dept?sessionVariables=sql_mode='ansi'

Otherwise, it complains about the generated SQL syntax.

Regards,

Guohui




You received this message because you are subscribed to a topic in the Google Groups "Stardog" group.
To unsubscribe from this topic, visit https://groups.google.com/a/clarkparsia.com/d/topic/stardog/FeRtVoVWwWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stardog+u...@clarkparsia.com.



--
Guohui Xiao, PhD
Assistant Professor with a fixed-term contract
KRDB - Faculty of Computer Science        
Free University of Bozen-Bolzano
Piazza Domenicani, 3                
I-39100 Bolzano, Italy    

http://www.ghxiao.org
Reply all
Reply to author
Forward
0 new messages