Hello, I am newbie with grakn and I need your help to efficiently design my schema so that it fulfills what I want to achieve.
What I want to put in the knowledge graph:
I want to add the whole structure of an university (see image below) inside a graph.
I want to be able to query at multiple level like finding the students that are in a specific faculty or in a specific departement.
How I proceeded so far:
hierarchy sub relation, abstract, relates parent, relates child; unit-hierarchy sub hierarchy, relates parent-unit as parent, relates child-unit as child; unit sub entity, owns name, owns orgtype, plays unit-hierarchy:parent-unit, plays unit-hierarchy:child-unit;
name and orgtype are strings. orgtype correspond to the layer name (faculty, department,…)
I managed to put the data and relation at each level (defining relation between faculty-departement, departement-section).
Problems I have:
-Problem 1: I would like to retrieve all the Department of a specific Faculty and all the Section of a Faculty.
-Problem 2: Display the whole structure on the Workbase (from faculties to department to section)
For the problem 1, I’ve tried to do on grakn workbase:
match $relation (parent-unit: $faculty, child-unit: $department) isa unit-hierarchy; $faculty isa unit, has orgtype $orgtype; $orgtype "science"; get $departement;
It retrieves nothing.
I don’t know how to proceed to obtain all section for a given faculty.
For the problem 2, I don’t really know if there’s a way to infer the full chain of relation (from faculty to departement to section). For instance, given a section, finding it’s department and faculty. Maybe the design itself isn’t appropriate to do such things.
I’m sorry, there’s a lot of question but I’m stucked at this step and don’t know how to move forward. Please let me know if something is unclear.