if( p != null && p instanceof OWLObjectPropertyExpression )
axiom = factory
.getOWLIrreflexiveObjectPropertyAxiom( (OWLObjectPropertyExpression) p );
}
else if( term.getAFun().equals( ATermUtils.TYPEFUN ) ) {
OWLIndividual i = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
.getArgument( 0 ) );
OWLDescription c = (OWLDescription) conceptConverter.convert( (ATermAppl) term
.getArgument( 1 ) );
if( i != null && c != null )
axiom = factory.getOWLClassAssertionAxiom( i, c );
}
else if( term.getAFun().equals( ATermUtils.PROPFUN ) ) {
OWLIndividual subj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term.getArgument( 1 ) );
if( subj == null )
axiom = null;
else if( ATermUtils.isLiteral( (ATermAppl) term.getArgument( 2 ) ) ) {
OWLDataProperty pred = (OWLDataProperty) conceptConverter.convert( (ATermAppl) term
.getArgument( 0 ) );
OWLConstant obj = (OWLConstant) conceptConverter.convert( (ATermAppl) term
.getArgument( 2 ) );
if( pred != null && obj != null )
axiom = factory.getOWLDataPropertyAssertionAxiom( subj, pred, obj );
}
else {
OWLObjectProperty pred = (OWLObjectProperty) conceptConverter
.convert( (ATermAppl) term.getArgument( 0 ) );
OWLIndividual obj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term.getArgument( 2 ) );
if( pred != null && obj != null )
axiom = factory.getOWLObjectPropertyAssertionAxiom( subj, pred, obj );
}
}
else if( term.getAFun().equals( ATermUtils.NOTFUN )
&& ((ATermAppl) term.getArgument( 0 )).getAFun().equals( ATermUtils.PROPFUN ) ) {
term = (ATermAppl) term.getArgument( 0 );
OWLIndividual subj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
.getArgument( 1 ) );
if( subj == null )
axiom = null;
else if( ATermUtils.isLiteral( (ATermAppl) term.getArgument( 2 ) ) ) {
OWLDataProperty pred = (OWLDataProperty) conceptConverter.convert( (ATermAppl) term
.getArgument( 0 ) );
OWLConstant obj = (OWLConstant) conceptConverter.convert( (ATermAppl) term
.getArgument( 2 ) );
if( pred != null && obj != null )
axiom = factory.getOWLNegativeDataPropertyAssertionAxiom( subj, pred, obj );
}
else {
OWLObjectProperty pred = (OWLObjectProperty) conceptConverter
.convert( (ATermAppl) term.getArgument( 0 ) );
OWLIndividual obj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
.getArgument( 2 ) );;
if( pred != null && obj != null )
axiom = factory.getOWLNegativeObjectPropertyAssertionAxiom( subj, pred, obj );
}
}
else if( term.getAFun().equals( ATermUtils.SAMEASFUN ) ) {
OWLIndividual ind1 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
.getArgument( 0 ) );;
OWLIndividual ind2 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
.getArgument( 1 ) );;
Set<OWLIndividual> inds = new HashSet<OWLIndividual>();
inds.add( ind1 );
inds.add( ind2 );
if( ind1 != null && ind2 != null )
axiom = factory.getOWLSameIndividualsAxiom( inds );
}
else if( term.getAFun().equals( ATermUtils.DIFFERENTFUN ) ) {
OWLIndividual ind1 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
.getArgument( 0 ) );;
OWLIndividual ind2 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
.getArgument( 1 ) );;
Set<OWLIndividual> inds = new HashSet<OWLIndividual>();
inds.add( ind1 );
inds.add( ind2 );
if( ind1 != null && ind2 != null )
axiom = factory.getOWLDifferentIndividualsAxiom( inds );
}
else if( term.getAFun().equals( ATermUtils.ALLDIFFERENTFUN ) ) {
Set<OWLIndividual> individuals = new HashSet<OWLIndividual>();
ATermList list = (ATermList) term.getArgument( 0 );
for( ; !list.isEmpty(); list = list.getNext() ) {
ATermAppl ind = (ATermAppl) list.getFirst();
OWLIndividual i = (OWLIndividual) conceptConverter.convert( ind );;
if( i == null )
break;
individuals.add( i );
}