Package org.mindswap.pellet

Examples of org.mindswap.pellet.NodeMerge


                    continue;
                }

                // 1. if x is a nominal node (of lower level), then Merge(y, x)
                if( x.getNominalLevel() < y.getNominalLevel() )
                    pairs.add( new NodeMerge( y, x ) );
                // 2. if y is a nominal node or an ancestor of x, then Merge(x, y)
                else if( y.isNominal() )
                    pairs.add( new NodeMerge( x, y ) );
                // 3. if y is an ancestor of x, then Merge(x, y)
                // Note: y is an ancestor of x iff the max cardinality
                // on node merges the "node"'s parent y with "node"'s
                // child x
                else if( y.hasSuccessor( node ) )
                    pairs.add( new NodeMerge( x, y ) );
                // 4. else Merge(y, x)
                else
                    pairs.add( new NodeMerge( y, x ) );
            }
        }

        return ds;
    }
View Full Code Here


    }

    node.addType(c, ds);
    if (node.isLiteral()) {
      final Literal l = (Literal) node;
      final NodeMerge mtc = l.getMergeToConstant();
      if (mtc != null) {
        l.clearMergeToConstant();
        Literal mergeTo = abox.getLiteral(mtc.getTarget());
        mergeTo(l, mergeTo, mtc.getDepends());
        node = mergeTo;
      }
    }

    // update dependency index for this node
View Full Code Here

      }
    }
  }

  private void mergeLater(Node y, Node z, DependencySet ds) {
    mergeList.add(new NodeMerge(y, z, ds));
  }
View Full Code Here

      return;
    }

    mergingAll = true;
    while (!merging && !mergeList.isEmpty() && !abox.isClosed()) {
      NodeMerge merge = mergeList.remove(0);

      Node y = abox.getNode(merge.getSource());
      Node z = abox.getNode(merge.getTarget());
      DependencySet ds = merge.getDepends();

      if (y.isMerged()) {
        ds = ds.union(y.getMergeDependency(true), abox.doExplanation());
        y = y.getSame();
      }
View Full Code Here

    DependencySet ds = getTermDepends();     
    for(; getTryNext() < getTryCount(); tryNext++) {   
      this.abox.getKB().timers.mainTimer.check();
      if(PelletOptions.USE_SEMANTIC_BRANCHING) {
        for(int m = 0; m < getTryNext(); m++) {
          NodeMerge nm = mergePairs.get(m);     
          Node y = abox.getNode(nm.getSource()).getSame();
          Node z = abox.getNode(nm.getTarget()).getSame();
          strategy.setDifferent(y, z, prevDS[m]);
          //strategy.addType( y, ATermUtils.makeNot( ATermUtils.makeValue( z.getName() ) ), prevDS[m] );
        }
      }
     
      NodeMerge nm = mergePairs.get(getTryNext());     
      Node y = abox.getNode(nm.getSource()).getSame();
      Node z = abox.getNode(nm.getTarget()).getSame();
           
      if( log.isLoggable( Level.FINE ) )
                log.fine(
            "MAX : (" + (getTryNext()+1) + "/" + mergePairs.size() +
            ") at branch (" + getBranch() + ") to  " + ind +
View Full Code Here

  public void shiftTryNext(int openIndex){
    //save vals
//    DependencySet preDS = prevDS[openIndex];

    //re-open the merge pair
    NodeMerge nm = mergePairs.remove(openIndex);
    mergePairs.add(nm);   

    //shift the previous ds
    for(int i = openIndex; i < mergePairs.size(); i++){
      prevDS[i] = prevDS[i+1];
View Full Code Here

    }

    node.addType(c, ds);
    if (node.isLiteral()) {
      final Literal l = (Literal) node;
      final NodeMerge mtc = l.getMergeToConstant();
      if (mtc != null) {
        l.clearMergeToConstant();
        Literal mergeTo = abox.getLiteral(mtc.getTarget());
        mergeTo(l, mergeTo, mtc.getDepends());
        node = mergeTo;
      }
    }

    // update dependency index for this node
View Full Code Here

      }
    }
  }

  private void mergeLater(Node y, Node z, DependencySet ds) {
    mergeList.add(new NodeMerge(y, z, ds));
  }
View Full Code Here

      return;
    }

    mergingAll = true;
    while (!merging && !mergeList.isEmpty() && !abox.isClosed()) {
      NodeMerge merge = mergeList.remove(0);

      Node y = abox.getNode(merge.getSource());
      Node z = abox.getNode(merge.getTarget());
      DependencySet ds = merge.getDepends();

      if (y.isMerged()) {
        ds = ds.union(y.getMergeDependency(true), abox.doExplanation());
        y = y.getSame();
      }
View Full Code Here

    DependencySet ds = getTermDepends();     
    for(; getTryNext() < getTryCount(); tryNext++) {   
      this.abox.getKB().timers.mainTimer.check();
      if(PelletOptions.USE_SEMANTIC_BRANCHING) {
        for(int m = 0; m < getTryNext(); m++) {
          NodeMerge nm = mergePairs.get(m);     
          Node y = abox.getNode(nm.getSource()).getSame();
          Node z = abox.getNode(nm.getTarget()).getSame();
          y.setDifferent( z, prevDS[m]);
          //strategy.addType( y, ATermUtils.makeNot( ATermUtils.makeValue( z.getName() ) ), prevDS[m] );
        }
      }
     
      NodeMerge nm = mergePairs.get(getTryNext());     
      Node y = abox.getNode(nm.getSource()).getSame();
      Node z = abox.getNode(nm.getTarget()).getSame();
           
      if( log.isLoggable( Level.FINE ) )
                log.fine(
            "MAX : (" + (getTryNext()+1) + "/" + mergePairs.size() +
            ") at branch (" + getBranch() + ") to  " + ind +
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.NodeMerge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.