@@ -63,55 +63,9 @@ def from_json(cls, json_dict):
6363 return cls (** _dict )
6464
6565
66- """
67- * The reason that an ontology is read only is because it is a second class citizen to labeling front end options.
68- ** This is because it is a more specific implementation of this.
69-
70- - However, we want to support ontologies as if they were labeling front ends.
71- - With this special relationship we can override the default behavior to mock the appropriate changes to the labeling front end
72-
73-
74- ###Note: The only problem is that you can't just create a stand alone ontology. right?
75- # - Since you need to create a project and query the project ontology before one exists.
76-
77- ^^^^^^^ This is the worst. Even with hackery, you can't force a DB entry without create a new proj :(
78- However, labeling front-ends cannot be created without projects either! So maybe we just copy the use cases of that.
79- Use this as the simpler interface and make it clear that this is just a limited version
80-
81- """
82-
83-
84- class OntologyRelationship (Relationship ):
85-
86- def __get__ (self , parent ):
87- if not self .parent :
88- self .parent = parent
89- return self
90-
91- def __init__ (self ):
92- super (OntologyRelationship , self ).__init__ ()
93- self .parent = None
94-
95- def __call__ (self ):
96- if self .parent .setup_complete is None :
97- #As it currently stands, it creates a new ontology with no new tools and the ontology cannot be edited.
98- return None
99- return super ().__call__
100-
101- def connect (self , other_ontology ):
102- if not isinstance (other_ontology , OntologyRelationship ):
103- raise Exception ("only support " )
104-
105- def disconnect (self ):
106- raise Exception (
107- "Disconnect is not supported for Onotlogy. Instead connect another ontology to replace the current one."
108- )
109-
110-
11166class Ontology (DbObject ):
11267 """An ontology specifies which tools and classifications are available
11368 to a project. This is read only for now.
114-
11569 Attributes:
11670 name (str)
11771 description (str)
@@ -120,7 +74,6 @@ class Ontology(DbObject):
12074 normalized (json)
12175 object_schema_count (int)
12276 classification_schema_count (int)
123-
12477 projects (Relationship): `ToMany` relationship to Project
12578 created_by (Relationship): `ToOne` relationship to User
12679 """
0 commit comments