MCPcopy Create free account
hub / github.com/alephdata/aleph / create

Function create

aleph/views/entitysets_api.py:85–109  ·  view source on GitHub ↗

Create an entityset. --- post: summary: Create an entityset requestBody: content: application/json: schema: $ref: '#/components/schemas/EntitySetCreate' responses: '200': content: application/json:

()

Source from the content-addressed store, hash-verified

83
84@blueprint.route("/api/2/entitysets", methods=["POST", "PUT"])
85def create():
86 """Create an entityset.
87 ---
88 post:
89 summary: Create an entityset
90 requestBody:
91 content:
92 application/json:
93 schema:
94 $ref: '#/components/schemas/EntitySetCreate'
95 responses:
96 '200':
97 content:
98 application/json:
99 schema:
100 $ref: '#/components/schemas/EntitySet'
101 description: OK
102 tags:
103 - EntitySet
104 """
105 data = parse_request("EntitySetCreate")
106 collection = get_nested_collection(data, request.authz.WRITE)
107 entityset = create_entityset(collection, data, request.authz)
108 db.session.commit()
109 return EntitySetSerializer.jsonify(entityset)
110
111
112@blueprint.route("/api/2/entitysets/<entityset_id>", methods=["GET"])

Callers

nothing calls this directly

Calls 4

parse_requestFunction · 0.90
get_nested_collectionFunction · 0.90
create_entitysetFunction · 0.90
jsonifyMethod · 0.80

Tested by

no test coverage detected