private Set<OntologyAxiomPair> parseValuePartitionValues(Set<OWLOntology> onts, OWLClass superclass) { Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLClass> siblings = new HashSet<>(); consumeToken(OPENBRACKET.keyword()); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { String clsName = consumeToken(); OWLClass cls = getOWLClass(clsName); siblings.add(cls); OWLSubClassOfAxiom ax = df.getOWLSubClassOfAxiom(cls, superclass); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } if (peekToken().equals(OPENBRACKET.keyword())) { axioms.addAll(parseValuePartitionValues(onts, cls)); } sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } consumeToken(CLOSEBRACKET.keyword()); OWLAxiom ax = df.getOWLDisjointClassesAxiom(siblings); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } return axioms; }
private Set<OntologyAxiomPair> parseValuePartitionValues(Set<OWLOntology> onts, OWLClass superclass) { Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLClass> siblings = new HashSet<>(); consumeToken(OPENBRACKET.keyword()); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { String clsName = consumeToken(); OWLClass cls = getOWLClass(clsName); siblings.add(cls); OWLSubClassOfAxiom ax = df.getOWLSubClassOfAxiom(cls, superclass); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } if (peekToken().equals(OPENBRACKET.keyword())) { axioms.addAll(parseValuePartitionValues(onts, cls)); } sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } consumeToken(CLOSEBRACKET.keyword()); OWLAxiom ax = df.getOWLDisjointClassesAxiom(siblings); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } return axioms; }
private Set<OntologyAxiomPair> parseValuePartitionValues(Set<OWLOntology> onts, OWLClass superclass) { Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLClass> siblings = new HashSet<>(); consumeToken(OPENBRACKET.keyword()); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { String clsName = consumeToken(); OWLClass cls = getOWLClass(clsName); siblings.add(cls); OWLSubClassOfAxiom ax = df.getOWLSubClassOfAxiom(cls, superclass); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } if (peekToken().equals(OPENBRACKET.keyword())) { axioms.addAll(parseValuePartitionValues(onts, cls)); } sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } consumeToken(CLOSEBRACKET.keyword()); OWLAxiom ax = df.getOWLDisjointClassesAxiom(siblings); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } return axioms; }
private Set<OntologyAxiomPair> parseValuePartitionValues(Set<OWLOntology> onts, OWLClass superclass) { Set<OntologyAxiomPair> axioms = new HashSet<>(); Set<OWLClass> siblings = new HashSet<>(); consumeToken(OPENBRACKET.keyword()); String sep = COMMA.keyword(); while (COMMA.matches(sep)) { String clsName = consumeToken(); OWLClass cls = getOWLClass(clsName); siblings.add(cls); OWLSubClassOfAxiom ax = df.getOWLSubClassOfAxiom(cls, superclass); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } if (peekToken().equals(OPENBRACKET.keyword())) { axioms.addAll(parseValuePartitionValues(onts, cls)); } sep = peekToken(); if (COMMA.matches(sep)) { consumeToken(); } } consumeToken(CLOSEBRACKET.keyword()); OWLAxiom ax = df.getOWLDisjointClassesAxiom(siblings); for (OWLOntology ont : onts) { axioms.add(new OntologyAxiomPair(ont, ax)); } 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; }
@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; }