public static Set<OWLClass> computeConcepts(AbstractReasonerComponent rs) { // if there is no ignore or allowed list, we just ignore the concepts // of uninteresting namespaces Set<OWLClass> concepts = rs.getClasses(); // Helper.removeUninterestingConcepts(concepts); return concepts; }
public List<OWLClass> getAtomicConceptsList() { if (atomicConceptsList == null) atomicConceptsList = new LinkedList<>(getClasses()); return atomicConceptsList; }
/** * Checks whether the roles exist in background knowledge * @param concepts The concepts to check. * @return The first non-existing role or null if they are all in the * background knowledge. */ // public static OWLClass checkConcepts(AbstractReasonerComponent rs, Set<OWLClass> concepts) { Set<OWLClass> existingConcepts = rs.getClasses(); for (OWLClass ar : concepts) { if(!existingConcepts.contains(ar)) return ar; } return null; }
public static Set<OWLClass> computeConceptsUsingIgnoreList(AbstractReasonerComponent rs, Set<OWLClass> ignoredConcepts) { Set<OWLClass> concepts = new TreeSet<>(rs.getClasses()); // Helper.removeUninterestingConcepts(concepts); for (OWLClass ac : ignoredConcepts) { boolean success = concepts.remove(ac); if (!success) logger.warn("Warning: Ignored concept " + ac + " does not exist in knowledge base."); } return concepts; }
public DLTreesRefinementOperator(PosNegLP lp, AbstractReasonerComponent reasoner, int beam) { super(); // TODO Auto-generated constructor stub this.reasoner=reasoner; //System.out.println("is Reasoner null? "+reasoner==null); allConcepts= new ArrayList<>(reasoner.getClasses()); //System.out.println("all+ Concepts: "+allConcepts.size()); allRoles= new ArrayList<>(reasoner.getObjectProperties()); //this.beam=beam; // set the maximum number of candidates that can be generated this.lp=lp; generator= new Random(2); }
public void setReasoner(AbstractReasonerComponent reasoner) { // TODO Auto-generated method stub this.reasoner= reasoner; if (allConcepts==null) allConcepts= new ArrayList<>(reasoner.getClasses()); //System.out.println("all+ Concepts: "+allConcepts.size()); if (allRoles==null) allRoles= new ArrayList<>(reasoner.getObjectProperties()); }
public static <T extends OWLEntity> Set<T> computeEntities(AbstractReasonerComponent rs, EntityType<T> entityType) { // if there is no ignore or allowed list, we just ignore the concepts // of uninteresting namespaces if (entityType == EntityType.CLASS) { return (Set<T>) rs.getClasses(); } else if (entityType == EntityType.OBJECT_PROPERTY) { return (Set<T>) rs.getObjectProperties(); } else if (entityType == EntityType.DATA_PROPERTY) { return (Set<T>) rs.getDatatypeProperties(); } return null; }
Set<OWLClass> allClasses = reasoner.getClasses(); Set<OWLClass> allExamples = Sets.union(positiveExamples, negativeExamples); if (!allClasses.containsAll(allExamples)) {
public static <T extends OWLEntity> Set<T> computeEntitiesUsingIgnoreList(AbstractReasonerComponent rs, EntityType<T> entityType, Set<T> ignoredEntites) { Set<T> entities; if (entityType == EntityType.CLASS) { entities = (Set<T>) rs.getClasses(); } else if (entityType == EntityType.OBJECT_PROPERTY) { entities = (Set<T>) rs.getObjectProperties(); } else if (entityType == EntityType.DATA_PROPERTY) { entities = (Set<T>) rs.getDatatypeProperties(); } else { throw new UnsupportedOperationException("Entity type " + entityType + " currently not supported."); } entities = new TreeSet<>(entities); for (T entity : ignoredEntites) { boolean success = entities.remove(entity); if (!success) { logger.warn("Warning: Ignored entity " + entity + " does not exist in knowledge base."); } } return entities; }
@WebMethod public String[] getAtomicConcepts(int id) throws ClientNotKnownException { Set<OWLClass> atomicConcepts = getState(id).getReasonerComponent().getClasses(); return Datastructures.sortedSet2StringListConcepts(atomicConcepts); }
@Override public OWLClass getOWLClass(String name) { if ("owl:Thing".equals(name) || IRI.create(OWL.NS + "Thing").toQuotedString().equals(name)) { return df.getOWLThing(); } OWLClass cls = find(name, rc.getClasses()); if (cls != null) { return cls; } if (allowShortForm && "Thing".equals(name)) { return df.getOWLThing(); } return null; }
ArrayList<OWLClass> concepts = new ArrayList<>(rs.getClasses()); ((DLTreesRefinementOperator) op).setAllConcepts(concepts);
Set<OWLClass> atomicConcepts = getClasses(); for (OWLClass atom : atomicConcepts) { tmp = getSubClassesImpl(atom);
if (!getReasoner().getClasses().contains(classToDescribe)) { throw new ComponentInitException("The class \"" + classToDescribe + "\" does not exist. Make sure you spelled it correctly.");
if (!getReasoner().getClasses().containsAll(classExpressionToDescribe.getClassesInSignature()) || !getReasoner().getObjectProperties().containsAll(classExpressionToDescribe.getObjectPropertiesInSignature()) || !getReasoner().getDatatypeProperties().containsAll(classExpressionToDescribe.getDataPropertiesInSignature())) {
Set<OWLClass> classes = new TreeSet<>(reasoner.getClasses());