if( type instanceof OWLClassExpression ) {
SWRLIArgument io = parseToAtomIObject( i );
atom = factory.getSWRLClassAtom( (OWLClassExpression) type, io );
}
else if( type instanceof OWLDataRange ) {
SWRLDArgument io = parseToAtomDObject( i );
atom = factory.getSWRLDataRangeAtom( (OWLDataRange) type, io );
}
else {
throw new InternalReasonerException( "Cannot convert to SWRL atom: "
+ ATermUtils.toString( term ) );
}
}
else if( term.getAFun().equals( ATermUtils.PROPFUN ) ) {
ATermAppl p = (ATermAppl) term.getArgument( 0 );
ATermAppl i1 = (ATermAppl) term.getArgument( 1 );
ATermAppl i2 = (ATermAppl) term.getArgument( 2 );
SWRLIArgument io1 = parseToAtomIObject( i1 );
if( kb.isObjectProperty( p ) ) {
SWRLIArgument io2 = parseToAtomIObject( i2 );
OWLObjectProperty op = factory.getOWLObjectProperty( IRI.create( p.getName() ) );
atom = factory.getSWRLObjectPropertyAtom( op, io1, io2 );
}
else if( kb.isDatatypeProperty( p ) ) {
SWRLDArgument do2 = parseToAtomDObject( i2 );
OWLDataProperty dp = factory.getOWLDataProperty( IRI.create( p.getName() ) );
atom = factory.getSWRLDataPropertyAtom( dp, io1, do2 );
}
}
else if( term.getAFun().equals( ATermUtils.SAMEASFUN ) ) {