@Override protected Set<OWLObjectProperty> getEntitiesInSignature(OWLAxiom ax) { return ax.getObjectPropertiesInSignature(); }
@Override protected Set<OWLObjectPropertyExpression> getEntitiesInSignature(OWLAxiom ax) { Set<OWLObjectPropertyExpression> result = new HashSet<OWLObjectPropertyExpression>(); for (OWLObjectProperty property : ax.getObjectPropertiesInSignature()) { result.add(property); result.add(property.getInverseProperty()); } return result; }
@Override protected Set<OWLObjectPropertyExpression> getEntitiesInSignature(OWLAxiom ax) { Set<OWLObjectPropertyExpression> result = new HashSet<OWLObjectPropertyExpression>(); for (OWLObjectProperty property : ax.getObjectPropertiesInSignature()) { result.add(property); result.add(property.getInverseProperty()); } return result; }
@Override protected Set<OWLObjectPropertyExpression> getEntitiesInSignature(OWLAxiom ax) { Set<OWLObjectPropertyExpression> result = new HashSet<>(); for (OWLObjectProperty property : ax.getObjectPropertiesInSignature()) { result.add(property); result.add(property.getInverseProperty()); } return result; }
Set<OWLLogicalAxiom> axiomSet=localOntology.getLogicalAxioms(); Iterator<OWLLogicalAxiom> iteratorAxiom= axiomSet.iterator(); while(iteratorAxiom.hasNext()) { OWLAxiom tempAx= iteratorAxiom.next(); if(!tempAx.getIndividualsInSignature().isEmpty()){ System.out.println(tempAx.getIndividualsInSignature()); System.out.println(tempAx.getDataPropertiesInSignature()); System.out.println(tempAx.getObjectPropertiesInSignature()); } }
/** * Remove axioms from the input ontology. This version expects a set of OWLObjectProperties. * * @param ontology the ontology to filter * @param properties a set of OWLObjectProperties to retain */ public static void filter(OWLOntology ontology, Set<OWLObjectProperty> properties) { logger.debug("Filtering ontology for axioms with ObjectProperties " + properties); OWLOntologyManager manager = ontology.getOWLOntologyManager(); Set<OWLAxiom> axioms = ontology.getAxioms(); logger.debug("Ontology has {} axioms before filtering", axioms.size()); // For each axiom, get all its object properties, // then remove the properties that we're looking for. // If there are no object properties left, then we keep this axiom. // All annotation axioms, declarations, and subClass relations remains. for (OWLAxiom axiom : axioms) { Set<OWLObjectProperty> ps = axiom.getObjectPropertiesInSignature(); ps.removeAll(properties); if (ps.size() > 0) { manager.removeAxiom(ontology, axiom); } } logger.debug("Ontology has {} axioms after filtering", ontology.getAxioms().size()); } }
Set<OWLObjectProperty> oprops = ax.getObjectPropertiesInSignature(); Set<OWLDataProperty> dprops = ax.getDataPropertiesInSignature();
Set<OWLObjectProperty> oprops = ax.getObjectPropertiesInSignature(); Set<OWLDataProperty> dprops = ax.getDataPropertiesInSignature();