Package org.mindswap.pellet.exceptions

Examples of org.mindswap.pellet.exceptions.InternalReasonerException


      };

      Arrays.sort( disjunctions, comparator );
    }
    else
      throw new InternalReasonerException( "Unknown disjunction sorting option "
          + PelletOptions.USE_DISJUNCTION_SORTING );
  }
View Full Code Here


          try {
            canonical = strategy.getABox().getDatatypeReasoner().getCanonicalRepresentation( input );
          } catch( InvalidLiteralException e ) {
            final String msg = "Invalid literal encountered in nominal when attempting to apply some values rule: "
                + e.getMessage();
            throw new InternalReasonerException( msg, e );
          } catch( UnrecognizedDatatypeException e ) {
            final String msg = "Unrecognized datatype for literal encountered in nominal when attempting to apply some values rule: "
                + e.getMessage();
            throw new InternalReasonerException( msg, e );
          }
        }
        literal = strategy.getABox().addLiteral( canonical );
      }
            else {
                if( !role.isFunctional() || literal == null ) {
                    literal = strategy.getABox().addLiteral( ds );
                }
                else {
                  ds = ds.union( role.getExplainFunctional(), strategy.getABox().doExplanation()  );
                  ds = ds.union( edge.getDepends(), strategy.getABox().doExplanation()  );
                }
                strategy.addType( literal, c, ds );
            }
           
            if( log.isLoggable( Level.FINE ) )
                log.fine( "SOME: " + x + " -> " + s + " -> " + literal + " : " + ATermUtils.toString( c ) + " - " + ds );
           
            strategy. addEdge( x, role, literal, ds );
        }
        // If it is an object property
        else {
            if( ATermUtils.isNominal( c ) && !PelletOptions.USE_PSEUDO_NOMINALS ) {
                strategy.getABox().copyOnWrite();

                ATermAppl value = (ATermAppl) c.getArgument( 0 );
                y = strategy.getABox().getIndividual( value );

                if( log.isLoggable( Level.FINE ) )
                    log.fine( "VAL : " + x + " -> " + ATermUtils.toString( s ) + " -> " + y + " - " + ds );

                if( y == null ) {
                    if( ATermUtils.isAnonNominal( value ) ) {
                        y = strategy.getABox().addIndividual( value, ds );
                    }
                    else if( ATermUtils.isLiteral( value ) )
                        throw new InternalReasonerException( "Object Property " + role
                            + " is used with a hasValue restriction "
                            + "where the value is a literal: " + ATermUtils.toString( value ) );
                    else
                        throw new InternalReasonerException( "Nominal " + c
                            + " is not found in the KB!" );
                }

                if( y.isMerged() ) {
                    ds = ds.union( y.getMergeDependency( true ), strategy.getABox().doExplanation() );
View Full Code Here

          }
          strategy.getABox().setClash( Clash.invalidLiteral( ind, ds ) );
        }
        else {
          log.severe( msg );
          throw new InternalReasonerException( msg, e );
        }
      } catch( DatatypeReasonerException e ) {
        final String msg = "Unexpected datatype reasoner exception: " + e.getMessage();
        log.severe( msg );
        throw new InternalReasonerException( msg, e );
      }
    }
  }
View Full Code Here

    if( z == null ) {
      if( ATermUtils.isAnonNominal( nominal ) ) {
        z = strategy.getABox().addIndividual( nominal, ds );
      }
      else
        throw new InternalReasonerException( "Nominal " + nominal + " not found in KB!" );
    }

    // Get the value of mergedTo because of the following possibility:
    // Suppose there are three individuals like this
    // [x,{}],[y,{value(x)}],[z,{value(y)}]
View Full Code Here

      Node ind = kb.getABox().getNode( merge.getInd() );
      Node mergedToInd = kb.getABox().getNode( merge.getmergedIntoInd() );
 
      // check that they are actually the same - else throw error
      if( !ind.isSame( mergedToInd ) )
        throw new InternalReasonerException( " Restore merge error: " + ind
            + " not same as " + mergedToInd );
 
      if( !ind.isPruned() )
        throw new InternalReasonerException( " Restore merge error: " + ind + " not pruned" );
 
      // unprune to prune branch
      ind.unprune( ind.getPruned().getBranch() );
 
      // undo set same
View Full Code Here

     */
    public void applyAllValues( Individual x, ATermAppl av, DependencySet ds ) {
        // Timer timer = kb.timers.startTimer("applyAllValues");

        if( av.getArity() == 0 )
            throw new InternalReasonerException();
        ATerm p = av.getArgument( 0 );
        ATermAppl c = (ATermAppl) av.getArgument( 1 );       
       
        ATermList roleChain = ATermUtils.EMPTY_LIST;
        Role s = null;
View Full Code Here

            strategy.getABox().setClash( Clash.minMax( x, ds ) );
            return;
          }
        } catch( DatatypeReasonerException e ) {
          // TODO Better Error Handling
          throw new InternalReasonerException( e );
        }
      }
    }
  }
View Full Code Here

    case OWL2_AllDisjointProperties:
      naryDisjoints.put( s, builtinTerm );
      break;

    default:
      throw new InternalReasonerException( "Unexpected term: " + o );
    }
  }
View Full Code Here

      defineIndividual( st );
      kb.addPropertyValue( node2term(p), st, ot );
      break;
   
    default:
      throw new InternalReasonerException( "Unrecognized term: " + p );

    }
  }
View Full Code Here

    }
    else if( term.getArity() == 0 ) {
      return Node.createURI( term.getName() );
    }
    else {
      throw new InternalReasonerException( "Invalid term found " + term );
    }
  }
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.