@@ -512,9 +512,7 @@ def setup_editor(self, ontology) -> None:
512512 ontology (Ontology): The ontology to attach to the project
513513 """
514514 if self .labeling_frontend () is not None :
515- raise ResourceConflict (
516- "Editor is already set up. Use project.connect_ontology to change an ontology."
517- )
515+ raise ResourceConflict ("Editor is already set up." )
518516
519517 labeling_frontend = next (
520518 self .client .get_labeling_frontends (
@@ -544,20 +542,6 @@ def setup_editor(self, ontology) -> None:
544542 timestamp = datetime .now (timezone .utc ).strftime ("%Y-%m-%dT%H:%M:%SZ" )
545543 self .update (setup_complete = timestamp )
546544
547- def connect_ontology (self , ontology ) -> None :
548- """
549- Connect an ontology to the project.
550-
551- Args:
552- ontology (Ontology): The ontology to attach to the project
553- """
554- query_str = """mutation ConnectOntologyPyApi($projectId: ID!, $ontologyId: ID!){
555- project(where: {id: $projectId}) {connectOntology(ontologyId: $ontologyId) {id}}}"""
556- self .client .execute (query_str , {
557- 'ontologyId' : ontology .uid ,
558- 'projectId' : self .uid
559- })
560-
561545 def setup (self , labeling_frontend , labeling_frontend_options ) -> None :
562546 """ Finalizes the Project setup.
563547
@@ -570,9 +554,7 @@ def setup(self, labeling_frontend, labeling_frontend_options) -> None:
570554 """
571555
572556 if self .labeling_frontend () is not None :
573- raise ResourceConflict (
574- "Editor is already set up. Use project.connect_ontology to change an ontology."
575- )
557+ raise ResourceConflict ("Editor is already set up." )
576558
577559 if not isinstance (labeling_frontend_options , str ):
578560 labeling_frontend_options = json .dumps (labeling_frontend_options )
0 commit comments