private static IConcept getContextType(IKnowledge concept, boolean recurse) { if (!(concept instanceof IConcept)) { return null; } IConcept ret = null; if (recurse && (NS.isAttribute(concept) || NS.isRealm(concept) || NS.isClass(concept) || NS.isConfiguration(concept))) { IConcept described = getDescribedQuality((IConcept) concept); ret = described == null ? null : getContextType(described, false); } else if (recurse && (NS.isIdentity(concept) || NS.isProcess(concept))) { Collection<IConcept> described = getApplicableObservables(concept); ret = described.size() > 0 ? NS.getLeastGeneralCommonConcept(described) : null; } else { Collection<IConcept> cls = OWL .getRestrictedClasses((IConcept) concept, KLAB .p(NS.HAS_CONTEXT_PROPERTY)); ret = cls.isEmpty() ? null : cls.iterator().next(); } if (ret == null && NS.isObservable(concept)) { IConcept inherent = getInherentType(concept); if (inherent != null) { ret = getContextType(inherent, false); } } return ret; }
IConcept describes = Observables.getDescribedQuality(k);