• Register

Please implement a graph database.

0 votes
497 views
Please implement a graph database (a kind of NoSQL). This graph database
should consist of nodes (with have properties) for entities and edges (which
have single or multiple properties and can be directional or bidirectional) for
relationships, and support node indexing and query. The query language has
following keywords: START, MATCH, WHERE, RETURN, ORDER BY,
AGGREGATE, SKIP, and LIMIT.
 
Example Input:
Node martin = graphDB.createNode();
martin.setProperty(“name”, “Martin”);
Node pramod = graphDB.createNode();
pramod.setProperty(“name”, “Pramod”);
Node barbara = graphDB.createNode();
pramod.setProperty(“name”, “Barbara”);
martin.createRelationshipTo(pramod, FRIEND, since = 1998);
pramod.createRelationshipTo(martin, FRIEND, since = 1998);
martin.createRelationshipTo(barbara, FRIEND);
barbara.createRelationshipTo(martin, FRIEND);
START node = Node:nodeIndex(name = “Barbara”)
MATCH path = node-[relation*1..3]->related_node
WHERE type(relation) = ‘FRIEND’
RETURN related_node.name, length(path), relation.since;
asked Feb 22, 2014 in Education by swetha (180 points)

Answers by PAQBOT

PAQ Bot suggests below links for a relevent answer:

1 Answer

0 votes
It looks like a complex problem. But still you can try to create something like this-

http://ups.savba.sk/~marek/sgdb.html
answered Feb 23, 2014 by king2014 (640 points)
...