88import json
99
1010
11- # client = Client(
12- # api_key=os.environ.get('STAGE_API_KEY'),
13- # endpoint="https://app.lb-stage.xyz/api/_gql/graphql",
14- # rest_endpoint="https://app.lb-stage.xyz/api/api/v1")
15-
1611client = Client (
17- api_key = os .environ .get ('LOCALHOST_API_KEY' ),
18- endpoint = "http://localhost:8080/graphql" ,
19- rest_endpoint = "http://localhost:3000/api/api/v1" )
12+ api_key = os .environ .get ('STAGE_API_KEY' ),
13+ endpoint = "https://app.lb-stage.xyz/api/_gql/graphql" ,
14+ rest_endpoint = "https://app.lb-stage.xyz/api/api/v1" )
15+
16+ # client = Client(
17+ # api_key=os.environ.get('LOCALHOST_API_KEY'),
18+ # endpoint="http://localhost:8080/graphql",
19+ # rest_endpoint="http://localhost:3000/api/api/v1")
2020
2121builder = OntologyBuilder (
2222
9797# client.create_ontology('Image ontology with requires connection classes', builder.asdict(), media_type=MediaType.Image)
9898
9999
100- feature_schema = client .upsert_feature_schema (Tool (name = 'Auto OCR from upsert feature schema' , tool = Tool .Type .BBOX , attributes = [FeatureSchemaAttribute (attributeName = 'auto-ocr' , attributeValue = 'true' )]).asdict ())
101- fetched_feature_schema = client .get_feature_schema (feature_schema .uid )
102- feature_schemas_with_name = client .get_feature_schemas ('Auto OCR' )
100+ # feature_schema = client.upsert_feature_schema(Tool(name='Testing', tool=Tool.Type.BBOX, attributes=[FeatureSchemaAttribute(attributeName='auto-ocr', attributeValue='true')]).asdict())
101+ # print(feature_schema)
102+ # fetched_feature_schema = client.get_feature_schema(feature_schema.uid)
103+ # feature_schemas_with_name = client.get_feature_schemas('Auto OCR')
104+
105+ # # Iterate over the feature schemas
106+ # for schema in feature_schemas_with_name:
107+ # print(schema)
108+
109+ # ontology = client.create_ontology_from_feature_schemas('Ontology from feature schemas', ['cm4rc1nl90h36070782v9hlpt'])
110+
111+ # feature_schema = client.update_feature_schema_title('cm4rc1nl90h36070782v9hlpt', 'This is a new title - did it remove the feature schema attributes? UPDATED')
112+ # client.delete_unused_feature_schema('cm4rhzhn7026e07wm2az681di')
103113
104- # Iterate over the feature schemas
105- for schema in feature_schemas_with_name :
106- print (schema )
114+ feature_schema = client .create_feature_schema (normalized = {'tool' : 'rectangle' , 'name' : 'cat' , 'color' : 'black' , 'attributes' : [{'attributeName' : 'auto-ocr' , 'attributeValue' : 'true' }]})
115+ print (feature_schema )
0 commit comments