}
}
@Nonnull
private OWLAxiom parseAxiomWithObjectPropertyStart() {
OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false);
String kw = consumeToken();
if (SOME.matches(kw)) {
OWLClassExpression filler = parseUnion();
return parseClassAxiomRemainder(dataFactory
.getOWLObjectSomeValuesFrom(prop, filler));
} else if (ONLY.matches(kw)) {
OWLClassExpression filler = parseUnion();
return parseClassAxiomRemainder(dataFactory
.getOWLObjectAllValuesFrom(prop, filler));
} else if (MIN.matches(kw)) {
int cardi = parseInteger();
OWLClassExpression filler = parseUnion();
return parseClassAxiomRemainder(dataFactory
.getOWLObjectMinCardinality(cardi, prop, filler));
} else if (MAX.matches(kw)) {
int cardi = parseInteger();
OWLClassExpression filler = parseUnion();
return parseClassAxiomRemainder(dataFactory
.getOWLObjectMaxCardinality(cardi, prop, filler));
} else if (EXACTLY.matches(kw)) {
int cardi = parseInteger();
OWLClassExpression filler = parseUnion();
return parseClassAxiomRemainder(dataFactory
.getOWLObjectExactCardinality(cardi, prop, filler));
} else if (SUB_PROPERTY_OF.matches(kw)) {
OWLObjectPropertyExpression superProperty = parseObjectPropertyExpression(false);
return dataFactory.getOWLSubObjectPropertyOfAxiom(prop,
superProperty);
} else if (EQUIVALENT_TO.matches(kw)) {
OWLObjectPropertyExpression equivProp = parseObjectPropertyExpression(false);
return dataFactory.getOWLEquivalentObjectPropertiesAxiom(prop,
equivProp);
} else if (INVERSE_OF.matches(kw)) {
OWLObjectPropertyExpression invProp = parseObjectPropertyExpression(false);
return dataFactory
.getOWLInverseObjectPropertiesAxiom(prop, invProp);
} else if (DISJOINT_WITH.matches(kw)) {
OWLObjectPropertyExpression disjProp = parseObjectPropertyExpression(false);
return dataFactory.getOWLDisjointObjectPropertiesAxiom(prop,
disjProp);
} else if (DOMAIN.matches(kw)) {
OWLClassExpression domain = parseClassExpression();
return dataFactory.getOWLObjectPropertyDomainAxiom(prop, domain);
} else if (RANGE.matches(kw)) {
OWLClassExpression range = parseClassExpression();
return dataFactory.getOWLObjectPropertyRangeAxiom(prop, range);
} else if (CHAIN_CONNECT.matches(kw)) {
String sep = kw;
List<OWLObjectPropertyExpression> chain = new ArrayList<>();
chain.add(prop);
while (sep.equals("o")) {
OWLObjectPropertyExpression chainProp = parseObjectPropertyExpression(false);
chain.add(chainProp);
sep = consumeToken();
}
if (!SUB_PROPERTY_OF.matches(sep)) {
throw new ExceptionBuilder().withKeyword(SUB_PROPERTY_OF)
.build();
}
OWLObjectPropertyExpression superProp = parseObjectPropertyExpression(false);
return dataFactory.getOWLSubPropertyChainOfAxiom(chain, superProp);
} else {
throw new ExceptionBuilder().withKeyword(SOME, ONLY, MIN, MAX,
EXACTLY, SUB_PROPERTY_OF, EQUIVALENT_TO, INVERSE_OF,
DISJOINT_WITH, DOMAIN, RANGE, CHAIN_CONNECT).build();