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

Function view

aleph/views/entitysets_api.py:113–141  ·  view source on GitHub ↗

Return the entityset with ID `entityset_id`. --- get: summary: Fetch an entityset parameters: - description: The entityset id. in: path name: entityset_id required: true schema: type: string example: 3a0d91ece2dce88ad3259594

(entityset_id)

Source from the content-addressed store, hash-verified

111
112@blueprint.route("/api/2/entitysets/<entityset_id>", methods=["GET"])
113def view(entityset_id):
114 """Return the entityset with ID `entityset_id`.
115 ---
116 get:
117 summary: Fetch an entityset
118 parameters:
119 - description: The entityset id.
120 in: path
121 name: entityset_id
122 required: true
123 schema:
124 type: string
125 example: 3a0d91ece2dce88ad3259594c7b642485235a048
126 responses:
127 '200':
128 content:
129 application/json:
130 schema:
131 $ref: '#/components/schemas/EntitySet'
132 description: OK
133 tags:
134 - EntitySet
135 """
136 entityset = get_entityset(entityset_id, request.authz.READ)
137 if entityset.type == EntitySet.PROFILE:
138 return redirect(url_for("profiles_api.view", profile_id=entityset_id))
139 data = entityset.to_dict()
140 data["shallow"] = False
141 return EntitySetSerializer.jsonify(data)
142
143
144@blueprint.route("/api/2/entitysets/<entityset_id>", methods=["POST", "PUT"])

Callers 1

updateFunction · 0.70

Calls 4

get_entitysetFunction · 0.90
url_forFunction · 0.90
jsonifyMethod · 0.80
to_dictMethod · 0.45

Tested by

no test coverage detected