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?
Given that not every
physical_objectin your world has width, depth and height, maybe we can remove these attributes from the high-level definition?And rectangle can be
Then you can define point like that
and an edge would be 2 points
after that polygon can be represented as
But in that way polygon can be a set of not connected edges, you can define polygon differently depending on how you want to use it