Skip to content

Commit c8305c0

Browse files
author
Peter Amstutz
committed
Add default @id field to json-ld context if missing.
1 parent ea983fd commit c8305c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

schema_salad/jsonld_context.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def pred(datatype, field, name, context, defaultBase, namespaces):
4646
v = {}
4747
for k, val in field["jsonldPredicate"].items():
4848
v[("@" + k[1:] if k.startswith("_") else k)] = val
49+
if "@id" not in v:
50+
v["@id"] = vee
4951
else:
5052
v = field["jsonldPredicate"]
5153
elif "jsonldPredicate" in datatype:

0 commit comments

Comments
 (0)