public OWLGraphEdge(OWLRestriction s, OWLObject t, OWLQuantifiedProperty el, OWLOntology o) { super(); this.source = s; this.target = t; this.ontology = o; setSingleQuantifiedProperty(el); }
@Test public void testRestrictionsReturnedInClosure() throws Exception { OWLGraphWrapper g = getOntologyWrapper(); g.config.isGraphReasonedAndRelaxed = false; OWLObject obj = g.getOWLObject("http://example.org#deformed_hippocampus"); boolean ok = false; for (OWLGraphEdge e : g.getOutgoingEdgesClosureReflexive(obj)) { if (RENDER_ONTOLOGY_FLAG) { System.out.println(e); } if (e.getTarget() instanceof OWLRestriction) ok = true; } assertTrue(ok); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } return obj instanceof OWLRestriction; }
public Set<Object> getProperties(Object cl, int local, int asserted, int named) { Set<Object> prop = new HashSet<Object>(); if (asserted == OntologyFactory.ASSERTED && local == OntologyFactory.LOCAL) { for (Object ent : ((OWLClass) cl).getSuperClasses(getOntology())) { if (ent instanceof OWLRestriction) prop.add(((OWLRestriction) ent).getProperty()); } } else { prop = getInheritedProperties((OWLClass) cl); } return prop; }
public void getProperties(OWLClassExpression desc, Set<Object> list, Set<Object> visited) throws OWLException { if (desc instanceof OWLRestriction) { //getProperties( (OWLRestriction)desc, list ); list.add(((OWLRestriction) desc).getProperty()); } else if (desc instanceof OWLClass) { getProperties((OWLClass) desc, list, visited); } else if (desc instanceof OWLNaryBooleanClassExpression) { for (Object d : ((OWLNaryBooleanClassExpression) desc).getOperands()) { getProperties((OWLClassExpression) d, list, visited); } //getProperties( (OWLNaryBooleanClassExpression)desc, list, visited ); } }
public void getProperties(OWLRestriction rest, Set<Object> list, Set<Object> visited) throws OWLException { list.add((Object) rest.getProperty()); }