/// <summary> /// Enlists the facts which are members of the given class within the given ontology /// </summary> public static RDFOntologyData EnlistMembersOf(RDFOntologyClass ontClass, RDFOntology ontology, Boolean useBASEOntology = true) { var result = new RDFOntologyData(); if (ontClass != null && ontology != null) { if (useBASEOntology) { ontology = ontology.UnionWith(RDFBASEOntology.Instance); } //DataRange/Literal-Compatible if (IsLiteralCompatibleClass(ontClass, ontology.Model.ClassModel)) { result = RDFSemanticsUtilities.EnlistMembersOfLiteralCompatibleClass(ontClass, ontology); } //Restriction/Composite/Enumerate/Class else { result = RDFSemanticsUtilities.EnlistMembersOfNonLiteralCompatibleClass(ontClass, ontology); } if (useBASEOntology) { ontology = ontology.DifferenceWith(RDFBASEOntology.Instance); } } return(result); }
/// <summary> /// Enlists the facts which are members of the given class within the given ontology /// </summary> public static RDFOntologyData EnlistMembersOf(RDFOntologyClass ontClass, RDFOntology ontology) { var result = new RDFOntologyData(); if (ontClass != null && ontology != null) { //Restriction if (ontClass.IsRestrictionClass()) { result = RDFSemanticsUtilities.EnlistMembersOfRestriction((RDFOntologyRestriction)ontClass, ontology); } //Composite else if (ontClass.IsCompositeClass()) { result = RDFSemanticsUtilities.EnlistMembersOfComposite(ontClass, ontology); } //Enumerate else if (ontClass.IsEnumerateClass()) { result = RDFSemanticsUtilities.EnlistMembersOfEnumerate((RDFOntologyEnumerateClass)ontClass, ontology); } //DataRange/Literal else if (IsLiteralCompatibleClass(ontClass, ontology.Model.ClassModel)) { result = RDFSemanticsUtilities.EnlistMembersOfLiteralCompatibleClass(ontClass, ontology); } //Class else { result = RDFSemanticsUtilities.EnlistMembersOfClass(ontClass, ontology); } } return(result); }