List<SWRLDArgument> args = listTranslator.translateList(mainIRI);
return dataFactory.getSWRLBuiltInAtom(builtInIRI, args);
}
else if (consumer.isSWRLClassAtom(firstObject)) {
// C(?x) or C(ind)
SWRLIArgument iObject = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
IRI classIRI = consumer.getResourceObject(firstObject, CLASS_PREDICATE.getIRI(), true);
OWLClassExpression desc = consumer.translateClassExpression(classIRI);
return dataFactory.getSWRLClassAtom(desc, iObject);
}
else if (consumer.isSWRLDataRangeAtom(firstObject)) {
// DR(?x) or DR(val)
SWRLDArgument dObject = translateSWRLAtomDObject(firstObject, ARGUMENT_1.getIRI());
IRI dataRangeIRI = consumer.getResourceObject(firstObject, DATA_RANGE.getIRI(), true);
OWLDataRange dataRange = consumer.translateDataRange(dataRangeIRI);
return dataFactory.getSWRLDataRangeAtom(dataRange, dObject);
}
else if (consumer.isSWRLDataValuedPropertyAtom(firstObject)) {
SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
SWRLDArgument arg2 = translateSWRLAtomDObject(firstObject, ARGUMENT_2.getIRI());
IRI dataPropertyIRI = consumer.getResourceObject(firstObject, PROPERTY_PREDICATE.getIRI(), true);
OWLDataPropertyExpression prop = consumer.translateDataPropertyExpression(dataPropertyIRI);
return dataFactory.getSWRLDataPropertyAtom(prop, arg1, arg2);
}
else if (consumer.isSWRLIndividualPropertyAtom(firstObject)) {
SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject, ARGUMENT_2.getIRI());
IRI objectPropertyIRI = consumer.getResourceObject(firstObject, PROPERTY_PREDICATE.getIRI(), true);
OWLObjectPropertyExpression prop = consumer.translateObjectPropertyExpression(objectPropertyIRI);
return dataFactory.getSWRLObjectPropertyAtom(prop, arg1, arg2);
}
else if (consumer.isSWRLSameAsAtom(firstObject)) {
SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject, ARGUMENT_2.getIRI());
return dataFactory.getSWRLSameIndividualAtom(arg1, arg2);
}
else if (consumer.isSWRLDifferentFromAtom(firstObject)) {
SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject, ARGUMENT_2.getIRI());
return dataFactory.getSWRLDifferentIndividualsAtom(arg1, arg2);
}
throw new RuntimeException("Don't know how to translate SWRL Atom: " + firstObject);
}