syside.json.loads
- loads(s: str, document: syside.Document, attributes: syside.AttributeMap | None = None) syside.DeserializedModel[source]
Deserialize a model from
sinto an already existingdocument.- Parameters:
s – The string contained serialized SysML model in JSON array.
document – The document the model will be deserialized into.
attributes – Attribute mapping of
s. If none provided, this will attempt to infer a corresponding mapping or raise aValueError.
- Returns:
Model deserialized from JSON array. Note that references into other documents will not be resolved, users will need to resolve them by calling
linkon the returned model. See alsoIdMap.
- loads(s: str, document: syside.Url | str, attributes: syside.AttributeMap | None = None) tuple[syside.DeserializedModel, syside.SharedMutex[syside.Document]][source]
Create a new
documentand deserialize a model fromsinto it.- Parameters:
s – The string contained serialized SysML model in JSON array.
document – A URI in the form of
Urlor a string, new document will be created with. If URI path has no extension, or the extension does not matchsysmlorkerml,ValueErroris raised.attributes – Attribute mapping of
s. If none provided, this will attempt to infer a corresponding mapping or raise aValueError.
- Returns:
Model deserialized from JSON array and the newly created document. Note that references into other documents will not be resolved, users will need to resolve them by calling
linkon the returned model. See alsoIdMap.