code: private NodeImpl getAndValidateParent(PropertyImpl property) throws Exception
     {
        NodeImpl parent = property.getParent();
  
        if (!parent.isNodeType("nt:resource"))
        {
           throw new Exception("Incoming node is not nt:resource type");
        }
  
        return parent;
     }
docs: Validates if parent node type is {@link Constants#NT_RESOURCE}.