1

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.

enter image description here

Fopa Léon Constantin
  • 11,863
  • 8
  • 48
  • 82
  • Not sure what exactly you want...you may need to have rules for finding out the shape. e.g: if it is a square then it has four lines of symmetry and a rectangle has two. – Swamy Dec 17 '12 at 11:02
  • That is a good start. How to formulate such rules? – Fopa Léon Constantin Dec 17 '12 at 12:06
  • you can use SWRL/SPARQL to write such rules. you can write them using protege if you are using Protege to build ontologies – Swamy Dec 17 '12 at 13:25

1 Answers1

0

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.

Swamy
  • 771
  • 1
  • 8
  • 24
  • A shape does not have a coordinate so your relation hasCordinates(?s,c1) sounds not correct to me. – Fopa Léon Constantin Dec 17 '12 at 14:10
  • In you case, Shape has a point and that point has coordinates..like hasPoint(?s,?p1), hasCordinates(?p1,?c1)...As I told you this is only example; you have to explore further... – Swamy Dec 18 '12 at 02:27