private SWRLLiteralArgument parseLiteralObject() { OWLLiteral lit = parseLiteral(null); return df.getSWRLLiteralArgument(lit); }
private SWRLLiteralArgument parseLiteralObject() { OWLLiteral lit = parseLiteral(null); return df.getSWRLLiteralArgument(lit); }
private SWRLLiteralArgument parseLiteralObject() { OWLLiteral lit = parseLiteral(null); return df.getSWRLLiteralArgument(lit); }
private SWRLLiteralArgument parseLiteralObject() { OWLLiteral lit = parseLiteral(null); return df.getSWRLLiteralArgument(lit); }
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 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 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 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); }
protected OWLAnnotation parseAnnotation() { OWLAnnotationProperty annoProp = parseAnnotationProperty(); String obj = peekToken(); if (isIndividualName(obj) || isClassName(obj) || isObjectPropertyName(obj) || isDataPropertyName(obj)) { consumeToken(); OWLAnnotationValue value; if (obj.startsWith("_:")) { value = anonProvider.getOWLAnonymousIndividual(obj); } else { value = getIRI(obj); } return df.getOWLAnnotation(annoProp, value); } if (obj.startsWith("<")) { IRI value = parseIRI(); return df.getOWLAnnotation(annoProp, value); } OWLLiteral con = parseLiteral(null); return df.getOWLAnnotation(annoProp, con); }
protected OWLAnnotation parseAnnotation() { OWLAnnotationProperty annoProp = parseAnnotationProperty(); String obj = peekToken(); if (isIndividualName(obj) || isClassName(obj) || isObjectPropertyName(obj) || isDataPropertyName(obj)) { consumeToken(); OWLAnnotationValue value; if (obj.startsWith("_:")) { value = anonProvider.getOWLAnonymousIndividual(obj); } else { value = getIRI(obj); } return df.getOWLAnnotation(annoProp, value); } if (obj.startsWith("<")) { IRI value = parseIRI(); return df.getOWLAnnotation(annoProp, value); } OWLLiteral con = parseLiteral(null); return df.getOWLAnnotation(annoProp, con); }
protected OWLAnnotation parseAnnotation() { OWLAnnotationProperty annoProp = parseAnnotationProperty(); String obj = peekToken(); if (isIndividualName(obj) || isClassName(obj) || isObjectPropertyName(obj) || isDataPropertyName(obj)) { consumeToken(); OWLAnnotationValue value; if (obj.startsWith("_:")) { value = anonProvider.getOWLAnonymousIndividual(obj); } else { value = getIRI(obj); } return df.getOWLAnnotation(annoProp, value); } if (obj.startsWith("<")) { IRI value = parseIRI(); return df.getOWLAnnotation(annoProp, value); } OWLLiteral con = parseLiteral(null); return df.getOWLAnnotation(annoProp, con); }
protected OWLAnnotation parseAnnotation() { OWLAnnotationProperty annoProp = parseAnnotationProperty(); String obj = peekToken(); if (isIndividualName(obj) || isClassName(obj) || isObjectPropertyName(obj) || isDataPropertyName(obj)) { consumeToken(); OWLAnnotationValue value; if (obj.startsWith("_:")) { value = anonProvider.getOWLAnonymousIndividual(obj); } else { value = getIRI(obj); } return df.getOWLAnnotation(annoProp, value); } if (obj.startsWith("<")) { IRI value = parseIRI(); return df.getOWLAnnotation(annoProp, value); } OWLLiteral con = parseLiteral(null); return df.getOWLAnnotation(annoProp, con); }
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(); } }
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(); }
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(); }