I've the following ontology where red links are DatatypeProperties
, blue ones are ObjectProperties
and black ones 'is_a' relations. The ontology simply represent POINT
, COORDONATES
and SHAPES
concepts.
I'm interested in doing geometric shape recognition with this ontology.
Let's says that we have four instances of POINT
: point0, point1, point2 and point3, with proper coodonates and all related with the property is-contained-in
to an instance of SHAPE
called shape0.
What is necessary in this ontology to infer that according to points coordonates, shape0 is a SQUARE
instead of being a RECTANGLE
?
in other words how to introduce recognition capabilities in the ontology.
I am just giving an example, how it can be written as a swrl rule. Please note that this is not tested and may not be accurate. so, consider this as only a clue.
Shape(?s),hasCordinates(?s,c1),hasCordinates(?s,c2),hasx(?c1,?x1),hasy(?c1,?y1),subtract(?x1,?y1,?diff1),hasx(?c2,?x2),hasy(?c2,?y2),subtract(?x2,?y2,?diff2),pow(?diff1, 2, ?sq1),pow(?diff2, 2, ?sq2),add(sq1,sq2,?sum1).....(?sum2).....-> issquare(?s)
Please note that there would be more efficient ways to do this.