BigNoob
BigNoob

Reputation: 21

(error) ERR unknown command 'GRAPH.QUERY' in RedisGraph

I don't understand why RedisGraph command 'GRAPH.QUERY' doesn't work, i've downloaded and installed Redis using this tutorial. when i test RedisGraph by inserting this command:

GRAPH.QUERY MotoGP "CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team 
{name:'Yamaha'}), (:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}), (:Rider 
{name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})"

it throws error:

(error) ERR unknown command 'GRAPH.QUERY'

Here is information about RedisGraph version:

127.0.0.1:6379> info
# Server
redis_version:4.0.9
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:9435c3c2879311f3
redis_mode:standalone
os:Linux 5.0.0-31-generic x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:7.4.0
process_id:912
run_id:68f78bd6961ba68707913a5e8db7ddce9ab5ae52
tcp_port:6379
uptime_in_seconds:17012
uptime_in_days:0
hz:10
lru_clock:11455406
executable:/usr/bin/redis-server
config_file:/etc/redis/redis.conf

Upvotes: 2

Views: 1993

Answers (2)

Vikram Rawat
Vikram Rawat

Reputation: 1662

Reason is: You have only installed Redis. You need to install Redis Graph, as well, which is a separate module of Redis.

Recommendation: I recommend you install Docker and then run simply run below command:

docker run -p 6379:6379 -it --rm redislabs/redisgraph

Also, refer the below site for more information:

https://oss.redislabs.com/redisgraph/

Upvotes: 4

monochromec
monochromec

Reputation: 169

This requires the loading of the Graph module in order to be able to process this Graph-specific command. This is done by modifying the configuration file redis.conf, normally found in /etc or below, depending your configuration. If you insert the command loadmodule in that file, redis-server will load the Graph module upon server start up and you will have the Graph-specific commands including the one you mentioned at your disposal.

You will find h/l documentation about how to configure a Redis instance at https://redis.io/topics/config, comprehensive information about each configuration directive is part of the config sample included in the source code on Github (https://github.com/antirez/redis).

Information on how to build the Graph module from source can be found at https://oss.redislabs.com/redisgraph/#building.

I also noted that you're using quite an old version of Redis, probably caused by the fact that you're installing this from your OS package repository. You may want to consider building a more recent version by cloning the Github repo mentioned above.

Upvotes: 1

Related Questions