private SWRLAtom parseToSWRLAtom(ATermAppl term) {
SWRLAtom atom = null;
if( term.getAFun().equals( ATermUtils.TYPEFUN ) ) {
ATermAppl i = (ATermAppl) term.getArgument( 0 );
SWRLAtomIObject io = parseToAtomIObject( i );
OWLDescription c = (OWLDescription) conceptConverter.convert( (ATermAppl) term
.getArgument( 1 ) );
atom = factory.getSWRLClassAtom( c, io );
}
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 );
SWRLAtomIObject io1 = parseToAtomIObject( i1 );
if( kb.isObjectProperty( p ) ) {
SWRLAtomIObject io2 = parseToAtomIObject( i2 );
OWLObjectProperty op = factory.getOWLObjectProperty( URI.create( p.getName() ) );
atom = factory.getSWRLObjectPropertyAtom( op, io1, io2 );
}
else if( kb.isDatatypeProperty( p ) ) {
SWRLAtomDObject do2 = parseToAtomDObject( i2 );
OWLDataProperty dp = factory.getOWLDataProperty( URI.create( p.getName() ) );
atom = factory.getSWRLDataValuedPropertyAtom( dp, io1, do2 );
}
}
else if( term.getAFun().equals( ATermUtils.SAMEASFUN ) ) {
ATermAppl i1 = (ATermAppl) term.getArgument( 0 );
ATermAppl i2 = (ATermAppl) term.getArgument( 1 );
SWRLAtomIObject io1 = parseToAtomIObject( i1 );
SWRLAtomIObject io2 = parseToAtomIObject( i2 );
atom = factory.getSWRLSameAsAtom( io1, io2 );
}
else if( term.getAFun().equals( ATermUtils.DIFFERENTFUN ) ) {
ATermAppl i1 = (ATermAppl) term.getArgument( 0 );
ATermAppl i2 = (ATermAppl) term.getArgument( 1 );
SWRLAtomIObject io1 = parseToAtomIObject( i1 );
SWRLAtomIObject io2 = parseToAtomIObject( i2 );
atom = factory.getSWRLDifferentFromAtom( io1, io2 );
}
else if( term.getAFun().equals( ATermUtils.BUILTINFUN ) ) {
ATermList args = (ATermList) term.getArgument( 0 );