private Set<OntologyAxiomPair> parseDisjointProperties() { String section = consumeToken(); if (!DISJOINT_PROPERTIES.matches(section)) { throw new ExceptionBuilder().withKeyword(DISJOINT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> props = parsePropertyList(); Set<OntologyAxiomPair> pairs = new HashSet<>(); OWLAxiom propertiesAxiom; if (props.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); props.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertiesAxiom = df.getOWLDisjointObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); props.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertiesAxiom = df.getOWLDisjointDataPropertiesAxiom(dpe, annotations); } for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertiesAxiom)); } return pairs; }
private Set<OntologyAxiomPair> parseNaryEquivalentProperties() { String tok = consumeToken(); if (!EQUIVALENT_PROPERTIES.matches(tok)) { throw new ExceptionBuilder().withKeyword(EQUIVALENT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> properties = parsePropertyList(); OWLAxiom propertyAxiom; if (properties.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); properties.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertyAxiom = df.getOWLEquivalentObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); properties.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertyAxiom = df.getOWLEquivalentDataPropertiesAxiom(dpe, annotations); } Set<OntologyAxiomPair> pairs = new HashSet<>(); for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertyAxiom)); } return pairs; }
private Set<OntologyAxiomPair> parseNaryEquivalentProperties() { String tok = consumeToken(); if (!EQUIVALENT_PROPERTIES.matches(tok)) { throw new ExceptionBuilder().withKeyword(EQUIVALENT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> properties = parsePropertyList(); OWLAxiom propertyAxiom; if (properties.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); properties.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertyAxiom = df.getOWLEquivalentObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); properties.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertyAxiom = df.getOWLEquivalentDataPropertiesAxiom(dpe, annotations); } Set<OntologyAxiomPair> pairs = new HashSet<>(); for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertyAxiom)); } return pairs; }
private Set<OntologyAxiomPair> parseDisjointProperties() { String section = consumeToken(); if (!DISJOINT_PROPERTIES.matches(section)) { throw new ExceptionBuilder().withKeyword(DISJOINT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> props = parsePropertyList(); Set<OntologyAxiomPair> pairs = new HashSet<>(); OWLAxiom propertiesAxiom; if (props.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); props.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertiesAxiom = df.getOWLDisjointObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); props.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertiesAxiom = df.getOWLDisjointDataPropertiesAxiom(dpe, annotations); } for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertiesAxiom)); } return pairs; }
private Set<OntologyAxiomPair> parseDisjointProperties() { String section = consumeToken(); if (!DISJOINT_PROPERTIES.matches(section)) { throw new ExceptionBuilder().withKeyword(DISJOINT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> props = parsePropertyList(); Set<OntologyAxiomPair> pairs = new HashSet<>(); OWLAxiom propertiesAxiom; if (props.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); props.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertiesAxiom = df.getOWLDisjointObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); props.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertiesAxiom = df.getOWLDisjointDataPropertiesAxiom(dpe, annotations); } for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertiesAxiom)); } return pairs; }
private Set<OntologyAxiomPair> parseNaryEquivalentProperties() { String tok = consumeToken(); if (!EQUIVALENT_PROPERTIES.matches(tok)) { throw new ExceptionBuilder().withKeyword(EQUIVALENT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> properties = parsePropertyList(); OWLAxiom propertyAxiom; if (properties.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); properties.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertyAxiom = df.getOWLEquivalentObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); properties.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertyAxiom = df.getOWLEquivalentDataPropertiesAxiom(dpe, annotations); } Set<OntologyAxiomPair> pairs = new HashSet<>(); for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertyAxiom)); } return pairs; }
private Set<OntologyAxiomPair> parseNaryEquivalentProperties() { String tok = consumeToken(); if (!EQUIVALENT_PROPERTIES.matches(tok)) { throw new ExceptionBuilder().withKeyword(EQUIVALENT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> properties = parsePropertyList(); OWLAxiom propertyAxiom; if (properties.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); properties.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertyAxiom = df.getOWLEquivalentObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); properties.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertyAxiom = df.getOWLEquivalentDataPropertiesAxiom(dpe, annotations); } Set<OntologyAxiomPair> pairs = new HashSet<>(); for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertyAxiom)); } return pairs; }
private Set<OntologyAxiomPair> parseDisjointProperties() { String section = consumeToken(); if (!DISJOINT_PROPERTIES.matches(section)) { throw new ExceptionBuilder().withKeyword(DISJOINT_PROPERTIES).build(); } Set<OWLOntology> ontologies = getOntologies(); Set<OWLAnnotation> annotations = parseAnnotations(); Set<OWLPropertyExpression> props = parsePropertyList(); Set<OntologyAxiomPair> pairs = new HashSet<>(); OWLAxiom propertiesAxiom; if (props.iterator().next().isObjectPropertyExpression()) { Set<OWLObjectPropertyExpression> ope = new HashSet<>(); props.forEach(pe -> ope.add(pe.asObjectPropertyExpression())); propertiesAxiom = df.getOWLDisjointObjectPropertiesAxiom(ope, annotations); } else { Set<OWLDataPropertyExpression> dpe = new HashSet<>(); props.forEach(pe -> dpe.add(pe.asDataPropertyExpression())); propertiesAxiom = df.getOWLDisjointDataPropertiesAxiom(dpe, annotations); } for (OWLOntology ont : ontologies) { pairs.add(new OntologyAxiomPair(ont, propertiesAxiom)); } return pairs; }
/** * Gets the classes which have been asserted to be disjoint with this class by axioms in the * specified ontology. * * @param e entity * @param ontology The ontology to search for disjoint class axioms * @return A {@code Set} of {@code OWLClassExpression}s that represent the disjoint classes of * this class. */ public static <P extends OWLPropertyExpression> Stream<P> getDisjointProperties(P e, OWLOntology ontology) { if (e.isObjectPropertyExpression()) { return Searcher .different(ontology.disjointObjectPropertiesAxioms(e.asObjectPropertyExpression())); } if (e.isDataPropertyExpression()) { return Searcher.different(ontology.disjointDataPropertiesAxioms((OWLDataProperty) e)); } // else e must have been an annotation property. No disjoints on those return empty(); }
/** * Gets the classes which have been asserted to be disjoint with this class by axioms in the * specified ontology. * * @param e entity * @param ontology The ontology to search for disjoint class axioms * @return A {@code Set} of {@code OWLClassExpression}s that represent the disjoint classes of * this class. */ public static <P extends OWLPropertyExpression> Stream<P> getDisjointProperties(P e, OWLOntology ontology) { if (e.isObjectPropertyExpression()) { return Searcher .different(ontology.disjointObjectPropertiesAxioms(e.asObjectPropertyExpression())); } if (e.isDataPropertyExpression()) { return Searcher.different(ontology.disjointDataPropertiesAxioms((OWLDataProperty) e)); } // else e must have been an annotation property. No disjoints on those return empty(); }
/** * Gets the classes which have been asserted to be disjoint with this class by axioms in the * specified ontology. * * @param e entity * @param ontology The ontology to search for disjoint class axioms * @return A {@code Set} of {@code OWLClassExpression}s that represent the disjoint classes of * this class. */ public static <P extends OWLPropertyExpression> Stream<P> getDisjointProperties(P e, OWLOntology ontology) { if (e.isObjectPropertyExpression()) { return Searcher .different(ontology.disjointObjectPropertiesAxioms(e.asObjectPropertyExpression())); } if (e.isDataPropertyExpression()) { return Searcher.different(ontology.disjointDataPropertiesAxioms((OWLDataProperty) e)); } // else e must have been an annotation property. No disjoints on those return empty(); }