I want to model physical objects in Grakn. It's quite straightforward to model physical objects as a point or a rectangle:
define
length sub attribute,
value double;
position sub attribute,
value double;
lon sub position;
lat sub position;
elevation sub position;
width sub length;
depth sub length;
height sub length;
physical_object sub entity,
has lon,
has lat,
has elevation,
has width,
has depth,
has height;
For a point, simple leave width, depth and height empty.
However, I'm struggling with how to model a physical object that is a polygon, i.e. a list of connected lines. How can I model this elegantly in Grakn?
Most spatial graph databases (and CAD programs) store their data as arrays of primitives to facilitate describing any possible shape. These databases also allow one to natively perform intersection/unions on such arrays. You might want to follow that pattern if only to be able to import/export from/into these systems. Here is one example: https://docs.oracle.com/database/121/SPATL/simple-example-inserting-indexing-and-querying-spatial-data.htm#SPATL486
So perhaps the question to the GRAKN community should be: how to best model arrays of primitives?
P.S. adding temporality into the mix would make it even more interesting/challenging!