syside.json.loads

loads(s: str, document: syside.Document, attributes: syside.AttributeMap | None = None) syside.DeserializedModel[source]

Deserialize a model from s into an already existing document.

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 a ValueError.

Returns:

Model deserialized from JSON array. Note that references into other documents will not be resolved, users will need to resolve them by calling link on the returned model. See also IdMap.

loads(s: str, document: syside.Url | str, attributes: syside.AttributeMap | None = None) tuple[syside.DeserializedModel, syside.SharedMutex[syside.Document]][source]

Create a new document and deserialize a model from s into it.

Parameters:
  • s – The string contained serialized SysML model in JSON array.

  • document – A URI in the form of Url or a string, new document will be created with. If URI path has no extension, or the extension does not match sysml or kerml, ValueError is raised.

  • attributes – Attribute mapping of s. If none provided, this will attempt to infer a corresponding mapping or raise a ValueError.

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 link on the returned model. See also IdMap.