private Set<OntologyAxiomPair> parseObjectPropertyFrame(boolean eof) { Set<OntologyAxiomPair> axioms = new HashSet<>(); consumeToken(OBJECT_PROPERTY); String token = consumeToken(); OWLObjectProperty prop = getOWLObjectProperty(token); if (!prop.isAnonymous()) { axioms.add(new OntologyAxiomPair(defaultOntology, df.getOWLDeclarationAxiom(prop.asOWLObjectProperty()))); } parseFrameSections(eof, axioms, prop, objectPropertyFrameSections); return axioms; }
private Set<OntologyAxiomPair> parseObjectPropertyFrame(boolean eof) { Set<OntologyAxiomPair> axioms = new HashSet<>(); consumeToken(OBJECT_PROPERTY); String token = consumeToken(); OWLObjectProperty prop = getOWLObjectProperty(token); if (!prop.isAnonymous()) { axioms.add(new OntologyAxiomPair(defaultOntology, df.getOWLDeclarationAxiom(prop.asOWLObjectProperty()))); } parseFrameSections(eof, axioms, prop, objectPropertyFrameSections); return axioms; }
private Set<OntologyAxiomPair> parseObjectPropertyFrame(boolean eof) { Set<OntologyAxiomPair> axioms = new HashSet<>(); consumeToken(OBJECT_PROPERTY); String token = consumeToken(); OWLObjectProperty prop = getOWLObjectProperty(token); if (!prop.isAnonymous()) { axioms.add(new OntologyAxiomPair(defaultOntology, df.getOWLDeclarationAxiom(prop.asOWLObjectProperty()))); } parseFrameSections(eof, axioms, prop, objectPropertyFrameSections); return axioms; }
private Set<OntologyAxiomPair> parseObjectPropertyFrame(boolean eof) { Set<OntologyAxiomPair> axioms = new HashSet<>(); consumeToken(OBJECT_PROPERTY); String token = consumeToken(); OWLObjectProperty prop = getOWLObjectProperty(token); if (!prop.isAnonymous()) { axioms.add(new OntologyAxiomPair(defaultOntology, df.getOWLDeclarationAxiom(prop.asOWLObjectProperty()))); } parseFrameSections(eof, axioms, prop, objectPropertyFrameSections); return axioms; }
private SWRLAtom parseObjectPropertyAtom() { String predicate = consumeToken(); if (!isObjectPropertyName(predicate)) { throw new ExceptionBuilder().withObject().build(); } consumeToken(OPEN.keyword()); SWRLIArgument obj1 = parseIObject(); consumeToken(COMMA.keyword()); SWRLIArgument obj2 = parseIObject(); consumeToken(CLOSE.keyword()); return df.getSWRLObjectPropertyAtom(getOWLObjectProperty(predicate), obj1, obj2); }
private SWRLAtom parseObjectPropertyAtom() { String predicate = consumeToken(); if (!isObjectPropertyName(predicate)) { throw new ExceptionBuilder().withObject().build(); } consumeToken(OPEN.keyword()); SWRLIArgument obj1 = parseIObject(); consumeToken(COMMA.keyword()); SWRLIArgument obj2 = parseIObject(); consumeToken(CLOSE.keyword()); return df.getSWRLObjectPropertyAtom(getOWLObjectProperty(predicate), obj1, obj2); }
private SWRLAtom parseObjectPropertyAtom() { String predicate = consumeToken(); if (!isObjectPropertyName(predicate)) { throw new ExceptionBuilder().withObject().build(); } consumeToken(OPEN.keyword()); SWRLIArgument obj1 = parseIObject(); consumeToken(COMMA.keyword()); SWRLIArgument obj2 = parseIObject(); consumeToken(CLOSE.keyword()); return df.getSWRLObjectPropertyAtom(getOWLObjectProperty(predicate), obj1, obj2); }
private SWRLAtom parseObjectPropertyAtom() { String predicate = consumeToken(); if (!isObjectPropertyName(predicate)) { throw new ExceptionBuilder().withObject().build(); } consumeToken(OPEN.keyword()); SWRLIArgument obj1 = parseIObject(); consumeToken(COMMA.keyword()); SWRLIArgument obj2 = parseIObject(); consumeToken(CLOSE.keyword()); return df.getSWRLObjectPropertyAtom(getOWLObjectProperty(predicate), obj1, obj2); }
protected OWLObjectPropertyExpression parseObjectPropertyExpression(boolean allowUndeclared) { String tok = consumeToken(); if (INVERSE.matches(tok)) { String open = peekToken(); boolean brackets = false; if (OPEN.matches(open)) { consumeToken(); brackets = true; } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); if (prop.isAnonymous()) { throw new ExceptionBuilder().withKeyword( "Inverse construct uses nested object property expression, but object property only is allowed") .build(); } if (brackets) { String close = consumeToken(); if (!CLOSE.matches(close)) { throw new ExceptionBuilder().withKeyword(CLOSE).build(); } } return df.getOWLObjectInverseOf(prop.asOWLObjectProperty()); } else { if (!allowUndeclared && !isObjectPropertyName(tok)) { throw new ExceptionBuilder().withObject().build(); } return getOWLObjectProperty(tok); } }
protected OWLObjectPropertyExpression parseObjectPropertyExpression(boolean allowUndeclared) { String tok = consumeToken(); if (INVERSE.matches(tok)) { String open = peekToken(); boolean brackets = false; if (OPEN.matches(open)) { consumeToken(); brackets = true; } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); if (prop.isAnonymous()) { throw new ExceptionBuilder().withKeyword( "Inverse construct uses nested object property expression, but object property only is allowed") .build(); } if (brackets) { String close = consumeToken(); if (!CLOSE.matches(close)) { throw new ExceptionBuilder().withKeyword(CLOSE).build(); } } return df.getOWLObjectInverseOf(prop.asOWLObjectProperty()); } else { if (!allowUndeclared && !isObjectPropertyName(tok)) { throw new ExceptionBuilder().withObject().build(); } return getOWLObjectProperty(tok); } }
protected OWLObjectPropertyExpression parseObjectPropertyExpression(boolean allowUndeclared) { String tok = consumeToken(); if (INVERSE.matches(tok)) { String open = peekToken(); boolean brackets = false; if (OPEN.matches(open)) { consumeToken(); brackets = true; } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); if (prop.isAnonymous()) { throw new ExceptionBuilder().withKeyword( "Inverse construct uses nested object property expression, but object property only is allowed") .build(); } if (brackets) { String close = consumeToken(); if (!CLOSE.matches(close)) { throw new ExceptionBuilder().withKeyword(CLOSE).build(); } } return df.getOWLObjectInverseOf(prop.asOWLObjectProperty()); } else { if (!allowUndeclared && !isObjectPropertyName(tok)) { throw new ExceptionBuilder().withObject().build(); } return getOWLObjectProperty(tok); } }
protected OWLObjectPropertyExpression parseObjectPropertyExpression(boolean allowUndeclared) { String tok = consumeToken(); if (INVERSE.matches(tok)) { String open = peekToken(); boolean brackets = false; if (OPEN.matches(open)) { consumeToken(); brackets = true; } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); if (prop.isAnonymous()) { throw new ExceptionBuilder().withKeyword( "Inverse construct uses nested object property expression, but object property only is allowed") .build(); } if (brackets) { String close = consumeToken(); if (!CLOSE.matches(close)) { throw new ExceptionBuilder().withKeyword(CLOSE).build(); } } return df.getOWLObjectInverseOf(prop.asOWLObjectProperty()); } else { if (!allowUndeclared && !isObjectPropertyName(tok)) { throw new ExceptionBuilder().withObject().build(); } return getOWLObjectProperty(tok); } }