0
votes

I'm attempting to create a Graph Database in OrientDB that will store some information on video games. I want some of the fields on the "Game" Vertex to be populated based on the Game Vertex's relationship (edges) with other Vertices.

Currently I have 3 kinds of Vertices:

  1. Game

  2. Platform

  3. Company

To relate these 3 Vertex Classes to one another, I have 2 kinds of Edges:

  1. Available_On

  2. Developed_By

e.g.: "Game" (Vertex) was "Developed_By" (Edge) "Company" (Vertex)

or

e.g.: "Game" (Vertex) is "Avaialble_On" (Edge) "Platform" (Vertex)

The "Game" Vertex has four fields:

  1. name (String)

  2. releaseDate (String)

  3. devs (LinkList?)

  4. plats (LinkList?)

"name" and "releaseDate" on the "Game" Vertex are simple Strings that I manually set. However, I want the "devs" and "plats" fields to be set based on the "Game" Vertex's relationships to "Platform" and "Company" Vertices.

e.g.: If the "Game" Vertex has any outgoing relationship "Developed_By" to any "Company" Vertices, list those "Company" Vertices' "name" fields as the contents of the "devs" field for the "Game" Vertex.

I found that I can set Properties for the Game Vertex Class and add "LINKLIST" as the type, which allows me to relate the Property to a Linked_Class (e.g.: "Company").

Unfortunately, adding this LinkList Property to the "Game" Vertex didn't seem to do anything (as far as I can tell); querying the "Game" Vertex doesn't show a "devs" or a "plats" field despite them appearing in the Schema.

Currently, if I submit this query:

SELECT FROM Game WHERE name='Myst Masterpiece Edition'

I receive the Game Vertex, but the "devs" and "plats" LinkList Properties don't seem to appear at all.

I'm not entirely sure where to go from here; any insight is greatly appreciated.

1

1 Answers

0
votes

To be able to use Linklist you should put values on it.

create class Game extends V
create property Game.name string
create property Game.releaseDate string
create property Game.devs LINKLIST
create property Game.plats LINKLIST

create class Company extends V
create property Company.name string


insert into Company(name) values ("Ordilogic System")                         #26:0
insert into Game(name, releaseDate) values ("Unreal"), ("1998-05-22")         #17:0
update #17:0 set devs = #26:0


select from Game where name = "Unreal"

enter image description here

To see devs name:

select devs.name as devs, releaseDate, name, out() as Developed_By from Game where name = "Unreal"