public Set<P> getChildren(P object) { if (object.equals(getRoot())){ return Collections.unmodifiableSet(subPropertiesOfRoot); } final Set<P> result = new HashSet<P>(); for (E subProp : object.getSubProperties(ontologies)){ // Don't add the sub property if it is a parent of // itself - i.e. prevent cycles if (!subProp.isAnonymous() && !getAncestors((P)subProp).contains(subProp)) { result.add((P)subProp); } } return result; }
public Set<P> getParents(P object) { if (object.equals(getRoot())){ return Collections.emptySet(); } Set<P> result = new HashSet<P>(); for (E prop : object.getSuperProperties(ontologies)) { if (!prop.isAnonymous()) { result.add((P) prop); } } if (result.isEmpty() && isReferenced(object)){ result.add(getRoot()); } return result; }
public Set<P> getEquivalents(P object) { Set<P> result = new HashSet<P>(); Set<P> ancestors = getAncestors(object); if (ancestors.contains(object)) { for (P anc : ancestors) { if (getAncestors(anc).contains(object)) { result.add(anc); } } } for (E prop : object.getEquivalentProperties(ontologies)) { if (!prop.isAnonymous()) { result.add((P)prop); } } result.remove(object); return result; }
public Set<P> getChildren(P object) { if (object.equals(getRoot())){ return Collections.unmodifiableSet(subPropertiesOfRoot); } final Set<P> result = new HashSet<>(); for (E subProp : EntitySearcher.getSubProperties(object, getOntologies())){ // Don't add the sub property if it is a parent of // itself - i.e. prevent cycles if (!subProp.isAnonymous() && !getAncestors((P)subProp).contains(subProp)) { result.add((P)subProp); } } return result; }
public Set<P> getUnfilteredChildren(P object) { // getReadLock().lock(); ontologySetReadLock.lock(); try { if (object.equals(getRoot())) { return Collections.unmodifiableSet(subPropertiesOfRoot); } final Set<P> result = new HashSet<>(); for (E subProp : getSubProperties(object, ontologies)) { // Don't add the sub property if it is a parent of // itself - i.e. prevent cycles if (!subProp.isAnonymous() && !getAncestors((P) subProp).contains(subProp)) { result.add((P) subProp); } } return result; } finally { ontologySetReadLock.unlock(); // getReadLock().unlock(); } }
public Set<P> getUnfilteredChildren(P object) { // getReadLock().lock(); ontologySetReadLock.lock(); try { if (object.equals(getRoot())) { return Collections.unmodifiableSet(subPropertiesOfRoot); } final Set<P> result = new HashSet<>(); for (E subProp : getSubProperties(object, ontologies)) { // Don't add the sub property if it is a parent of // itself - i.e. prevent cycles if (!subProp.isAnonymous() && !getAncestors((P) subProp).contains(subProp)) { result.add((P) subProp); } } return result; } finally { ontologySetReadLock.unlock(); // getReadLock().unlock(); } }
public Set<P> getEquivalents(P object) { // getReadLock().lock(); ontologySetReadLock.lock(); try { Set<P> result = new HashSet<>(); Set<P> ancestors = getAncestors(object); if (ancestors.contains(object)) { for (P anc : ancestors) { if (getAncestors(anc).contains(object)) { result.add(anc); } } } for (E prop : EntitySearcher.getEquivalentProperties(object, ontologies)) { if (!prop.isAnonymous()) { result.add((P) prop); } } result.remove(object); return result; } finally { ontologySetReadLock.unlock(); // getReadLock().unlock(); } }
public Set<P> getEquivalents(P object) { Set<P> result = new HashSet<>(); Set<P> ancestors = getAncestors(object); if (ancestors.contains(object)) { for (P anc : ancestors) { if (getAncestors(anc).contains(object)) { result.add(anc); } } } for (E prop : EntitySearcher.getEquivalentProperties(object, getOntologies())) { if (!prop.isAnonymous()) { result.add((P)prop); } } result.remove(object); return result; }
public Set<P> getParents(P object) { // getReadLock().lock(); ontologySetReadLock.lock(); try { if (object.equals(getRoot())) { return Collections.emptySet(); } Set<P> result = new HashSet<>(); for (E prop : getSuperProperties(object, ontologies)) { if (!prop.isAnonymous()) { result.add((P) prop); } } if (result.isEmpty() && isReferenced(object)) { result.add(getRoot()); } return result; } finally { ontologySetReadLock.unlock(); // getReadLock().unlock(); } }
public Set<P> getParents(P object) { if (object.equals(getRoot())){ return Collections.emptySet(); } Set<P> result = new HashSet<>(); for (E prop : EntitySearcher.getSuperProperties(object, getOntologies())) { if (!prop.isAnonymous()) { result.add((P) prop); } } if (result.isEmpty() && isReferenced(object)){ result.add(getRoot()); } return result; }
public Set<P> getParents(P object) { // getReadLock().lock(); ontologySetReadLock.lock(); try { if (object.equals(getRoot())) { return Collections.emptySet(); } Set<P> result = new HashSet<>(); for (E prop : getSuperProperties(object, ontologies)) { if (!prop.isAnonymous()) { result.add((P) prop); } } if (result.isEmpty() && isReferenced(object)) { result.add(getRoot()); } return result; } finally { ontologySetReadLock.unlock(); // getReadLock().unlock(); } }
public void visit(OWLHasKeyAxiom axiom) { isEL = true; for (OWLPropertyExpression<?,?> prop : axiom.getPropertyExpressions()){ isEL = isEL && !(prop.isAnonymous()); } if (isEL){ ELClassExpressionVisitor classExpVisitor = new ELClassExpressionVisitor(); axiom.getClassExpression().accept(classExpVisitor); isEL = classExpVisitor.getIsEL(); } }
private void handleRestriction(OWLQuantifiedRestriction<OWLClassExpression> r) { if (!r.getProperty().isAnonymous() && !r.getFiller().isAnonymous()){ p = (OWLObjectProperty) r.getProperty(); f = r.getFiller().asOWLClass(); isAcceptable = true; } }
public OWLProperty getNamedProperty(OWLPropertyExpression propexp) { OWLProperty ret; if (!propexp.isAnonymous()) { if (propexp.isDataPropertyExpression()) { ret = ((OWLDataPropertyExpression) propexp).asOWLDataProperty();; } else { ret = ((OWLObjectPropertyExpression) propexp).asOWLObjectProperty(); } } else { assert propexp.isObjectPropertyExpression(); ret = ((OWLObjectPropertyExpression) propexp).getNamedProperty(); } return ret; }
private void handleRestriction(OWLQuantifiedRestriction<OWLDataRange> r) { if (!r.getProperty().isAnonymous() && r.getFiller().isDatatype()){ p = (OWLDataProperty) r.getProperty(); f = r.getFiller().asOWLDatatype(); isAcceptable = true; } }
private void handleRestriction(OWLQuantifiedRestriction<OWLDataRange> r) { if (!r.getProperty().isAnonymous() && r.getFiller().isDatatype()){ p = (OWLDataProperty) r.getProperty(); f = r.getFiller().asOWLDatatype(); isAcceptable = true; } }
private void handleRestriction(OWLQuantifiedRestriction<OWLClassExpression> r) { if (!r.getProperty().isAnonymous() && !r.getFiller().isAnonymous()){ p = (OWLObjectProperty) r.getProperty(); f = r.getFiller().asOWLClass(); isAcceptable = true; } }
/** * returns the key associated with a property expression * @param pe * @return */ public static String getKey(OWLPropertyExpression pe) { if (pe.isObjectPropertyExpression()) { pe = ((OWLObjectPropertyExpression) pe).getSimplified(); } if (!pe.isAnonymous()) { return ((OWLNamedObject) pe).getIRI().toString(); } else { OWLObjectInverseOf ope = (OWLObjectInverseOf) pe; OWLObjectProperty op = (OWLObjectProperty) ope.getInverse(); return op.getIRI().toString(); } }
public String getName(OWLPropertyExpression propexp) { String name; if (!propexp.isAnonymous()) { if (propexp.isDataPropertyExpression()) { name = ((OWLDataPropertyExpression) propexp).asOWLDataProperty().getIRI().toString(); } else { name = ((OWLObjectPropertyExpression) propexp).asOWLObjectProperty().getIRI().toString(); } } else { assert propexp.isObjectPropertyExpression(); name = ((OWLObjectPropertyExpression) propexp).getNamedProperty().getIRI().toString(); } return name; }
public String getName(OWLPropertyExpression propexp) { String name; if (!propexp.isAnonymous()) { if (propexp.isDataPropertyExpression()) { name = ((OWLDataPropertyExpression) propexp).asOWLDataProperty().getIRI().toString(); } else { name = ((OWLObjectPropertyExpression) propexp).asOWLObjectProperty().getIRI().toString(); } } else { assert propexp.isObjectPropertyExpression(); name = ((OWLObjectPropertyExpression) propexp).getNamedProperty().getIRI().toString(); } return name; } /**