jsonschema - JSON Schema Semantic Annotation -
in following link sawsdl:modelreference in xml schema used semantic annotation in order map between different schemas: link
i want create semantic annotations json schema same purpose. there sawsdl json?
if not, can use id property? far know id property can used relative (“$id” : “billing/address”) or absolute (“$id”: “#billingaddress”).
in case id example:
“$id” : “order/hasbillingaddress/address”
or possible create custom property example “semanticannotation” : “order/hasbillingaddress/address”?
i have read specification , far can tell, neither of approaches seem contradicted specification. have checked both options json schema validator found no problems.
json schema not yet directly support semantic annotations, although there an issue open idea. @ moment, no 1 has time work on proposal, think worth exploring, particularly in conjunction json-ld. please feel free add use cases issue.
the $id property assigning uri schema can referenced elsewhere. "#billingaddress" form declaring fragment uri local schema file (the "#" uri fragment syntax marker, , not specific json schema).
the "billing/address" form declaring uri relative path. done when packing multiple logical schemas single file, references targeting original file name , path remain valid. setting non-fragment $id changes hour $ref references resolved, not want.
since json schema validators ignore keywords not understand, simplest thing may define own extension keywords this. not recognized other applications, guess depends on audience. several validator programs make easy hook in support custom keywords.
Comments
Post a Comment