From abb606a16889a79c156adbd92e7b4aed567521a0 Mon Sep 17 00:00:00 2001 From: schroeder5 Date: Sun, 28 Mar 2021 14:52:44 +0000 Subject: [PATCH] #31: updated docstrings in TOARII_ontology.py (cherry picked from commit 93388bb6fe06ba6f27b67fe2840bbf284e03d8d5) --- toardb/utils/TOARII_ontology.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/toardb/utils/TOARII_ontology.py b/toardb/utils/TOARII_ontology.py index 905e169..4a9a17e 100644 --- a/toardb/utils/TOARII_ontology.py +++ b/toardb/utils/TOARII_ontology.py @@ -30,6 +30,9 @@ class TOAR_Ontology: Methods ------- + get_classes(): + show all classes of onthology + get_class(title): find the onthology class for the given title @@ -86,7 +89,7 @@ class TOAR_Ontology: Returns ------- - list of class titles + [str]: list of class titles """ list = [] for s, p, o in self.graph.triples( (None, RDF.type, OWL.Class) ): @@ -106,7 +109,7 @@ class TOAR_Ontology: Returns ------- - OWL.Class + OWL.Class: ontology class matching the given title """ for s, p, o in self.graph.triples( (None, RDF.type, OWL.Class) ): value = self.graph.value(subject=s,predicate=RDFS.label) @@ -125,7 +128,7 @@ class TOAR_Ontology: Returns ------- - OWL.Class + OWL.Class: ontology class matching the given id """ for s, p, o in self.graph.triples( (None, RDF.type, OWL.Class) ): if s.strip() == id.strip(): @@ -158,7 +161,7 @@ class TOAR_Ontology: Returns ------- - int + int: next free index (NamedIndividual) in ontology """ nid=-1 for s, p, o in self.graph.triples( (None, RDF.type, OWL.NamedIndividual) ): @@ -245,7 +248,7 @@ class TOAR_Ontology: Returns ------- - None + Boolean: True, if entry was found in class """ found=False for s, p, o in self.graph.triples( (None, RDF.type, ont_class ) ): -- GitLab