@Override public Set<OntologyAxiomPair> parseValuePartitionFrame() { String section = consumeToken(); if (!VALUE_PARTITION.matches(section)) { throw new ExceptionBuilder().withKeyword(VALUE_PARTITION).build(); } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); String clsName = consumeToken(); if (eof(clsName)) { throw new ExceptionBuilder().withObject().build(); } OWLClass cls = getOWLClass(clsName); Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLOntology> onts = getOntologies(); axioms.addAll(parseValuePartitionValues(onts, cls)); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, df.getOWLFunctionalObjectPropertyAxiom(prop))); axioms.add(new OntologyAxiomPair(ont, df.getOWLObjectPropertyRangeAxiom(prop, cls))); } return axioms; }
private OWLObjectProperty getOWLObjectProperty(String name) { OWLObjectProperty prop = checker.getOWLObjectProperty(name); if (prop == null && objectPropertyNames.contains(name)) { prop = df.getOWLObjectProperty(getIRI(name)); } if (prop == null) { throw new ExceptionBuilder().withObject().build(); } return prop; }
private OWLObjectProperty getOWLObjectProperty(String name) { OWLObjectProperty prop = checker.getOWLObjectProperty(name); if (prop == null && objectPropertyNames.contains(name)) { prop = df.getOWLObjectProperty(getIRI(name)); } if (prop == null) { throw new ExceptionBuilder().withObject().build(); } return prop; }
@Override public Set<OntologyAxiomPair> parseValuePartitionFrame() { String section = consumeToken(); if (!VALUE_PARTITION.matches(section)) { throw new ExceptionBuilder().withKeyword(VALUE_PARTITION).build(); } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); String clsName = consumeToken(); if (eof(clsName)) { throw new ExceptionBuilder().withObject().build(); } OWLClass cls = getOWLClass(clsName); Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLOntology> onts = getOntologies(); axioms.addAll(parseValuePartitionValues(onts, cls)); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, df.getOWLFunctionalObjectPropertyAxiom(prop))); axioms.add(new OntologyAxiomPair(ont, df.getOWLObjectPropertyRangeAxiom(prop, cls))); } return axioms; }
@Override public Set<OntologyAxiomPair> parseValuePartitionFrame() { String section = consumeToken(); if (!VALUE_PARTITION.matches(section)) { throw new ExceptionBuilder().withKeyword(VALUE_PARTITION).build(); } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); String clsName = consumeToken(); if (eof(clsName)) { throw new ExceptionBuilder().withObject().build(); } OWLClass cls = getOWLClass(clsName); Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLOntology> onts = getOntologies(); axioms.addAll(parseValuePartitionValues(onts, cls)); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, df.getOWLFunctionalObjectPropertyAxiom(prop))); axioms.add(new OntologyAxiomPair(ont, df.getOWLObjectPropertyRangeAxiom(prop, cls))); } return axioms; }
@Override public Set<OntologyAxiomPair> parseValuePartitionFrame() { String section = consumeToken(); if (!VALUE_PARTITION.matches(section)) { throw new ExceptionBuilder().withKeyword(VALUE_PARTITION).build(); } OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false); String clsName = consumeToken(); if (eof(clsName)) { throw new ExceptionBuilder().withObject().build(); } OWLClass cls = getOWLClass(clsName); Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLOntology> onts = getOntologies(); axioms.addAll(parseValuePartitionValues(onts, cls)); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, df.getOWLFunctionalObjectPropertyAxiom(prop))); axioms.add(new OntologyAxiomPair(ont, df.getOWLObjectPropertyRangeAxiom(prop, cls))); } return axioms; }
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(); } }
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 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 OWLObjectProperty getOWLObjectProperty(String name) { OWLObjectProperty prop = checker.getOWLObjectProperty(name); if (prop == null && objectPropertyNames.contains(name)) { prop = df.getOWLObjectProperty(getIRI(name)); } if (prop == null) { throw new ExceptionBuilder().withObject().build(); } return prop; }
private OWLObjectProperty getOWLObjectProperty(String name) { OWLObjectProperty prop = checker.getOWLObjectProperty(name); if (prop == null && objectPropertyNames.contains(name)) { prop = df.getOWLObjectProperty(getIRI(name)); } if (prop == null) { throw new ExceptionBuilder().withObject().build(); } return prop; }
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); }