**EXTRACT\_NONTAXONOMICAL\_CONSTRAINT (Ontology)**

```
{
for each node in Ontology
  {
    contentconstraint = false;
       if(object_property(nodei
                                 , nodej
                                        ))
          contentconstraint = true;
         write (object_property(nodei
                                        , nodej
                                               ) ➔
 target_class(nodei
                    ));
```
else if(object\_property(nodei , nodej ) ^ [datatype\_property(nodei ,rel(int)) v datatype\_property (nodej ,rel(int))])

if(parent\_of(superconcept, subconcept))

subconcept1 ←superconcept2;

write(parent\_of(superconcept, subconcept) ➔

else if(parent\_of(superconcept1, subconcept1) ^

write(parent\_of(superconcept1,subconcept2) ^

parent, newly created child and the datatype property leading to target class.

**EXTRACT\_NONTAXONOMICAL\_CONSTRAINT (Ontology)**

, nodej ))

, nodej

) ➔

Algorithm for extracting taxonomical constraints runs as follows: given the PROO ontology, all the super concept and sub concept hierarchies are identified. Super concept node is called parent and sub concept node is called child. The rules are then obtained as of the predicate on the hierarchy as the relation between parent and child concepts leading to target class. Content constraint is initialized to the false value in the beginning. It is then changed to true value after taxonomical constraints are obtained. The Algorithm also tests for descendant child nodes in the hierarchy. A descendant node is a node which is derived from the ancestor node. An ancestor node is the parent node in the given hierarchy. All the child nodes for a given parent are known as descendant nodes. The intermediate parent node is devised as another child node to satisfy the descendant property. At this level, the content constraint value is changed to true. The rules are then obtained as of the predicate on the hierarchy as the relation between

**Algorithm for extracting taxonomical constraints from ontology**

contentconstraint = true;

188 Machine Learning - Advanced Techniques and Emerging Applications

parent\_of(superconcept2, subconcept2))

contentconstraint = true;

datatype\_property(superconcept1,rel(int)) ➔

target\_class(subconcept));

target\_class(subconcept2));

**Input: PROO {Ontology}**

for each node in Ontology

target\_class(nodei

contentconstraint = false;

if(object\_property(nodei

contentconstraint = true;

));

write (object\_property(nodei

{

{

**Output: machine interpretable rule {A**➔**B}**

}}

contentconstraint = true;

```
write(object_property(nodei
                             ,nodej
                                    )^datatype_property(nodej
                                                                ,rel(int)) 
➔ target_class(nodej
                      ) );
```

```
write(object_property(nodei
                            ,nodej
                                  )^datatype_property(nodei
                                                              ,rel(int)) 
➔ target_class(nodei
                     ) ); }}
```