public static IEnumerable<OntologyProperty> IsExhaustiveDomainOf(this OntologyClass oClass) { IEnumerable<OntologyProperty> indirectScopedDomainProperties = oClass.SuperClasses.SelectMany(cls => cls.IsScopedDomainOf()); IEnumerable<OntologyProperty> scopedDomainProperties = oClass.IsScopedDomainOf(); IEnumerable<OntologyProperty> indirectDomainProperties = oClass.SuperClasses.SelectMany(cls => cls.IsDomainOf); IEnumerable<OntologyProperty> directDomainProperties = oClass.IsDomainOf; // The order is intentional -- the restrictions come before rdfs:domains, and more generic ones go first IEnumerable<OntologyProperty> allDomainProperties = indirectScopedDomainProperties.Union(scopedDomainProperties).Union(indirectDomainProperties).Union(directDomainProperties); return allDomainProperties.Distinct(new OntologyResourceComparer()).Select(ontResource => ontResource as OntologyProperty); }