SysMLConnector
QueryModel
download a SysML model element by qualified name or UUID
Calling Sequence
Parameters
Returns
Description
Examples
QueryModel(u)
QueryModel(q, r)
u
-
UUID string, or table where u["@id"] a UUID string
q
string; qualified name with :: as separator(s)
r
(optional) table in JSON format; previously downloaded SysML model element
list [w, l, e] of three elements, where
w is a UUID string (same as u from the first calling sequence)
l is a list of strings, the first of which corresponds to the UML type, and all remaining ones (if any) correspond to stereotypes
e is a named table in JSON format whose fields correspond to the data structure on the server. Each field name is a non-empty string, and each field value can take one of the following forms:
true or false
JSON:-null
a string
a table with exactly one field, "@id", whose value is a UUID string
a list of objects as above.
If e["name"] exists and is a non-empty string, then that will be used as the (local) Maple name for the table e; otherwise, the local name element will be used.
The QueryModel(u) calling sequence retrieves the model element with UUID u from the SysML server as a table, together with information about the UML type and stereotypes.
The QueryModel(q) calling sequence traverses the model according to the given qualified name to search for the model element, starting from the root element.
If the optional argument r is specified, then the search will start from the model element represented by r instead.
An error is raised if the syntax of the input string (UUID or qualified name) is incorrect or the model element cannot be found on the server.
Any model elements downloaded as a result of this command, as well as any model elements accessed at intermediate stages during the qualified name search, are being cached internally by the SysMLConnector package in order to speed up anticipated future accesses.
Use of this command requires an active server connection, using the Connect command. If such a connection does not exist, an error will be raised.
with⁡SysMLConnector
ClearChangeSet,Commit,Connect,GetBinding,GetChildren,GetConstraint,GetInstances,GetSlots,GetValue,Login,Logout,PrintChangeSet,PrintElement,PutConstraint,PutValue,QualifiedNameOf,QueryModel,Warnlevel
Login⁡https://twc.mycompany.com:8111/,user=alice,password=a%5Wr^Xt0p@2
Connect⁡JMPTWCSysML:
Download the Analysis Block by fully qualified name.
Analysis_Block≔QueryModel⁡Model-Turbofan::System Breakdown::System Structure::Analysis Block
Analysis_Block≔01984647-e938-4b84-8484-c5d5a1f47bec,uml:Class,Block,Analysis Block
Query the element with name Velocity_in, relative to the Analysis Block. The result is a Property with stereotype Value Property.
Velocity_in≔QueryModel⁡Velocity_in,Analysis_Block3
Velocity_in≔ad42d107-2e10-477c-bb4d-32eed2dac1ba,uml:Property,ValueProperty,Velocity_in
Inspect the non-trivial fields of Velocity_in3.
PrintElement⁡Velocity_in3
"ID" = "_19_0_4_8970276_1622738256599_54261_15" "_namespaceOfMember" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "_structuredClassifierOfOwnedAttribute" = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"} "_structuredClassifierOfRole" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "aggregation" = "composite" "appliedStereotypeInstance" = {"@id" = "2b7c622b-19a9-4bf1-acc9-792ef726293a"} "defaultValue" = {"@id" = "665e7b57-6b20-47e7-bda1-aeae991ef08b"} "name" = "Velocity_in" "namespace" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "ownedElement" = [ 1 = {"@id" = "665e7b57-6b20-47e7-bda1-aeae991ef08b"} 2 = {"@id" = "2b7c622b-19a9-4bf1-acc9-792ef726293a"} ] "owner" = [1 = {"@id" = "01984647-e938-4b84-8484-c5d5a1f47bec"}] "type" = {"@id" = "41421539-c8a9-4ca7-8d86-ea0634f34579"} "visibility" = "public"
Query the first owned element by UUID.
ValueSpecification≔QueryModel⁡Velocity_in3ownedElement1
ValueSpecification≔665e7b57-6b20-47e7-bda1-aeae991ef08b,uml:LiteralReal,element
Inspect the non-trivial fields of this Value Specification.
PrintElement⁡ValueSpecification3
"ID" = "_19_0_2_8970276_1622814198316_665971_146" "name" = "" "owner" = [1 = {"@id" = "ad42d107-2e10-477c-bb4d-32eed2dac1ba"}] "owningProperty" = {"@id" = "ad42d107-2e10-477c-bb4d-32eed2dac1ba"} "value" = "212.43" "visibility" = "public" "visibility__from_PackageableElement" = "public"
Logout⁡
See Also
Connect
JSON
Login
PrintElement
Download Help Document