private Set<OWLAnnotation> parseAnnotations() { String next = peekToken(); Set<OWLAnnotation> annotations = Collections.emptySet(); if (ANNOTATIONS.matches(next)) { consumeToken(); annotations = parseAnnotationList(); } return annotations; }
@Override public Set<OWLAnnotationProperty> parseAnnotationPropertyList() { Set<OWLAnnotationProperty> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parseAnnotationProperty()); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
private OWLDataRange parseDataOneOf() { consumeToken(); Set<OWLLiteral> cons = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { OWLLiteral con = parseLiteral(null); cons.add(con); sep = consumeToken(); } if (!CLOSEBRACE.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACE).build(); } return df.getOWLDataOneOf(cons); }
private void consumeToken(ManchesterOWLSyntax expected) { String tok = consumeToken(); if (!expected.matches(tok)) { throw new ExceptionBuilder().withKeyword(expected).build(); } }
private OWLDataRange parseDataOneOf() { consumeToken(); Set<OWLLiteral> cons = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { OWLLiteral con = parseLiteral(null); cons.add(con); sep = consumeToken(); } if (!CLOSEBRACE.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACE).build(); } return df.getOWLDataOneOf(cons); }
@Override public Set<OWLIndividual> parseIndividualList() { Set<OWLIndividual> inds = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { inds.add(parseIndividual()); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return inds; }
private void consumeToken(ManchesterOWLSyntax expected) { String tok = consumeToken(); if (!expected.matches(tok)) { throw new ExceptionBuilder().withKeyword(expected).build(); } }
private Set<OWLAnnotation> parseAnnotations() { String next = peekToken(); Set<OWLAnnotation> annotations = Collections.emptySet(); if (ANNOTATIONS.matches(next)) { consumeToken(); annotations = parseAnnotationList(); } return annotations; }
private OWLDataRange parseDataOneOf() { consumeToken(); Set<OWLLiteral> cons = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { OWLLiteral con = parseLiteral(null); cons.add(con); sep = consumeToken(); } if (!CLOSEBRACE.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACE).build(); } return df.getOWLDataOneOf(cons); }
@Override public Set<OWLPropertyExpression> parsePropertyList() { Set<OWLPropertyExpression> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parsePropertyExpression()); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
private void consumeToken(ManchesterOWLSyntax expected) { String tok = consumeToken(); if (!expected.matches(tok)) { throw new ExceptionBuilder().withKeyword(expected).build(); } }
private Set<OWLAnnotation> parseAnnotations() { String next = peekToken(); Set<OWLAnnotation> annotations = Collections.emptySet(); if (ANNOTATIONS.matches(next)) { consumeToken(); annotations = parseAnnotationList(); } return annotations; }
private OWLDataRange parseDataOneOf() { consumeToken(); Set<OWLLiteral> cons = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { OWLLiteral con = parseLiteral(null); cons.add(con); sep = consumeToken(); } if (!CLOSEBRACE.matches(sep)) { throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACE).build(); } return df.getOWLDataOneOf(cons); }
@Override public Set<OWLObjectPropertyExpression> parseObjectPropertyList() { Set<OWLObjectPropertyExpression> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parseObjectPropertyExpression(false)); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
private void consumeToken(ManchesterOWLSyntax expected) { String tok = consumeToken(); if (!expected.matches(tok)) { throw new ExceptionBuilder().withKeyword(expected).build(); } }
private Set<OWLAnnotation> parseAnnotations() { String next = peekToken(); Set<OWLAnnotation> annotations = Collections.emptySet(); if (ANNOTATIONS.matches(next)) { consumeToken(); annotations = parseAnnotationList(); } return annotations; }
private Set<OntologyAxiomPair> parseClassFrame(boolean eof) { String tok = consumeToken(); if (!CLASS.matches(tok)) { throw new ExceptionBuilder().withKeyword(CLASS).build(); } String subj = consumeToken(); OWLClass cls = getOWLClass(subj); Set<OntologyAxiomPair> axioms = new HashSet<>(); axioms.add(new OntologyAxiomPair(defaultOntology, df.getOWLDeclarationAxiom(cls))); parseFrameSections(eof, axioms, cls, classFrameSections); return axioms; }
@Override public Set<OWLObjectPropertyExpression> parseObjectPropertyList() { Set<OWLObjectPropertyExpression> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parseObjectPropertyExpression(false)); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
protected OWLDataPropertyCharacteristicAxiom parseDataPropertyCharacteristic( OWLDataPropertyExpression prop) { String characteristic = consumeToken(); if (FUNCTIONAL.matches(characteristic)) { return df.getOWLFunctionalDataPropertyAxiom(prop); } else { throw new ExceptionBuilder().withKeyword(FUNCTIONAL).build(); } }
private OWLPropertyExpression parsePropertyExpression() { String tok = peekToken(); if (isObjectPropertyName(tok)) { return parseObjectPropertyExpression(false); } else if (INVERSE.matches(tok)) { return parseObjectPropertyExpression(false); } else if (isDataPropertyName(tok)) { return parseDataProperty(); } else { consumeToken(); throw new ExceptionBuilder().withObject().withData().build(); } }