Provides a useful command-line tool to query the content of a DbGraph (a DEX graph database).

The programm must be executed as follows:

java -cp CLASSPATH edu.upc.dama.dex.shell.Shell DEX_IMAGE

where CLASSPATH contains the jdex library and DEX_IMAGE is a dex graph database image. The command works as a shell command where queryes can be introduced:

>>

You can check the grammar of querys with the command 'help'.

Usage


Expressions that retrieve Objects (aka <objects_expression>):

select <type_id>
select "<type_name>"
select <type_id> "<attribute_name>" <op> <value>
select "<type_name>" "<attribute_name>" <op> <value>
select <attribute_id> <op> <value>
explode <node_id> <edgetype_id> in|out|both
explode <node_id> "<edgetype_name>" in|out|both

neighbors <node_id> <edgetype_id> in|out|both
neighbors <node_id> "<edgetype_name>" in|out|both

findEdges <node_id> <node_id> <edgetype_id>
findEdges <node_id> <node_id> "<edgetype_name>"

Expressions to be use with Objects (aka <objects_expression>):

heads <objects_expression>
tails <objects_expression>
count (<objects_expression>|<array_expression>)

Expressions that get a numerical result:

head <edge_id>
tail <edge_id>

findAttribute <type_id> "<attribute_name>"
findAttribute "<type_name>" "<attribute_name>"

findEdge <node_id> <node_id> <edgetype_id>
findEdge <node_id> <node_id> "<edgetype_name>"
findObject <attribute_id> <value>
edgePeer <edgetype_id> <node_id>

edges
nodes

findType "<type_name>"
attributeCount <attribute_id>
attributeSize <attribute_id>

Expression that get an Attribute array result (aka <array_expression>):

findAttributes <type_id>
findAttributes "<type_name>"
getAttributes <object_id>

Expressions that get a Value result:

getAttribute <object_id> <attribute_id>
getAttribute <object_id> "<attribute_name>"

Expressions for global variables:

get <var_name>
set <var_name> <value>

Prints:

print schema
print types
print attributes
print type <type_id>
print type "<type_name>"
print object <object_id>
print globals

Dumps:

dump schema
dump data
dump storage

Other:

help
quit

Observations:

<object_id>, <node_id>, <edge_id> and <attribute_id> must belong to Long type
<type_id>, <nodetype_id>, <edgetype_id> must belong to Integer type.
<type_name>, <nodetype_name>, <edgetype_name> must belong to String type.
<value> must match Boolean(true|false), Double, Integer, Long, String or Timestamp(Long).
<op> must be '==', '!=', '<', '<=', '>', '>=', 'like', 'ilike'.
Long must have an 'L' at the end.
Double must have '.' somewhere.
String must be quoted with '"'.