Package org.mindswap.pellet.exceptions

Examples of org.mindswap.pellet.exceptions.InternalReasonerException


   
    public boolean removeInEdge(Edge edge) {
        boolean removed = inEdges.removeEdge(edge);
       
        if( !removed ){
         throw new InternalReasonerException("Trying to remove a non-existing edge " + edge);          
        }
       
        return true;
    }
View Full Code Here


    return restored;
  }
 
  public void addType(ATermAppl c, DependencySet ds) {
      if( isPruned() )
          throw new InternalReasonerException( "Adding type to a pruned node " + this + " " + c );
      else if( isMerged() )
          return;
     
      // add to effected list
      if( abox.getBranch() >= 0 && PelletOptions.TRACK_BRANCH_EFFECTS ) {
View Full Code Here

    this.abox = abox;
  }
 
  private void argCheck(Number[] args) {
    if ( args.length != 1 )
      throw new InternalReasonerException( "Wrong number of arguments to visitor." );
  }
View Full Code Here

    d.accept( visitor );

    ATermAppl a = visitor.result();

    if( a == null )
      throw new InternalReasonerException( "Cannot create ATerm from description " + d );
   
    return a;
  }
View Full Code Here

      // not more branches to try
      if( lastBranch <= 0 )
        return false;
      else if( lastBranch > abox.getBranches().size() )
        throw new InternalReasonerException( "Backtrack: Trying to backtrack to branch "
            + lastBranch + " but has only " + abox.getBranches().size()
            + " branches. Clash found: " + abox.getClash() );
      else if( PelletOptions.USE_INCREMENTAL_DELETION ) {
        // get the last branch
        Branch br = abox.getBranches().get( lastBranch - 1 );

        // if this is the last disjunction, merge pair, etc. for the
        // branch (i.e, br.tryNext == br.tryCount-1) and there are no
        // other branches to test (ie.
        // abox.getClash().depends.size()==2),
        // then update depedency index and return false
        if( (br.getTryNext() == br.getTryCount() - 1)
            && abox.getClash().getDepends().size() == 2 ) {
          abox.getKB().getDependencyIndex().addCloseBranchDependency( br,
              abox.getClash().getDepends() );
          return false;
        }
      }

      List<Branch> branches = abox.getBranches();
      abox.stats.backjumps += (branches.size() - lastBranch);
      // CHW - added for incremental deletion support
      if( PelletOptions.USE_TRACING && PelletOptions.USE_INCREMENTAL_CONSISTENCY ) {
        // we must clean up the KB dependecny index
        List<Branch> brList = branches.subList( lastBranch, branches.size() );
        for( Iterator<Branch> it = brList.iterator(); it.hasNext(); ) {
          // remove from the dependency index
          abox.getKB().getDependencyIndex().removeBranchDependencies( it.next() );
        }
        brList.clear();
      }
      else {
        // old approach
        branches.subList( lastBranch, branches.size() ).clear();
      }

      // get the branch to try
      Branch newBranch = branches.get( lastBranch - 1 );

      if( log.isLoggable( Level.FINE ) )
        log.fine( "JUMP: Branch " + lastBranch );

      if( lastBranch != newBranch.getBranch() )
        throw new InternalReasonerException( "Backtrack: Trying to backtrack to branch "
            + lastBranch + " but got " + newBranch.getBranch() );

      // set the last clash before restore
      if( newBranch.getTryNext() < newBranch.getTryCount() ) {
        newBranch.setLastClash( abox.getClash().getDepends() );
View Full Code Here

      }
      else if (y instanceof Individual && z instanceof Individual) {
        mergeIndividuals((Individual) y, (Individual) z, ds);
      }
      else {
        throw new InternalReasonerException("Invalid merge operation!");
      }
    }

    merging = false;
    mergeAll();
View Full Code Here

    d.accept( visitor );

    ATermAppl a = visitor.result();

    if( a == null )
      throw new InternalReasonerException( "Cannot create ATerm from description " + d );

    return a;
  }
View Full Code Here

        }
        else if(af.equals(ATermUtils.RESTRDATATYPEFUN)) {
          visitRestrictedDatatype(term);
        }
    else {
        throw new InternalReasonerException("Invalid term " + term);       
    }
  }
View Full Code Here

      return;
 
    TaxonomyNode<ATermAppl> cNode = definitionOrderTaxonomy.getNode( c );
    TaxonomyNode<ATermAppl> dNode = definitionOrderTaxonomy.getNode( d );
    if( cNode == null )
      throw new InternalReasonerException( c + " is not in the definition order" );
    else if( cNode.equals( definitionOrderTaxonomy.getTop() ) )
      definitionOrderTaxonomy.merge( cNode, dNode );
    else {
      definitionOrderTaxonomy.addSuper( c, d );
      definitionOrderTaxonomy.removeCycles( cNode );
View Full Code Here

        + " not in taxonomy";

    TaxonomyNode<T> subNode = nodes.get( sub );
    TaxonomyNode<T> supNode = nodes.get( sup );
    if( subNode.equals( supNode ) )
      throw new InternalReasonerException(
          "Equivalent elements cannot have sub/super relationship" );

    if( subNode.getSupers().size() == 1 && subNode.getSupers().iterator().next() == topNode )
      topNode.removeSub( subNode );
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.exceptions.InternalReasonerException

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.