/** * Write annotations. * * @param subject the subject * @return written axioms */ public Collection<OWLAnnotationAssertionAxiom> writeAnnotations(OWLAnnotationSubject subject) { Collection<OWLAnnotationAssertionAxiom> axioms = sortedCollection(); if (!isFiltered(AxiomType.ANNOTATION_ASSERTION)) { SectionMap<Object, OWLAxiom> sectionMap = new SectionMap<>(); filtersort(o.annotationAssertionAxioms(subject)).forEach(ax -> { axioms.add(ax); sectionMap.put(ax.getAnnotation(), ax); }); writeSection(ANNOTATIONS, sectionMap, ",", true); } return axioms; }
/** * Write annotations. * * @param subject the subject * @return written axioms */ public Collection<OWLAnnotationAssertionAxiom> writeAnnotations(OWLAnnotationSubject subject) { Collection<OWLAnnotationAssertionAxiom> axioms = sortedCollection(); if (!isFiltered(AxiomType.ANNOTATION_ASSERTION)) { SectionMap<Object, OWLAxiom> sectionMap = new SectionMap<>(); filtersort(o.annotationAssertionAxioms(subject)).forEach(ax -> { axioms.add(ax); sectionMap.put(ax.getAnnotation(), ax); }); writeSection(ANNOTATIONS, sectionMap, ",", true); } return axioms; }
/** * Write annotations. * * @param subject the subject * @return written axioms */ public Collection<OWLAnnotationAssertionAxiom> writeAnnotations(OWLAnnotationSubject subject) { Collection<OWLAnnotationAssertionAxiom> axioms = sortedCollection(); if (!isFiltered(AxiomType.ANNOTATION_ASSERTION)) { SectionMap<Object, OWLAxiom> sectionMap = new SectionMap<>(); filtersort(o.annotationAssertionAxioms(subject)).forEach(ax -> { axioms.add(ax); sectionMap.put(ax.getAnnotation(), ax); }); writeSection(ANNOTATIONS, sectionMap, ",", true); } return axioms; }
/** * Write annotations. * * @param subject the subject * @return written axioms */ public Collection<OWLAnnotationAssertionAxiom> writeAnnotations(OWLAnnotationSubject subject) { Collection<OWLAnnotationAssertionAxiom> axioms = sortedCollection(); if (!isFiltered(AxiomType.ANNOTATION_ASSERTION)) { SectionMap<Object, OWLAxiom> sectionMap = new SectionMap<>(); filtersort(o.annotationAssertionAxioms(subject)).forEach(ax -> { axioms.add(ax); sectionMap.put(ax.getAnnotation(), ax); }); writeSection(ANNOTATIONS, sectionMap, ",", true); } return axioms; }
if (!isFiltered(AxiomType.CLASS_ASSERTION)) { SectionMap<Object, OWLAxiom> expressions = new SectionMap<>(); filtersort(o.classAssertionAxioms(individual)).forEach(ax -> { expressions.put(ax.getClassExpression(), ax); axioms.add(ax); filtersort(o.sameIndividualAxioms(individual)).forEach(ax -> { add(inds, ax.individuals()); axioms.add(ax); Collection<OWLIndividual> inds = sortedCollection(); Collection<OWLDifferentIndividualsAxiom> nary = sortedCollection(); filtersort(o.differentIndividualAxioms(individual)).forEach(ax -> { if (ax.individuals().count() == 2) { add(inds, ax.individuals());
if (!isFiltered(AxiomType.CLASS_ASSERTION)) { SectionMap<Object, OWLAxiom> expressions = new SectionMap<>(); filtersort(o.classAssertionAxioms(individual)).forEach(ax -> { expressions.put(ax.getClassExpression(), ax); axioms.add(ax); filtersort(o.sameIndividualAxioms(individual)).forEach(ax -> { add(inds, ax.individuals()); axioms.add(ax); Collection<OWLIndividual> inds = sortedCollection(); Collection<OWLDifferentIndividualsAxiom> nary = sortedCollection(); filtersort(o.differentIndividualAxioms(individual)).forEach(ax -> { if (ax.individuals().count() == 2) { add(inds, ax.individuals());
if (!isFiltered(AxiomType.CLASS_ASSERTION)) { SectionMap<Object, OWLAxiom> expressions = new SectionMap<>(); filtersort(o.classAssertionAxioms(individual)).forEach(ax -> { expressions.put(ax.getClassExpression(), ax); axioms.add(ax); filtersort(o.sameIndividualAxioms(individual)).forEach(ax -> { add(inds, ax.individuals()); axioms.add(ax); Collection<OWLIndividual> inds = sortedCollection(); Collection<OWLDifferentIndividualsAxiom> nary = sortedCollection(); filtersort(o.differentIndividualAxioms(individual)).forEach(ax -> { if (ax.individuals().count() == 2) { add(inds, ax.individuals());
if (!isFiltered(AxiomType.CLASS_ASSERTION)) { SectionMap<Object, OWLAxiom> expressions = new SectionMap<>(); filtersort(o.classAssertionAxioms(individual)).forEach(ax -> { expressions.put(ax.getClassExpression(), ax); axioms.add(ax); filtersort(o.sameIndividualAxioms(individual)).forEach(ax -> { add(inds, ax.individuals()); axioms.add(ax); Collection<OWLIndividual> inds = sortedCollection(); Collection<OWLDifferentIndividualsAxiom> nary = sortedCollection(); filtersort(o.differentIndividualAxioms(individual)).forEach(ax -> { if (ax.individuals().count() == 2) { add(inds, ax.individuals());
if (!isFiltered(AxiomType.FUNCTIONAL_DATA_PROPERTY)) { SectionMap<Object, OWLAxiom> characteristics = new SectionMap<>(); filtersort(o.functionalDataPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.dataPropertyDomainAxioms(property)).forEach(ax -> { domains.put(ax.getDomain(), ax); axioms.add(ax); filtersort(o.dataPropertyRangeAxioms(property)).forEach(ax -> { ranges.put(ax.getRange(), ax); axioms.add(ax); filtersort(o.dataSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { supers.put(ax.getSuperProperty(), ax); axioms.add(ax); filtersort(o.equivalentDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SWRL_RULE)).forEach(rule -> { for (SWRLAtom atom : asList(rule.head())) { if (atom.getPredicate().equals(property)) {
if (!isFiltered(AxiomType.FUNCTIONAL_DATA_PROPERTY)) { SectionMap<Object, OWLAxiom> characteristics = new SectionMap<>(); filtersort(o.functionalDataPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.dataPropertyDomainAxioms(property)).forEach(ax -> { domains.put(ax.getDomain(), ax); axioms.add(ax); filtersort(o.dataPropertyRangeAxioms(property)).forEach(ax -> { ranges.put(ax.getRange(), ax); axioms.add(ax); filtersort(o.dataSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { supers.put(ax.getSuperProperty(), ax); axioms.add(ax); filtersort(o.equivalentDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SWRL_RULE)).forEach(rule -> { for (SWRLAtom atom : asList(rule.head())) { if (atom.getPredicate().equals(property)) {
if (!isFiltered(AxiomType.FUNCTIONAL_DATA_PROPERTY)) { SectionMap<Object, OWLAxiom> characteristics = new SectionMap<>(); filtersort(o.functionalDataPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.dataPropertyDomainAxioms(property)).forEach(ax -> { domains.put(ax.getDomain(), ax); axioms.add(ax); filtersort(o.dataPropertyRangeAxioms(property)).forEach(ax -> { ranges.put(ax.getRange(), ax); axioms.add(ax); filtersort(o.dataSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { supers.put(ax.getSuperProperty(), ax); axioms.add(ax); filtersort(o.equivalentDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SWRL_RULE)).forEach(rule -> { for (SWRLAtom atom : asList(rule.head())) { if (atom.getPredicate().equals(property)) {
if (!isFiltered(AxiomType.EQUIVALENT_CLASSES)) { SectionMap<Object, OWLAxiom> equivalentClasses = new SectionMap<>(); filtersort(o.equivalentClassesAxioms(cls), ax -> ((OWLEquivalentClassesAxiom) ax).classExpressions() .count() == 2).forEach(ax -> { filtersort(o.subClassAxiomsForSubClass(cls)).forEach(ax -> { superclasses.put(ax.getSuperClass(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> subClasses = new SectionMap<>(); filtersort(o.subClassAxiomsForSuperClass(cls)).forEach(ax -> { subClasses.put(ax.getSubClass(), ax); axioms.add(ax); filtersort(o.disjointUnionAxioms(cls)).forEach(ax -> { axioms.add(ax); writeSection(DISJOINT_UNION_OF, ax.classExpressions().iterator(), ", ", false); filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() == 2) { OWLClassExpression disjointWith = ax.getClassExpressionsMinus(cls).iterator() filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() > 2) { axioms.add(ax); filtersort(o.hasKeyAxioms(cls)).forEach(ax -> {
if (!isFiltered(AxiomType.SUB_OBJECT_PROPERTY)) { SectionMap<Object, OWLAxiom> properties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { properties.put(ax.getSuperProperty(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> extproperties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSuperProperty(property)).forEach(ax -> { extproperties.put(ax.getSubProperty(), ax); axioms.add(ax); filtersort(o.equivalentObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SUB_PROPERTY_CHAIN_OF), ax -> ((OWLSubPropertyChainOfAxiom) ax) .getSuperProperty().equals(property)).forEach(ax -> { filtersort(o.functionalObjectPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.inverseFunctionalObjectPropertyAxioms(property)).forEach(ax -> {
if (!isFiltered(AxiomType.FUNCTIONAL_DATA_PROPERTY)) { SectionMap<Object, OWLAxiom> characteristics = new SectionMap<>(); filtersort(o.functionalDataPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.dataPropertyDomainAxioms(property)).forEach(ax -> { domains.put(ax.getDomain(), ax); axioms.add(ax); filtersort(o.dataPropertyRangeAxioms(property)).forEach(ax -> { ranges.put(ax.getRange(), ax); axioms.add(ax); filtersort(o.dataSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { supers.put(ax.getSuperProperty(), ax); axioms.add(ax); filtersort(o.equivalentDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointDataPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SWRL_RULE)).forEach(rule -> { for (SWRLAtom atom : asList(rule.head())) { if (atom.getPredicate().equals(property)) {
if (!isFiltered(AxiomType.EQUIVALENT_CLASSES)) { SectionMap<Object, OWLAxiom> equivalentClasses = new SectionMap<>(); filtersort(o.equivalentClassesAxioms(cls), ax -> ((OWLEquivalentClassesAxiom) ax).classExpressions() .count() == 2).forEach(ax -> { filtersort(o.subClassAxiomsForSubClass(cls)).forEach(ax -> { superclasses.put(ax.getSuperClass(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> subClasses = new SectionMap<>(); filtersort(o.subClassAxiomsForSuperClass(cls)).forEach(ax -> { subClasses.put(ax.getSubClass(), ax); axioms.add(ax); filtersort(o.disjointUnionAxioms(cls)).forEach(ax -> { axioms.add(ax); writeSection(DISJOINT_UNION_OF, ax.classExpressions().iterator(), ", ", false); filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() == 2) { OWLClassExpression disjointWith = ax.getClassExpressionsMinus(cls).iterator() filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() > 2) { axioms.add(ax); filtersort(o.hasKeyAxioms(cls)).forEach(ax -> {
if (!isFiltered(AxiomType.EQUIVALENT_CLASSES)) { SectionMap<Object, OWLAxiom> equivalentClasses = new SectionMap<>(); filtersort(o.equivalentClassesAxioms(cls), ax -> ((OWLEquivalentClassesAxiom) ax).classExpressions() .count() == 2).forEach(ax -> { filtersort(o.subClassAxiomsForSubClass(cls)).forEach(ax -> { superclasses.put(ax.getSuperClass(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> subClasses = new SectionMap<>(); filtersort(o.subClassAxiomsForSuperClass(cls)).forEach(ax -> { subClasses.put(ax.getSubClass(), ax); axioms.add(ax); filtersort(o.disjointUnionAxioms(cls)).forEach(ax -> { axioms.add(ax); writeSection(DISJOINT_UNION_OF, ax.classExpressions().iterator(), ", ", false); filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() == 2) { OWLClassExpression disjointWith = ax.getClassExpressionsMinus(cls).iterator() filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() > 2) { axioms.add(ax); filtersort(o.hasKeyAxioms(cls)).forEach(ax -> {
if (!isFiltered(AxiomType.EQUIVALENT_CLASSES)) { SectionMap<Object, OWLAxiom> equivalentClasses = new SectionMap<>(); filtersort(o.equivalentClassesAxioms(cls), ax -> ((OWLEquivalentClassesAxiom) ax).classExpressions() .count() == 2).forEach(ax -> { filtersort(o.subClassAxiomsForSubClass(cls)).forEach(ax -> { superclasses.put(ax.getSuperClass(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> subClasses = new SectionMap<>(); filtersort(o.subClassAxiomsForSuperClass(cls)).forEach(ax -> { subClasses.put(ax.getSubClass(), ax); axioms.add(ax); filtersort(o.disjointUnionAxioms(cls)).forEach(ax -> { axioms.add(ax); writeSection(DISJOINT_UNION_OF, ax.classExpressions().iterator(), ", ", false); filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() == 2) { OWLClassExpression disjointWith = ax.getClassExpressionsMinus(cls).iterator() filtersort(o.disjointClassesAxioms(cls)).forEach(ax -> { if (ax.classExpressions().count() > 2) { axioms.add(ax); filtersort(o.hasKeyAxioms(cls)).forEach(ax -> {
if (!isFiltered(AxiomType.SUB_OBJECT_PROPERTY)) { SectionMap<Object, OWLAxiom> properties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { properties.put(ax.getSuperProperty(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> extproperties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSuperProperty(property)).forEach(ax -> { extproperties.put(ax.getSubProperty(), ax); axioms.add(ax); filtersort(o.equivalentObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SUB_PROPERTY_CHAIN_OF), ax -> ((OWLSubPropertyChainOfAxiom) ax) .getSuperProperty().equals(property)).forEach(ax -> { filtersort(o.functionalObjectPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.inverseFunctionalObjectPropertyAxioms(property)).forEach(ax -> {
if (!isFiltered(AxiomType.SUB_OBJECT_PROPERTY)) { SectionMap<Object, OWLAxiom> properties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { properties.put(ax.getSuperProperty(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> extproperties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSuperProperty(property)).forEach(ax -> { extproperties.put(ax.getSubProperty(), ax); axioms.add(ax); filtersort(o.equivalentObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SUB_PROPERTY_CHAIN_OF), ax -> ((OWLSubPropertyChainOfAxiom) ax) .getSuperProperty().equals(property)).forEach(ax -> { filtersort(o.functionalObjectPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.inverseFunctionalObjectPropertyAxioms(property)).forEach(ax -> {
if (!isFiltered(AxiomType.SUB_OBJECT_PROPERTY)) { SectionMap<Object, OWLAxiom> properties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSubProperty(property)).forEach(ax -> { properties.put(ax.getSuperProperty(), ax); axioms.add(ax); if (renderExtensions) { SectionMap<Object, OWLAxiom> extproperties = new SectionMap<>(); filtersort(o.objectSubPropertyAxiomsForSuperProperty(property)).forEach(ax -> { extproperties.put(ax.getSubProperty(), ax); axioms.add(ax); filtersort(o.equivalentObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.disjointObjectPropertiesAxioms(property), props).forEach(ax -> { properties.put(ax.getPropertiesMinus(property).iterator().next(), ax); axioms.add(ax); filtersort(o.axioms(AxiomType.SUB_PROPERTY_CHAIN_OF), ax -> ((OWLSubPropertyChainOfAxiom) ax) .getSuperProperty().equals(property)).forEach(ax -> { filtersort(o.functionalObjectPropertyAxioms(property)).forEach(ax -> { characteristics.put(FUNCTIONAL.toString(), ax); axioms.add(ax); filtersort(o.inverseFunctionalObjectPropertyAxioms(property)).forEach(ax -> {