8
8
import json
9
9
10
10
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
-
16
11
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" )
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")
20
20
21
21
builder = OntologyBuilder (
22
22
97
97
# client.create_ontology('Image ontology with requires connection classes', builder.asdict(), media_type=MediaType.Image)
98
98
99
99
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')
103
113
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