Exemplo n.º 1
0
 /**
  * Checks whether adding p to this node would violate cardinality constraints
  *
  * @param p OntProperty
  * @return true if adding the property would violate a cardinality constraint
  */
 public boolean violatesCardinality(OntProperty p) {
   if (p.isInverseFunctionalProperty()) {
     if (node.getIncomingEdges(p.getLocalName()).size() > 0) return true;
   }
   OntProperty inverse = reader.getInverse(p);
   if (inverse == null)
     return false; // if the inverse property does not exist there are no cardinal constraints on
   // it...
   if (optional.contains(inverse) || compulsory.contains(inverse)) return false;
   if (addShowOrHideOption() == SGNode.INCOMPLETE) return false;
   return true;
 }