Exemplo n.º 1
0
 public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual ind)
     throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException,
         TimeOutException {
   refreshCheck();
   try {
     return toIndividualNode(kb.getAllSames(term(ind)));
   } catch (PelletRuntimeException e) {
     throw convert(e);
   }
 }
Exemplo n.º 2
0
  private NodeSet<OWLNamedIndividual> getIndividualNodeSetByName(
      Collection<ATermAppl> individuals) {
    Set<Node<OWLNamedIndividual>> instances = new HashSet<Node<OWLNamedIndividual>>();

    for (ATermAppl ind : individuals) {
      for (ATermAppl equiv : kb.getAllSames(ind)) {
        instances.add(toIndividualNode(equiv));
      }
    }

    return new OWLNamedIndividualNodeSet(instances);
  }
Exemplo n.º 3
0
  private NodeSet<OWLNamedIndividual> getIndividualNodeSetBySameAs(
      Collection<ATermAppl> individuals) {
    Set<Node<OWLNamedIndividual>> instances = new HashSet<Node<OWLNamedIndividual>>();
    Set<ATermAppl> seen = new HashSet<ATermAppl>();
    for (ATermAppl ind : individuals) {
      if (!seen.contains(ind)) {
        Set<ATermAppl> equiv = kb.getAllSames(ind);
        instances.add(toIndividualNode(equiv));
        seen.addAll(equiv);
      }
    }

    return new OWLNamedIndividualNodeSet(instances);
  }