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() );