@Override public Set<OWLDataProperty> parseDataPropertyList() { Set<OWLDataProperty> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parseDataProperty()); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
@Override public Set<OWLDataProperty> parseDataPropertyList() { Set<OWLDataProperty> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parseDataProperty()); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
@Override public Set<OWLDataProperty> parseDataPropertyList() { Set<OWLDataProperty> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parseDataProperty()); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
@Override public Set<OWLDataProperty> parseDataPropertyList() { Set<OWLDataProperty> props = new HashSet<>(); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { props.add(parseDataProperty()); sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } return props; }
private void initialiseDataPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubDataPropertyOfAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLClassExpression>(x -> parseUnion(), DOMAIN, (s, o, anns) -> df.getOWLDataPropertyDomainAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataRange>(x -> parseDataRange(), RANGE, (s, o, anns) -> df.getOWLDataPropertyRangeAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyCharacteristicAxiom>(this::parseDataPropertyCharacteristic, CHARACTERISTICS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), dataPropertyFrameSections); //@formatter:on }
private void initialiseDataPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubDataPropertyOfAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLClassExpression>(x -> parseUnion(), DOMAIN, (s, o, anns) -> df.getOWLDataPropertyDomainAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataRange>(x -> parseDataRange(), RANGE, (s, o, anns) -> df.getOWLDataPropertyRangeAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyCharacteristicAxiom>(this::parseDataPropertyCharacteristic, CHARACTERISTICS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), dataPropertyFrameSections); //@formatter:on }
private void initialiseDataPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubDataPropertyOfAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLClassExpression>(x -> parseUnion(), DOMAIN, (s, o, anns) -> df.getOWLDataPropertyDomainAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataRange>(x -> parseDataRange(), RANGE, (s, o, anns) -> df.getOWLDataPropertyRangeAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyCharacteristicAxiom>(this::parseDataPropertyCharacteristic, CHARACTERISTICS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), dataPropertyFrameSections); //@formatter:on }
private void initialiseDataPropertyFrameSections() { //@formatter:off initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubDataPropertyOfAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyExpression>(x -> parseDataProperty(), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointDataPropertiesAxiom(s,o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLClassExpression>(x -> parseUnion(), DOMAIN, (s, o, anns) -> df.getOWLDataPropertyDomainAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataRange>(x -> parseDataRange(), RANGE, (s, o, anns) -> df.getOWLDataPropertyRangeAxiom(s, o, anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLDataPropertyCharacteristicAxiom>(this::parseDataPropertyCharacteristic, CHARACTERISTICS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), dataPropertyFrameSections); initialiseSection(new AnnAxiom<OWLDataProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), o, anns)), dataPropertyFrameSections); //@formatter:on }
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(); } }
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(); } }
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(); } }
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(); } }
private OWLAxiom parseFunctionPropertyAxiom() { String kw = consumeToken(); if (!FUNCTIONAL.matches(kw)) { throw new ExceptionBuilder().withKeyword(FUNCTIONAL).build(); } String name = peekToken(); if (isObjectPropertyName(name)) { return df.getOWLFunctionalObjectPropertyAxiom(parseObjectPropertyExpression(false)); } else if (isDataPropertyName(name)) { return df.getOWLFunctionalDataPropertyAxiom(parseDataProperty()); } else { consumeToken(); throw new ExceptionBuilder().withObject().withData().build(); } }
private OWLAxiom parseFunctionPropertyAxiom() { String kw = consumeToken(); if (!FUNCTIONAL.matches(kw)) { throw new ExceptionBuilder().withKeyword(FUNCTIONAL).build(); } String name = peekToken(); if (isObjectPropertyName(name)) { return df.getOWLFunctionalObjectPropertyAxiom(parseObjectPropertyExpression(false)); } else if (isDataPropertyName(name)) { return df.getOWLFunctionalDataPropertyAxiom(parseDataProperty()); } else { consumeToken(); throw new ExceptionBuilder().withObject().withData().build(); } }
private OWLAxiom parseFunctionPropertyAxiom() { String kw = consumeToken(); if (!FUNCTIONAL.matches(kw)) { throw new ExceptionBuilder().withKeyword(FUNCTIONAL).build(); } String name = peekToken(); if (isObjectPropertyName(name)) { return df.getOWLFunctionalObjectPropertyAxiom(parseObjectPropertyExpression(false)); } else if (isDataPropertyName(name)) { return df.getOWLFunctionalDataPropertyAxiom(parseDataProperty()); } else { consumeToken(); throw new ExceptionBuilder().withObject().withData().build(); } }
private OWLAxiom parseFunctionPropertyAxiom() { String kw = consumeToken(); if (!FUNCTIONAL.matches(kw)) { throw new ExceptionBuilder().withKeyword(FUNCTIONAL).build(); } String name = peekToken(); if (isObjectPropertyName(name)) { return df.getOWLFunctionalObjectPropertyAxiom(parseObjectPropertyExpression(false)); } else if (isDataPropertyName(name)) { return df.getOWLFunctionalDataPropertyAxiom(parseDataProperty()); } else { consumeToken(); throw new ExceptionBuilder().withObject().withData().build(); } }
protected OWLAxiom parseFact(OWLIndividual ind) { boolean negative = false; if (NOT.matches(peekToken())) { consumeToken(); negative = true; } String prop = peekToken(); if (isDataPropertyName(prop)) { OWLDataProperty p = parseDataProperty(); OWLLiteral con = parseLiteral(null); if (!negative) { return df.getOWLDataPropertyAssertionAxiom(p, ind, con); } else { return df.getOWLNegativeDataPropertyAssertionAxiom(p, ind, con); } } else if (isObjectPropertyName(prop) || INVERSE.matches(prop)) { OWLObjectPropertyExpression p = parseObjectPropertyExpression(false); if (!negative) { return df.getOWLObjectPropertyAssertionAxiom(p, ind, parseIndividual()); } else { return df.getOWLNegativeObjectPropertyAssertionAxiom(p, ind, parseIndividual()); } } else { consumeToken(); throw new ExceptionBuilder().withObject().withData().build(); } }
protected OWLAxiom parseFact(OWLIndividual ind) { boolean negative = false; if (NOT.matches(peekToken())) { consumeToken(); negative = true; } String prop = peekToken(); if (isDataPropertyName(prop)) { OWLDataProperty p = parseDataProperty(); OWLLiteral con = parseLiteral(null); if (!negative) { return df.getOWLDataPropertyAssertionAxiom(p, ind, con); } else { return df.getOWLNegativeDataPropertyAssertionAxiom(p, ind, con); } } else if (isObjectPropertyName(prop) || INVERSE.matches(prop)) { OWLObjectPropertyExpression p = parseObjectPropertyExpression(false); if (!negative) { return df.getOWLObjectPropertyAssertionAxiom(p, ind, parseIndividual()); } else { return df.getOWLNegativeObjectPropertyAssertionAxiom(p, ind, parseIndividual()); } } else { consumeToken(); throw new ExceptionBuilder().withObject().withData().build(); } }
private OWLClassExpression parseDataRestriction() { OWLDataPropertyExpression prop = parseDataProperty(); String kw = consumeToken(); if (SOME.matches(kw)) { OWLDataRange rng = parseDataIntersectionOf(false); return df.getOWLDataSomeValuesFrom(prop, rng); } else if (ONLY.matches(kw)) { OWLDataRange rng = parseDataIntersectionOf(false); return df.getOWLDataAllValuesFrom(prop, rng); } else if (VALUE.matches(kw)) { OWLLiteral con = parseLiteral(null); return df.getOWLDataHasValue(prop, con); } else if (MIN.matches(kw)) { int card = parseInteger(); OWLDataRange rng = parseDataIntersectionOf(true); return df.getOWLDataMinCardinality(card, prop, rng); } else if (EXACTLY.matches(kw)) { int card = parseInteger(); OWLDataRange rng = parseDataIntersectionOf(true); return df.getOWLDataExactCardinality(card, prop, rng); } else if (MAX.matches(kw)) { int card = parseInteger(); OWLDataRange rng = parseDataIntersectionOf(true); return df.getOWLDataMaxCardinality(card, prop, rng); } throw new ExceptionBuilder().withKeyword(SOME, ONLY, VALUE, MIN, EXACTLY, MAX).build(); }
private OWLClassExpression parseDataRestriction() { OWLDataPropertyExpression prop = parseDataProperty(); String kw = consumeToken(); if (SOME.matches(kw)) { OWLDataRange rng = parseDataIntersectionOf(false); return df.getOWLDataSomeValuesFrom(prop, rng); } else if (ONLY.matches(kw)) { OWLDataRange rng = parseDataIntersectionOf(false); return df.getOWLDataAllValuesFrom(prop, rng); } else if (VALUE.matches(kw)) { OWLLiteral con = parseLiteral(null); return df.getOWLDataHasValue(prop, con); } else if (MIN.matches(kw)) { int card = parseInteger(); OWLDataRange rng = parseDataIntersectionOf(true); return df.getOWLDataMinCardinality(card, prop, rng); } else if (EXACTLY.matches(kw)) { int card = parseInteger(); OWLDataRange rng = parseDataIntersectionOf(true); return df.getOWLDataExactCardinality(card, prop, rng); } else if (MAX.matches(kw)) { int card = parseInteger(); OWLDataRange rng = parseDataIntersectionOf(true); return df.getOWLDataMaxCardinality(card, prop, rng); } throw new ExceptionBuilder().withKeyword(SOME, ONLY, VALUE, MIN, EXACTLY, MAX).build(); }