/** * Get all the (named) classes _individual belongs to. * <p> * *** This function will first realize the whole ontology *** * </p> * * @param ind An individual name * @return A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects. */ public default Set<Set<ATermAppl>> getTypes(final ATermAppl ind) { return getTypes(ind, /* direct = */false); }
/** * Get all the (named) classes _individual belongs to. * <p> * *** This function will first realize the whole ontology *** * </p> * * @param ind An individual name * @return A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects. */ public default Set<Set<ATermAppl>> getTypes(final ATermAppl ind) { return getTypes(ind, /* direct = */false); }
@Override public Iterator<ATermAppl> getObjects(final KnowledgeBase kb, final ATermAppl subj) { return IteratorUtils.flatten(kb.getTypes(subj, true).iterator()); }
@Override public Iterator<ATermAppl> getObjects(final KnowledgeBase kb, final ATermAppl subj) { return IteratorUtils.flatten(kb.getTypes(subj, true).iterator()); }
@Override public Iterator<ATermAppl> getObjects(final KnowledgeBase kb, final ATermAppl subj) { return IteratorUtils.flatten(kb.getTypes(subj, true).iterator()); }
@Override public ExtendedIterator<Triple> find(final KnowledgeBase kb, final PelletInfGraph openllet, final Node subj, final Node pred, final Node obj) { return objectSetFiller(subj, pred, kb.getTypes(openllet.getLoader().node2term(subj), true)); } });
@Override public ExtendedIterator<Triple> find(final KnowledgeBase kb, final PelletInfGraph openllet, final Node subj, final Node pred, final Node obj) { return objectSetFiller(subj, pred, kb.getTypes(openllet.getLoader().node2term(subj), true)); } });
@Override public ExtendedIterator<Triple> find(final KnowledgeBase kb, final PelletInfGraph openllet, final Node subj, final Node pred, final Node obj) { return objectSetFiller(subj, pred, kb.getTypes(openllet.getLoader().node2term(subj), true)); } });
@Override public NodeSet<OWLClass> getTypes(final OWLNamedIndividual ind, final boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { final Set<Set<ATermAppl>> result = _kb.getTypes(term(ind), direct); return toClassNodeSet(result); } catch (final PelletRuntimeException e) { throw convert(e); } }
@Override public NodeSet<OWLClass> getTypes(final OWLNamedIndividual ind, final boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { final Set<Set<ATermAppl>> result = _kb.getTypes(term(ind), direct); return toClassNodeSet(result); } catch (final PelletRuntimeException e) { throw convert(e); } }
@Override public NodeSet<OWLClass> getTypes(final OWLNamedIndividual ind, final boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { final Set<Set<ATermAppl>> result = _kb.getTypes(term(ind), direct); return toClassNodeSet(result); } catch (final PelletRuntimeException e) { throw convert(e); } }
return objectSetFiller(s, p, kb.getTypes(term));
return objectSetFiller(s, p, kb.getTypes(term));
return objectSetFiller(s, p, kb.getTypes(term));
@Test public void testRuleIndividuals() { final ATermAppl c = term("C"), d = term("D"), i = term("i"); _kb.addClass(c); _kb.addClass(d); _kb.addIndividual(i); _kb.addType(i, c); _kb.addRule(new Rule(Arrays.asList(new RuleAtom[] { new ClassAtom(d, new AtomIConstant(i)) }), Arrays.asList(new RuleAtom[] { new ClassAtom(c, new AtomIConstant(i)) }))); _kb.realize(); assertTrue(_kb.getTypes(i).contains(Collections.singleton(d))); }
assertEquals(singletonSets(_A, ATermUtils.TOP), _kb.getTypes(_a, false)); assertEquals(autoRealize, _kb.isRealized()); assertFalse(TaxonomyUtils.getTypes(_kb.getTaxonomy(), _a, false).isEmpty()); assertEquals(singletonSets(_B), _kb.getTypes(_b, true)); assertEquals(autoRealize, _kb.isRealized()); assertFalse(TaxonomyUtils.getTypes(_kb.getTaxonomy(), _a, false).isEmpty());