code: public int getPathLengthInNodes(Category node1, Category node2) throws WikiApiException {
  
          int retValue = getPathLengthInEdges(node1, node2);
  
          if (retValue == 0) {
              return 0;
          }
          else if (retValue > 0) {
              return (--retValue);
          }
          else if (retValue == -1) {
              return -1;
          }
          else {
              throw new WikiApiException("Unknown return value.");
          }
      }
docs: Gets the path length between two category nodes - measured in "nodes".
  @param node1 The first node.
  @param node2 The second node.
  @return The number of nodes of the path between node1 and node2. 0, if the nodes are identical or neighbors. -1, if no path exists.