From 475dd0b90c2223eb1167689952abeedc59883767 Mon Sep 17 00:00:00 2001 From: Manas Bajaj Date: Tue, 19 Jul 2022 15:46:09 -0400 Subject: [PATCH 1/5] Updated name of project created for multi-branch,tag recipe --- Project_Commit_Branch_Tag_Recipe.ipynb | 594 +++++++++++++++---------- 1 file changed, 368 insertions(+), 226 deletions(-) diff --git a/Project_Commit_Branch_Tag_Recipe.ipynb b/Project_Commit_Branch_Tag_Recipe.ipynb index 5d2defd..faaf54b 100644 --- a/Project_Commit_Branch_Tag_Recipe.ipynb +++ b/Project_Commit_Branch_Tag_Recipe.ipynb @@ -3,7 +3,9 @@ { "cell_type": "markdown", "id": "3ee4834f", - "metadata": {}, + "metadata": { + "tags": [] + }, "source": [ "# Initializing the SysML v2 API" ] @@ -24,7 +26,8 @@ "import json\n", "from datetime import datetime\n", "\n", - "host = \"\n", "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Project NameProject IDProject NameProject ID
10b-Trade-off Among Alternative Configurations Tue May 17 15:07:31 EDT 2022862bf932-940e-4707-af0a-6dfda5e0e24e4a-Functional Allocation Thu Jun 16 17:18:42 EDT 202202235ab1-46b0-4e88-8781-24876dfb7797
13a-Model Containment Thu Jun 16 17:23:32 EDT 20220606afde-a508-4806-bcd1-92e41e23e60a
18-Use Case Thu Jun 16 17:27:05 EDT 20220b8386f4-97dd-419f-8607-92ca345d4356
14c-Language Extensions Mon Jun 13 13:47:00 EDT 20220bac2595-df17-4edb-901b-373c7a92d729
10b-Trade-off Among Alternative Configurations Mon Jun 13 13:43:06 EDT 2022115117fd-7e7b-454b-a7c6-d30e51ff910e
11a-View-Viewpoint Thu Jun 16 17:22:33 EDT 202211f9c415-0e30-438a-be15-cef64b480ac5
a1234 Mon Jul 11 12:05:47 EDT 2022124c09f1-c639-4eec-964c-1b996dbed1f2
a1234 Mon Jul 11 12:05:53 EDT 202218da0870-4b9e-454d-9db6-9d9c1e292489
15_19-Materials with Properties Thu Jun 16 17:26:15 EDT 20221eb1a5b0-938b-460f-a610-82b784793d28
9-Verification-simplified Mon Jun 13 13:42:46 EDT 2022202b22e1-9a4d-48de-8f7d-d84caa2ca96c
14c-Language Extensions Thu Jun 16 17:25:16 EDT 202221c0894a-b45b-4f15-b578-db3ddaca5bcf
ShapeItems Mon Jun 13 13:52:10 EDT 20222348eb43-22b4-4c3d-8561-9f66ba875bd3
2a-Parts Interconnection Fri Jul 15 19:04:25 EDT 202226fb0747-dffb-422c-ab15-160246c25524
10d-Dynamics Analysis Thu Jun 16 17:22:11 EDT 20222b8b9f26-c00a-41c3-8a78-eaf587ebd39a
14a-Language Extensions Thu Jun 16 17:24:44 EDT 20222cbd42b9-6d46-4be1-9696-53dca8fdfbbe
12a-Dependency Mon Jun 13 13:44:47 EDT 2022311f82b5-bf62-41ce-8199-83cd7ef47794
5-State-based Behavior-1 Mon Jun 13 13:40:44 EDT 202231a060d8-3c6a-448b-84d6-e9d66e1e476e
ShapeItems Mon Jun 13 13:51:19 EDT 202231cd59bc-8862-4016-bf65-c025893dfd1f
11b-Safety and Security Feature Views Mon Jun 13 13:44:29 EDT 2022333c2e1f-8c2b-4aa1-adcf-7248b733cd67
5-State-based Behavior-1a Mon Jun 13 13:41:12 EDT 2022359c94f0-dec1-453f-bc4b-3fcb7cd0e13d
a1234 Mon Jul 11 11:42:42 EDT 202237c93d73-2b86-4f1a-bd72-260ef611955e
10c-Fuel Economy Analysis Mon Jun 13 13:43:25 EDT 20223977a407-ce82-4c77-aa0a-77fb80ef8b0b
a1234 Mon Jul 11 11:31:29 EDT 20223b4c63ff-18ea-4da8-bedd-a9e4c72a6805
7b-Variant Configurations Thu Jun 16 17:20:14 EDT 20223f1ef047-959a-4fb6-819c-e6431b3fc8b4
3a-Function-based Behavior-5 Thu Jun 16 17:18:26 EDT 20224023a9f1-01d7-4840-aa5b-28cd60547496
Spacecraft 2022-06-21 10:15:48.20591347797bc7-cdf1-48a7-883f-62dd238305fc
13b-Safety and Security Features Element Group-2 Thu Jun 16 17:24:19 EDT 2022484bc116-605b-43e3-9a0d-ab32482b689c
5-State-based Behavior-1a Thu Jun 16 17:19:28 EDT 20224af2b2c8-4a7d-4c46-886f-f4941d3be92f
12b-Allocation Thu Jun 16 17:23:20 EDT 20224cf7b13e-4ebb-4f36-beab-450cb0aad4c4
17a-Sequence-Modeling Mon Jun 13 13:48:18 EDT 20224db09ad2-4af3-4c9f-817b-fc74abb24c12
12b-Allocation Mon Jun 13 13:45:00 EDT 20224fd3eb53-9f26-4954-9a11-ed3744d5b66d
18-Use Case Mon Jun 13 13:48:48 EDT 202253337d0c-f0aa-4200-98bf-cc6503b6a70b
3a-Function-based Behavior-5 Fri Jul 15 19:08:20 EDT 202257cffff7-84a8-4e94-88c7-aa293be67eb3
8-Requirements Thu Jun 16 17:20:39 EDT 20225851a10c-76ad-41e9-9562-693dea55cb21
13a-Model Containment Mon Jun 13 13:45:13 EDT 202264d1251d-79e6-4785-8585-9918288abb0c
10c-Fuel Economy Analysis Tue May 17 15:07:51 EDT 2022afe315eb-87f7-4ae1-8e64-2305d4e2d7256-Individual and Snapshots Mon Jun 13 13:41:35 EDT 2022669dc6f5-ddf7-4f09-949e-40b449a2155f
10d-Dynamics Analysis Tue May 17 15:08:17 EDT 20220b42e175-272e-481d-aaea-d14fbf1b8e038-Requirements Mon Jun 13 13:42:24 EDT 202267b20369-a5d8-4e1a-92fc-4228cf9777b1
11a-View-Viewpoint Tue May 17 15:08:41 EDT 2022c22c4769-979e-4590-a4e5-a505884ca136a1234 Mon Jul 11 11:41:22 EDT 20227247df22-8187-4490-adad-d1b22209ba96
11b-Safety and Security Feature Views Tue May 17 15:08:59 EDT 202205e04320-f883-46a7-8e86-e9b27dd38bbf14b-Language Extensions Thu Jun 16 17:25:01 EDT 20227566e53d-a163-4ce4-b5b7-0db9207715e1
12a-Dependency Tue May 17 15:09:17 EDT 202218d6e46e-0fab-4bb8-9c34-5cca040b4317a1234 Mon Jul 11 11:41:29 EDT 202279027464-c6c6-4717-aca5-255dd98abae1
12b-Allocation Tue May 17 15:09:29 EDT 2022a60d254b-322d-46ad-9dce-cda7b63b3f6615_10-Primitive Data Types Mon Jun 13 13:47:44 EDT 20227b17f736-b909-40ce-b7da-34e622db8c0e
13a-Model Containment Tue May 17 15:09:42 EDT 20223ed5fa65-3098-4d0f-a061-fb986e3fc20410b-Trade-off Among Alternative Configurations Thu Jun 16 17:21:25 EDT 2022818b9a9b-c6cd-4da4-af0e-7a929df7f5d7
13b-Safety and Security Features Element Group Tue May 17 15:09:55 EDT 20220ad176f2-ded0-4802-a41f-acf44fd6320215_10-Primitive Data Types Thu Jun 16 17:26:00 EDT 202286cbd86a-8322-4f03-99ce-a46f5edde464
13b-Safety and Security Features Element Group-1 Tue May 17 15:10:08 EDT 202220291d54-1092-4dba-9769-a9282f70371c15_19-Materials with Properties Mon Jun 13 13:47:59 EDT 202289922923-e086-4ff6-8034-0f343f3855b4
13b-Safety and Security Features Element Group-2 Tue May 17 15:10:30 EDT 2022ecce7efa-fc62-4f7e-85ac-58647e488a092a-Parts Interconnection Mon Jun 13 13:39:03 EDT 202289eeacf4-d0fc-42bb-9a9b-c75f9c8188bc
14a-Language Extensions Tue May 17 15:10:57 EDT 2022a22abf6d-a659-4c61-b8e2-55581250df833a-Function-based Behavior-2 Mon Jun 13 13:39:51 EDT 20228a5cfb5f-6b5c-47d1-b352-941825419637
14b-Language Extensions Tue May 17 15:11:10 EDT 2022703e0d2f-6c1b-4ae2-ae90-93125b5f03a7Spacecraft 2022-06-21 08:58:33.2422268aef12b0-9b6c-4e2e-8235-2c3470b0c9f6
14c-Language Extensions Tue May 17 15:11:24 EDT 2022dcaa3319-1453-4677-9112-fbc8e34c969c13b-Safety and Security Features Element Group Thu Jun 16 17:23:45 EDT 20228ffb1a97-96bd-4794-829f-77a687f1758e
14c-Language-Extensions Tue May 17 15:21:01 EDT 202264aee99d-b5bb-49f0-bf01-2cf9287998ed11b-Safety and Security Feature Views Thu Jun 16 17:22:50 EDT 202292a73141-2648-4500-a613-b25462fa511b
15_05-Unification of Expression and Constraint Definition Tue May 17 15:11:54 EDT 20225651ebdc-1ec9-41fc-8604-5ee6536bdfb812a-Dependency Thu Jun 16 17:23:07 EDT 2022945c21f9-05f0-4541-a219-1a7d90674a7b
15_10-Primitive Data Types Tue May 17 15:12:13 EDT 2022d176635d-885d-4133-97bd-b13e176ece404a-Functional Allocation Mon Jun 13 13:40:25 EDT 20229765eb33-4104-461c-a8e7-578a32e8478a
15_19-Materials with Properties Tue May 17 15:12:29 EDT 202296aad4d0-be3d-4b27-aea9-86a929874683a Thu Jul 07 15:00:49 EDT 2022a66e64e3-5907-413d-bab3-cf87455de7c6
17a-Sequence-Modeling Tue May 17 15:12:50 EDT 2022cb1fe451-28ac-49f7-aa97-26adc23f260a3a-Function-based Behavior-5 Mon Jun 13 13:40:09 EDT 2022ad4f5833-1571-4693-bfe9-9d8dd40d6192
17b-Sequence-Modeling Tue May 17 15:13:05 EDT 2022658dfe11-8ada-4bd2-906e-4cc634df51fe13b-Safety and Security Features Element Group-1 Mon Jun 13 13:45:41 EDT 2022ae7132a0-656d-4ff1-8807-5bb9ecfa8b62
18-Use Case Tue May 17 15:13:19 EDT 20223f1c0c11-cf92-44d6-a585-12171fc55f043a-Function-based Behavior-1 Mon Jun 13 13:39:31 EDT 2022b6fd0cb0-6583-4cab-aa31-05b77c00c608
1c-Parts Tree Redefinition Tue May 17 15:02:36 EDT 20221497a33b-242c-4dce-868d-8a4139fd36d817b-Sequence-Modeling Thu Jun 16 17:26:51 EDT 2022bb6966df-a56a-45f5-a11f-76566887e115
2a-Parts Interconnection Tue May 17 15:03:09 EDT 2022d57bb6a1-4f1e-41c5-a855-5f6c68ff18497b-Variant Configurations Mon Jun 13 13:41:55 EDT 2022bc32c76d-af60-48b1-878e-4c91fed1247c
3a-Function-based Behavior-1 Tue May 17 15:03:40 EDT 202269321b99-47e6-4754-94c6-284c0c29f36213b-Safety and Security Features Element Group Mon Jun 13 13:45:27 EDT 2022c01bf68b-fd64-496a-8491-850fd4c8b5cf
3a-Function-based Behavior-2 Tue May 17 15:04:02 EDT 20225bb84a66-03a5-496d-ac95-b676dd0d8ec6a1234 Mon Jul 11 12:05:39 EDT 2022c13b41ad-47a5-42fd-a3aa-02058386dd41
3a-Function-based Behavior-5 Tue May 17 15:04:22 EDT 2022d834035b-a295-459d-a1fc-9a39ce131aea1c-Parts Tree Redefinition Mon Jun 13 13:38:32 EDT 2022c2b441ad-a4d2-4101-bea6-4f7d7c03e09d
4a-Functional Allocation Tue May 17 15:04:39 EDT 2022ea0dadaa-3ddf-4950-a539-fdaba18b6e732a-Parts Interconnection Thu Jun 16 17:17:18 EDT 2022c3c5e7c0-4124-450a-866d-716821f53e5f
5-State-based Behavior-1 Tue May 17 15:05:03 EDT 2022c0348390-1c87-4c70-b7e2-7d8282dfaf879-Verification-simplified Thu Jun 16 17:21:02 EDT 2022c450ca8e-0f48-431d-9702-309a88cfb8ae
5-State-based Behavior-1a Tue May 17 15:05:31 EDT 2022e41f3050-4b2f-4219-b5bc-8be77594e62fa1234 Thu Jul 07 15:01:29 EDT 2022c5c4f3bd-e228-4839-9f14-b8f60673d611
6-Individual and Snapshots Tue May 17 15:05:58 EDT 2022bf1b55da-bb52-42a2-860f-94bc9c8ecfaaa Wed Jul 06 10:03:47 EDT 2022c95c531c-ee07-4f4e-ba6d-ade906d8c806
7b-Variant Configurations Tue May 17 15:06:19 EDT 2022ce53e21c-294e-417e-b539-85b802b1ca3b1c-Parts Tree Redefinition Thu Jun 16 17:16:42 EDT 2022cb7a45f4-38fd-4778-be4e-78d64b50c439
8-Requirements Tue May 17 15:06:44 EDT 20222444bd2e-a76f-46ff-9cff-e17b1127677217a-Sequence-Modeling Thu Jun 16 17:26:36 EDT 2022d50de042-4fb7-4636-8d42-9fbcc46f8223
9-Verification-simplified Tue May 17 15:07:10 EDT 20229c8c29d7-4f22-44e3-9ac4-b388980e16ae10d-Dynamics Analysis Mon Jun 13 13:43:50 EDT 2022d6e1b859-d7f0-4ab6-bb75-e3b0b88316a8
Interface Example Wed May 25 09:24:40 EEST 2022bba806d5-8767-4ef2-a22c-9ca079ded04a10c-Fuel Economy Analysis Thu Jun 16 17:21:43 EDT 2022d9935057-67ce-46a4-97d1-e8c5b5746461
ShapeItems Thu May 26 11:55:20 EDT 2022ab6e0cfe-07bb-4da9-8dc5-694449df7f7d13b-Safety and Security Features Element Group-2 Mon Jun 13 13:46:03 EDT 2022dac6f6e9-108a-43eb-adea-d28e0a117225
ShapeItems Thu May 26 11:58:17 EDT 2022527d4536-f596-490a-8a4d-c989ddafb7af17b-Sequence-Modeling Mon Jun 13 13:48:33 EDT 2022de4bb80e-deb3-4c5d-a185-7bffdad0ceb2
Spacecraft 2022-06-067c28ff07-74f4-4c2a-83c8-534edd4f44a1a1234 Mon Jul 11 12:09:39 EDT 2022e0041915-4b2f-4a60-9994-20307dbd4d27
Spacecraft 2022-06-065287189d-3aff-4834-bedd-d44abe11e60314a-Language Extensions Mon Jun 13 13:46:32 EDT 2022e6e8d739-9c01-4e4a-88fb-ffd5297c3979
Spacecraft 2022-06-063311dc42-74e8-40b4-bc71-3a40a0e60f1514b-Language Extensions Mon Jun 13 13:46:46 EDT 2022e710e01f-b7ad-40c1-8a33-6159bc72525b
Spacecraft 2022-06-060aa33412-cd1b-4209-80f4-2af680319a0a5-State-based Behavior-1 Thu Jun 16 17:19:02 EDT 2022e8d8ac69-7de7-4c49-b9ce-d2dabb3272a4
Spacecraft 2022-06-06 22:38:57.87145703a7384a-ac2f-476b-8de1-3d13a9abe0ef3a-Function-based Behavior-1 Thu Jun 16 17:17:46 EDT 2022eb95e9c6-89ce-423c-a8e1-4fb67cd5b003
Spacecraft 2022-06-06 22:39:57.53977980c9ae8d-d6e7-4c67-8509-c0aed27cb24b15_05-Unification of Expression and Constraint Definition Mon Jun 13 13:47:27 EDT 2022ec2e1ad3-d98b-46cd-b038-9c41f5098259
Spacecraft 2022-06-07 07:55:09.721900a16dd267-3c1e-463d-aecd-d46893c81a03Spacecraft 2022-06-13 13:06:03.158117efa5427e-d1af-4e8e-abfc-d0638d0b4748
Spacecraft 2022-06-07 10:29:23.535360d32d424c-132d-4fa2-b4ad-a9781cfc13bf13b-Safety and Security Features Element Group-1 Thu Jun 16 17:23:58 EDT 2022f0923bb1-50f7-4c32-8d36-a40d58d40781
Spacecraft 2022-06-07 10:48:51.6774263bc928fc-17bc-4c56-9ff0-9237d51045666-Individual and Snapshots Thu Jun 16 17:19:53 EDT 2022f3ca279c-fff8-45e1-a96e-a84d6cfa651d
Spacecraft 2022-06-07 11:20:35.2220680c6e2540-d8e6-4cf3-913f-18f35c3c43fe11a-View-Viewpoint Mon Jun 13 13:44:11 EDT 2022f60589e2-06dd-4bcd-9048-63c6dba67663
Spacecraft Test1f231825-2b29-4d2d-beec-cbc1c3f802c215_05-Unification of Expression and Constraint Definition Thu Jun 16 17:25:43 EDT 2022f618a491-d542-462e-912c-4b2362c5c228
Spacecraft Test 29ec3d0c9-b699-4db2-afd5-e0f6cf299d603a-Function-based Behavior-2 Thu Jun 16 17:18:06 EDT 2022f9133184-53dc-4973-8b22-5be148262179
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -264,7 +403,9 @@ "if projects_response.status_code == 200:\n", " projects = projects_response.json()\n", " projects_data = list(map(lambda b: {'Project Name':b['name'], 'Project ID':b['@id']}, projects))\n", - " df = pd.DataFrame.from_records(projects_data).sort_values(by='Project Name').style.hide(axis='index')\n", + " df = pd.DataFrame.from_records(projects_data).style.hide(axis='index')\n", + " # if len(projects_data) > 0:\n", + " # df = df.style.sort_values(by='Project Name')\n", " display(df)\n", "else:\n", " pprint(\"Problem in fetching projects\")" @@ -288,21 +429,22 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '25021e68-5a8a-426e-a43f-e8b15610519c',\n", + "{'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d',\n", " '@type': 'Project',\n", - " 'defaultBranch': {'@id': '813b2e97-82b5-4930-8100-0881d5658a17'},\n", - " 'description': 'Spacecraft project with data',\n", - " 'name': 'Spacecraft 2022-06-07 11:54:09.837268'}\n" + " 'defaultBranch': {'@id': 'f146cf01-0523-44f7-bb1a-6fdad0d21851'},\n", + " 'description': 'Spacecraft project with multiple commits, branches, and tags',\n", + " 'name': 'Spacecraft project with branches and tags - 2022-07-19 '\n", + " '15:34:59.073337'}\n" ] } ], "source": [ "timestamp = datetime.now()\n", - "project_name = f\"Spacecraft {timestamp}\"\n", + "project_name = f\"Spacecraft project with branches and tags - {timestamp}\"\n", "project_data = {\n", " \"@type\":\"Project\",\n", " \"name\": project_name,\n", - " \"description\": \"Spacecraft project with data\"\n", + " \"description\": \"Spacecraft project with multiple commits, branches, and tags\"\n", "}\n", "\n", "project_post_url = f\"{host}/projects\" \n", @@ -342,25 +484,25 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Branch NameBranch IDRef Commit (head)Branch NameBranch IDRef Commit (head)
main813b2e97-82b5-4930-8100-0881d5658a17Nonemainf146cf01-0523-44f7-bb1a-6fdad0d21851None
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -408,7 +550,7 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", " \n", @@ -416,7 +558,7 @@ "
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -457,11 +599,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '1da6d589-8232-47c5-8e5b-d8c1ced0961d',\n", + "{'@id': '022286b4-dcdf-496b-994c-c1d4a2748129',\n", " '@type': 'Commit',\n", - " 'owningProject': {'@id': '25021e68-5a8a-426e-a43f-e8b15610519c'},\n", + " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", " 'previousCommit': None,\n", - " 'timestamp': '2022-06-07T11:54:16.923686-04:00'}\n" + " 'timestamp': '2022-07-19T15:35:13.438917-04:00'}\n" ] } ], @@ -521,31 +663,31 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Payload System3bacaac2-1548-498c-a3a9-35e1224fb333Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89
Propulsion System40c690e7-fc67-4e0b-9de1-51f5fa63aaadPropulsion System957d97ce-41e5-43c1-b772-45cac191565c
Spacecraft System08f2762c-daee-4170-9d3a-1ea874796bf0Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5a
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -587,11 +729,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4',\n", + "{'@id': '38643857-0090-4b81-89b7-b3411f117336',\n", " '@type': 'Commit',\n", - " 'owningProject': {'@id': '25021e68-5a8a-426e-a43f-e8b15610519c'},\n", - " 'previousCommit': {'@id': '1da6d589-8232-47c5-8e5b-d8c1ced0961d'},\n", - " 'timestamp': '2022-06-07T11:54:21.512896-04:00'}\n" + " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", + " 'previousCommit': {'@id': '022286b4-dcdf-496b-994c-c1d4a2748129'},\n", + " 'timestamp': '2022-07-19T15:35:17.309787-04:00'}\n" ] } ], @@ -655,39 +797,39 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Avionics Systemc3a9cd95-d892-4f80-8e74-e69279ace767Avionics System4ff90e5b-2ac9-488c-b2d2-0d017802b121
Payload System3bacaac2-1548-498c-a3a9-35e1224fb333Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89
Power System67409bf0-066a-463d-98af-0bd29753daf3Power System256a44f2-4bf8-4ce9-95a5-3a0af661aeb3
Propulsion System40c690e7-fc67-4e0b-9de1-51f5fa63aaadPropulsion System957d97ce-41e5-43c1-b772-45cac191565c
Spacecraft System08f2762c-daee-4170-9d3a-1ea874796bf0Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5a
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -727,13 +869,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '24c65293-1361-473a-bd2b-cfe63843cb21',\n", + "{'@id': '758b401a-d6c9-4e9d-89d9-16a3fee3c049',\n", " '@type': 'Tag',\n", " 'name': 'Spacecraft Internal Release 0.1',\n", - " 'owningProject': {'@id': '25021e68-5a8a-426e-a43f-e8b15610519c'},\n", - " 'referencedCommit': {'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'},\n", - " 'taggedCommit': {'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'},\n", - " 'timestamp': '2022-06-07T11:54:25.857998-04:00'}\n" + " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", + " 'referencedCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", + " 'taggedCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", + " 'timestamp': '2022-07-19T15:35:21.841551-04:00'}\n" ] } ], @@ -782,25 +924,25 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Tag NameTag IDTagged CommitTag NameTag IDTagged Commit
Spacecraft Internal Release 0.124c65293-1361-473a-bd2b-cfe63843cb21{'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'}Spacecraft Internal Release 0.1758b401a-d6c9-4e9d-89d9-16a3fee3c049{'@id': '38643857-0090-4b81-89b7-b3411f117336'}
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -840,13 +982,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '3bc848fe-5d2c-49c7-a91b-e4335edd3e7a',\n", + "{'@id': 'cb011176-6e8f-46e0-a314-741edae69f26',\n", " '@type': 'Branch',\n", - " 'head': {'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'},\n", + " 'head': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", " 'name': 'develop',\n", - " 'owningProject': {'@id': '25021e68-5a8a-426e-a43f-e8b15610519c'},\n", - " 'referencedCommit': {'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'},\n", - " 'timestamp': '2022-06-07T11:54:30.360571-04:00'}\n" + " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", + " 'referencedCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", + " 'timestamp': '2022-07-19T15:35:26.061576-04:00'}\n" ] } ], @@ -897,30 +1039,30 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Branch NameBranch IDRef Commit (head)Branch NameBranch IDRef Commit (head)
develop3bc848fe-5d2c-49c7-a91b-e4335edd3e7a{'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'}developcb011176-6e8f-46e0-a314-741edae69f26{'@id': '38643857-0090-4b81-89b7-b3411f117336'}
main813b2e97-82b5-4930-8100-0881d5658a17{'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'}mainf146cf01-0523-44f7-bb1a-6fdad0d21851{'@id': '38643857-0090-4b81-89b7-b3411f117336'}
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -960,11 +1102,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '682a9635-10e4-45fb-80b8-299955d90f03',\n", + "{'@id': '2705a620-834a-421a-a24b-208344aec910',\n", " '@type': 'Commit',\n", - " 'owningProject': {'@id': '25021e68-5a8a-426e-a43f-e8b15610519c'},\n", - " 'previousCommit': {'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'},\n", - " 'timestamp': '2022-06-07T11:54:34.098474-04:00'}\n" + " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", + " 'previousCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", + " 'timestamp': '2022-07-19T15:35:29.750462-04:00'}\n" ] } ], @@ -1022,30 +1164,30 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Branch NameBranch IDRef Commit (head)Branch NameBranch IDRef Commit (head)
develop3bc848fe-5d2c-49c7-a91b-e4335edd3e7a{'@id': '682a9635-10e4-45fb-80b8-299955d90f03'}developcb011176-6e8f-46e0-a314-741edae69f26{'@id': '2705a620-834a-421a-a24b-208344aec910'}
main813b2e97-82b5-4930-8100-0881d5658a17{'@id': 'd2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'}mainf146cf01-0523-44f7-bb1a-6fdad0d21851{'@id': '38643857-0090-4b81-89b7-b3411f117336'}
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1085,7 +1227,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "'Fetching elements at commit d2b90e4b-e2fa-4603-b7ae-5ac1329fdfe4'\n" + "'Fetching elements at commit 38643857-0090-4b81-89b7-b3411f117336'\n" ] }, { @@ -1093,39 +1235,39 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Avionics Systemc3a9cd95-d892-4f80-8e74-e69279ace767Avionics System4ff90e5b-2ac9-488c-b2d2-0d017802b121
Payload System3bacaac2-1548-498c-a3a9-35e1224fb333Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89
Power System67409bf0-066a-463d-98af-0bd29753daf3Power System256a44f2-4bf8-4ce9-95a5-3a0af661aeb3
Propulsion System40c690e7-fc67-4e0b-9de1-51f5fa63aaadPropulsion System957d97ce-41e5-43c1-b772-45cac191565c
Spacecraft System08f2762c-daee-4170-9d3a-1ea874796bf0Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5a
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1166,7 +1308,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "'Fetching elements at commit 682a9635-10e4-45fb-80b8-299955d90f03'\n" + "'Fetching elements at commit 2705a620-834a-421a-a24b-208344aec910'\n" ] }, { @@ -1174,43 +1316,43 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Avionics Systemc3a9cd95-d892-4f80-8e74-e69279ace767Avionics System4ff90e5b-2ac9-488c-b2d2-0d017802b121
GN & C System27e47fbd-9939-46f5-b1de-32cc762acfa0GN & C System83fa4826-7df8-4a8f-8227-180be69c79f6
Payload System3bacaac2-1548-498c-a3a9-35e1224fb333Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89
Power System67409bf0-066a-463d-98af-0bd29753daf3Power System256a44f2-4bf8-4ce9-95a5-3a0af661aeb3
Propulsion System40c690e7-fc67-4e0b-9de1-51f5fa63aaadPropulsion System957d97ce-41e5-43c1-b772-45cac191565c
Spacecraft System08f2762c-daee-4170-9d3a-1ea874796bf0Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5a
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, From 288158cff3a02993862c4bbe4dc0a57654c918fd Mon Sep 17 00:00:00 2001 From: Manas Bajaj Date: Tue, 19 Jul 2022 16:21:31 -0400 Subject: [PATCH 2/5] Added 2nd tag generation to the multi branch and tag recipe --- Project_Commit_Branch_Tag_Recipe.ipynb | 120 ++++++++++++++++++++++++- 1 file changed, 119 insertions(+), 1 deletion(-) diff --git a/Project_Commit_Branch_Tag_Recipe.ipynb b/Project_Commit_Branch_Tag_Recipe.ipynb index faaf54b..f7bf18f 100644 --- a/Project_Commit_Branch_Tag_Recipe.ipynb +++ b/Project_Commit_Branch_Tag_Recipe.ipynb @@ -1375,11 +1375,129 @@ " pprint(element_get_response)" ] }, + { + "cell_type": "markdown", + "id": "f162ef4e-3e68-4a66-b8fa-2abde70e867d", + "metadata": {}, + "source": [ + "# Create a tag at the last commit on develop branch" + ] + }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "b3e26544-b2e4-4370-bb85-9d23aabcc0b5", "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '8721d368-432f-4253-a827-46f01a0f906d',\n", + " '@type': 'Tag',\n", + " 'name': 'Spacecraft Internal Release 0.2 build 1',\n", + " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", + " 'referencedCommit': {'@id': '2705a620-834a-421a-a24b-208344aec910'},\n", + " 'taggedCommit': {'@id': '2705a620-834a-421a-a24b-208344aec910'},\n", + " 'timestamp': '2022-07-19T15:58:41.175306-04:00'}\n" + ] + } + ], + "source": [ + "tag_body = {\n", + " \"@type\": \"Tag\",\n", + " \"name\": \"Spacecraft Internal Release 0.2 build 1\",\n", + " \"taggedCommit\": {\n", + " \"@id\": commit3_id\n", + " }\n", + "}\n", + "\n", + "tag_post_url = f\"{host}/projects/{project_id}/tags\" \n", + "\n", + "tag_post_response = requests.post(tag_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(tag_body))\n", + "\n", + "tag1_id = \"\"\n", + "\n", + "if tag_post_response.status_code == 200:\n", + " tag_response_json = tag_post_response.json()\n", + " pprint(tag_response_json)\n", + " tag1_id = tag_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new tag in Spacecraft project {project_id}.\")\n", + " pprint(tag_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "20dfd748-3149-4442-a7e8-fbef247377a7", + "metadata": {}, + "source": [ + "# Get all tags" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "aee7a152-8b4c-476a-8691-4766fc94c240", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Tag NameTag IDTagged Commit
Spacecraft Internal Release 0.1758b401a-d6c9-4e9d-89d9-16a3fee3c049{'@id': '38643857-0090-4b81-89b7-b3411f117336'}
Spacecraft Internal Release 0.2 build 18721d368-432f-4253-a827-46f01a0f906d{'@id': '2705a620-834a-421a-a24b-208344aec910'}
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tags_url = f\"{host}/projects/{project_id}/tags\" \n", + "tags_response = requests.get(tags_url)\n", + "\n", + "if tags_response.status_code == 200:\n", + " tags = tags_response.json()\n", + " tags_data = list(map(lambda b: {'Tag Name':b['name'], 'Tag ID':b['@id'], 'Tagged Commit':b['taggedCommit']}, tags))\n", + "\n", + " df = pd.DataFrame.from_records(tags_data).style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching tags in Spacecraft project {project_id}.\")\n", + " pprint(tag_post_response)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6bdbb8ac-22dc-41f7-bd05-3dc857ac6c3c", + "metadata": {}, "outputs": [], "source": [] } From 1b096a47cc1b70784a00865b0bb7ea501f67d8ee Mon Sep 17 00:00:00 2001 From: Manas Bajaj Date: Thu, 21 Jul 2022 16:30:21 -0400 Subject: [PATCH 3/5] Adding a new recipe for formulating and executing queries --- Queries.ipynb | 632 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 632 insertions(+) create mode 100644 Queries.ipynb diff --git a/Queries.ipynb b/Queries.ipynb new file mode 100644 index 0000000..4223abd --- /dev/null +++ b/Queries.ipynb @@ -0,0 +1,632 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3ee4834f", + "metadata": {}, + "source": [ + "# Initializing the SysML v2 API" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "6b5fef59", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "\n", + "import time\n", + "import requests\n", + "from pprint import pprint\n", + "import pandas as pd\n", + "import json\n", + "\n", + "#host = \"\"\n", + "host = \"http://sysml2-dev.intercax.com:9000\"" + ] + }, + { + "cell_type": "markdown", + "id": "04c1ff93", + "metadata": {}, + "source": [ + "# Get projects" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "78788ed9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Project NameProject ID
0Spacecraft project with branches and tags - 20...00a50f21-3329-4871-97d5-d9988f8bda4f
117a-Sequence-Modeling Thu Jul 21 12:43:51 EDT ...048a0c99-ca99-4012-929d-f4797d395de1
212b-Allocation Thu Jul 21 12:40:33 EDT 202206a5e118-34e0-4ac3-b499-0a11773bc0f6
314a-Language Extensions Thu Jul 21 12:42:05 ED...0d9d4124-1413-428f-866d-f9b58bf23c95
49-Verification-simplified Thu Jul 21 12:38:15 ...17ffc369-e231-49dd-9f56-4330856a0fda
5Geometry Thu Jul 21 13:01:13 EDT 2022228c1a01-b8be-4d63-a87c-0ebbd9d88ff8
611a-View-Viewpoint Thu Jul 21 12:39:43 EDT 20222e65960e-5dca-4d69-bb31-0c56537b4b70
714b-Language Extensions Thu Jul 21 12:42:19 ED...2f671f67-cb65-4365-a221-c403e7b87c51
85-State-based Behavior-1a Thu Jul 21 12:36:44 ...3694e3f8-b2eb-45a7-bddd-f41cca5b36c6
911b-Safety and Security Feature Views Thu Jul ...3703933c-5a07-4555-9352-3414f345553b
1018-Use Case Thu Jul 21 12:44:19 EDT 20224223e1a2-beb7-483b-852e-3913c7a94c9c
113a-Function-based Behavior-2 Thu Jul 21 12:35:...462e55f9-2def-4b0f-abf6-e46f1cd50979
12Spacecraft project with branches and tags - 20...51cbfbec-1e60-4f6f-9956-e38594dcb33d
1310d-Dynamics Analysis Thu Jul 21 12:39:20 EDT ...6ec5dbe4-2b39-4b56-b222-ff506f15dba9
1412a-Dependency Thu Jul 21 12:40:21 EDT 2022703ade3d-7929-4d40-9806-19b7f3c002df
1515_10-Primitive Data Types Thu Jul 21 12:43:17...70cc6261-6b37-4463-a0d6-f63b01301b32
1613b-Safety and Security Features Element Group...7c91c09e-2973-46b9-ad82-275ba2124322
1713b-Safety and Security Features Element Group...7da362eb-8768-4417-8985-c705c17ee1f2
188-Requirements Thu Jul 21 12:37:52 EDT 2022827ca776-1199-4fda-84b7-f81b3dd46fae
1913a-Model Containment Thu Jul 21 12:40:47 EDT ...8d16ef4d-8b68-4661-a5f6-131ad06251d8
20Spacecraft project with branches and tags - 20...8fe6a1a1-e722-4342-bc71-961f848a7799
2117b-Sequence-Modeling Thu Jul 21 12:44:05 EDT ...96fe8de3-8af0-4d4a-96b0-354f4cceb184
2215_05-Unification of Expression and Constraint...98fa34a4-5069-4dc3-9a97-f57122adebc6
235-State-based Behavior-1 Thu Jul 21 12:36:19 E...9ea87a3e-9f70-4e13-acf4-0932d28d4362
244a-Functional Allocation Thu Jul 21 12:35:59 E...aa64678d-87ce-442f-a88e-866ae492f75b
251c-Parts Tree Redefinition Thu Jul 21 12:34:06...b1b4e96a-035e-441f-83c4-2d55fb568877
267b-Variant Configurations Thu Jul 21 12:37:28 ...b25ed4fa-5737-40dc-b69b-bfde55ca39b7
272a-Parts Interconnection Thu Jul 21 12:34:36 E...bb68bed7-3f04-4617-998f-2669d7488236
2810c-Fuel Economy Analysis Thu Jul 21 12:38:54 ...c1fae04f-f879-4fae-acec-1d7281a0124d
2913b-Safety and Security Features Element Group...cd1ba8c5-4992-4585-bf9b-9c3be3e9e033
3015_19-Materials with Properties Thu Jul 21 12:...ce489c07-79d9-4022-9dc1-1bd413bce2d8
3110b-Trade-off Among Alternative Configurations...cfddd9c9-a2c9-4446-8056-74c7552a4d63
326-Individual and Snapshots Thu Jul 21 12:37:08...db7fd713-98bc-4932-9b40-438040e85854
3314c-Language Extensions Thu Jul 21 12:42:33 ED...e6b46779-d037-4391-af1f-6fb5253f1ea2
343a-Function-based Behavior-1 Thu Jul 21 12:35:...f00664c2-ff28-4e1c-aee7-d948e9fa292d
353a-Function-based Behavior-5 Thu Jul 21 12:35:...ff54a0e3-3adb-4c8d-93a4-8e6f5e11af66
\n", + "
" + ], + "text/plain": [ + " Project Name \\\n", + "0 Spacecraft project with branches and tags - 20... \n", + "1 17a-Sequence-Modeling Thu Jul 21 12:43:51 EDT ... \n", + "2 12b-Allocation Thu Jul 21 12:40:33 EDT 2022 \n", + "3 14a-Language Extensions Thu Jul 21 12:42:05 ED... \n", + "4 9-Verification-simplified Thu Jul 21 12:38:15 ... \n", + "5 Geometry Thu Jul 21 13:01:13 EDT 2022 \n", + "6 11a-View-Viewpoint Thu Jul 21 12:39:43 EDT 2022 \n", + "7 14b-Language Extensions Thu Jul 21 12:42:19 ED... \n", + "8 5-State-based Behavior-1a Thu Jul 21 12:36:44 ... \n", + "9 11b-Safety and Security Feature Views Thu Jul ... \n", + "10 18-Use Case Thu Jul 21 12:44:19 EDT 2022 \n", + "11 3a-Function-based Behavior-2 Thu Jul 21 12:35:... \n", + "12 Spacecraft project with branches and tags - 20... \n", + "13 10d-Dynamics Analysis Thu Jul 21 12:39:20 EDT ... \n", + "14 12a-Dependency Thu Jul 21 12:40:21 EDT 2022 \n", + "15 15_10-Primitive Data Types Thu Jul 21 12:43:17... \n", + "16 13b-Safety and Security Features Element Group... \n", + "17 13b-Safety and Security Features Element Group... \n", + "18 8-Requirements Thu Jul 21 12:37:52 EDT 2022 \n", + "19 13a-Model Containment Thu Jul 21 12:40:47 EDT ... \n", + "20 Spacecraft project with branches and tags - 20... \n", + "21 17b-Sequence-Modeling Thu Jul 21 12:44:05 EDT ... \n", + "22 15_05-Unification of Expression and Constraint... \n", + "23 5-State-based Behavior-1 Thu Jul 21 12:36:19 E... \n", + "24 4a-Functional Allocation Thu Jul 21 12:35:59 E... \n", + "25 1c-Parts Tree Redefinition Thu Jul 21 12:34:06... \n", + "26 7b-Variant Configurations Thu Jul 21 12:37:28 ... \n", + "27 2a-Parts Interconnection Thu Jul 21 12:34:36 E... \n", + "28 10c-Fuel Economy Analysis Thu Jul 21 12:38:54 ... \n", + "29 13b-Safety and Security Features Element Group... \n", + "30 15_19-Materials with Properties Thu Jul 21 12:... \n", + "31 10b-Trade-off Among Alternative Configurations... \n", + "32 6-Individual and Snapshots Thu Jul 21 12:37:08... \n", + "33 14c-Language Extensions Thu Jul 21 12:42:33 ED... \n", + "34 3a-Function-based Behavior-1 Thu Jul 21 12:35:... \n", + "35 3a-Function-based Behavior-5 Thu Jul 21 12:35:... \n", + "\n", + " Project ID \n", + "0 00a50f21-3329-4871-97d5-d9988f8bda4f \n", + "1 048a0c99-ca99-4012-929d-f4797d395de1 \n", + "2 06a5e118-34e0-4ac3-b499-0a11773bc0f6 \n", + "3 0d9d4124-1413-428f-866d-f9b58bf23c95 \n", + "4 17ffc369-e231-49dd-9f56-4330856a0fda \n", + "5 228c1a01-b8be-4d63-a87c-0ebbd9d88ff8 \n", + "6 2e65960e-5dca-4d69-bb31-0c56537b4b70 \n", + "7 2f671f67-cb65-4365-a221-c403e7b87c51 \n", + "8 3694e3f8-b2eb-45a7-bddd-f41cca5b36c6 \n", + "9 3703933c-5a07-4555-9352-3414f345553b \n", + "10 4223e1a2-beb7-483b-852e-3913c7a94c9c \n", + "11 462e55f9-2def-4b0f-abf6-e46f1cd50979 \n", + "12 51cbfbec-1e60-4f6f-9956-e38594dcb33d \n", + "13 6ec5dbe4-2b39-4b56-b222-ff506f15dba9 \n", + "14 703ade3d-7929-4d40-9806-19b7f3c002df \n", + "15 70cc6261-6b37-4463-a0d6-f63b01301b32 \n", + "16 7c91c09e-2973-46b9-ad82-275ba2124322 \n", + "17 7da362eb-8768-4417-8985-c705c17ee1f2 \n", + "18 827ca776-1199-4fda-84b7-f81b3dd46fae \n", + "19 8d16ef4d-8b68-4661-a5f6-131ad06251d8 \n", + "20 8fe6a1a1-e722-4342-bc71-961f848a7799 \n", + "21 96fe8de3-8af0-4d4a-96b0-354f4cceb184 \n", + "22 98fa34a4-5069-4dc3-9a97-f57122adebc6 \n", + "23 9ea87a3e-9f70-4e13-acf4-0932d28d4362 \n", + "24 aa64678d-87ce-442f-a88e-866ae492f75b \n", + "25 b1b4e96a-035e-441f-83c4-2d55fb568877 \n", + "26 b25ed4fa-5737-40dc-b69b-bfde55ca39b7 \n", + "27 bb68bed7-3f04-4617-998f-2669d7488236 \n", + "28 c1fae04f-f879-4fae-acec-1d7281a0124d \n", + "29 cd1ba8c5-4992-4585-bf9b-9c3be3e9e033 \n", + "30 ce489c07-79d9-4022-9dc1-1bd413bce2d8 \n", + "31 cfddd9c9-a2c9-4446-8056-74c7552a4d63 \n", + "32 db7fd713-98bc-4932-9b40-438040e85854 \n", + "33 e6b46779-d037-4391-af1f-6fb5253f1ea2 \n", + "34 f00664c2-ff28-4e1c-aee7-d948e9fa292d \n", + "35 ff54a0e3-3adb-4c8d-93a4-8e6f5e11af66 " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "projects_url = f\"{host}/projects\" \n", + "projects_response = requests.get(projects_url)\n", + "parts_tree_project_id = \"\"\n", + "\n", + "if projects_response.status_code == 200:\n", + " projects = projects_response.json()\n", + " \n", + " df = pd.DataFrame({'Project Name':[], 'Project ID':[]})\n", + " for p in projects:\n", + " df = pd.concat([df, pd.DataFrame({'Project Name':[p['name']], 'Project ID':[p['@id']]})], ignore_index=True)\n", + " display(df)\n", + " \n", + " parts_tree_project = list(filter(lambda p: 'Parts Tree' in p['name'], projects))[0] \n", + " parts_tree_project_id = parts_tree_project['@id']" + ] + }, + { + "cell_type": "markdown", + "id": "487c0624", + "metadata": {}, + "source": [ + "## Query to find all part usages" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "e1e315c9-7484-4424-a3b7-2b1455dbbe91", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Part Usage NamePart Usage ID
0rearAxleAssembly_c102fecf3d-69f7-4f16-a2c9-90c0df53dae5
1frontAxle_c16184d9c5-57ae-4e29-906e-d042f7b7e2bb
2frontWheel005c0064-c3c2-4ecd-aec8-59483179e7e5
3vehicle1_c1dd0cba88-59dd-4b2e-9664-7608d22186ce
4rearAxle8ed3d0f9-1bb4-4207-80db-e39c5cfb1e5f
5frontAxleb53912c9-213d-4d61-b737-270969d20d65
6vehicle1149effb8-9cfb-4f55-80db-a984830eec55
7rearAxle_c1b4d0d0e0-8b79-4bea-a071-2af8315c492c
8frontAxleAssembly2b723540-a1cc-44e3-8f54-8b29cbb2962a
9frontWheel_1a88fb146-b2cb-4ef9-b2b8-d14bea29d3e1
10rearWheel_1f8bb2e98-a0e8-468f-9e78-0a391dfb927f
11frontWheel_2ba3e13d6-bb9f-4ec3-851a-7699e9839d38
12rearWheel5af0fa89-4f22-4b69-a022-9a342f0089b2
13rearAxleAssembly8435855c-96a1-489b-afc8-ba2e01b9deab
14rearWheel_2c15818e7-2edf-48f8-a04e-6900f3c13958
15frontAxleAssembly_c10e27013b-240d-44e5-bee9-d2bc949651ea
\n", + "
" + ], + "text/plain": [ + " Part Usage Name Part Usage ID\n", + "0 rearAxleAssembly_c1 02fecf3d-69f7-4f16-a2c9-90c0df53dae5\n", + "1 frontAxle_c1 6184d9c5-57ae-4e29-906e-d042f7b7e2bb\n", + "2 frontWheel 005c0064-c3c2-4ecd-aec8-59483179e7e5\n", + "3 vehicle1_c1 dd0cba88-59dd-4b2e-9664-7608d22186ce\n", + "4 rearAxle 8ed3d0f9-1bb4-4207-80db-e39c5cfb1e5f\n", + "5 frontAxle b53912c9-213d-4d61-b737-270969d20d65\n", + "6 vehicle1 149effb8-9cfb-4f55-80db-a984830eec55\n", + "7 rearAxle_c1 b4d0d0e0-8b79-4bea-a071-2af8315c492c\n", + "8 frontAxleAssembly 2b723540-a1cc-44e3-8f54-8b29cbb2962a\n", + "9 frontWheel_1 a88fb146-b2cb-4ef9-b2b8-d14bea29d3e1\n", + "10 rearWheel_1 f8bb2e98-a0e8-468f-9e78-0a391dfb927f\n", + "11 frontWheel_2 ba3e13d6-bb9f-4ec3-851a-7699e9839d38\n", + "12 rearWheel 5af0fa89-4f22-4b69-a022-9a342f0089b2\n", + "13 rearAxleAssembly 8435855c-96a1-489b-afc8-ba2e01b9deab\n", + "14 rearWheel_2 c15818e7-2edf-48f8-a04e-6900f3c13958\n", + "15 frontAxleAssembly_c1 0e27013b-240d-44e5-bee9-d2bc949651ea" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Query vehicle1 (PartUsage) in the \n", + "query_input = {\n", + " '@type':'Query',\n", + " 'select': ['name','@id','@type','owner'],\n", + " 'where': {\n", + " '@type': 'CompositeConstraint',\n", + " 'operator': 'and',\n", + " 'constraint': [\n", + " {\n", + " '@type': 'PrimitiveConstraint',\n", + " 'inverse': False,\n", + " 'operator': '=',\n", + " 'property': '@type',\n", + " 'value': 'PartUsage'\n", + " }\n", + " ]\n", + " }\n", + "}\n", + "\n", + "payload = json.dumps(query_input)\n", + "\n", + "vehicle1_id = ''\n", + "query_url = f\"{host}/projects/{parts_tree_project_id}/query-results\" \n", + "\n", + "query_response = requests.post(query_url, json=query_input)\n", + "\n", + "if query_response.status_code == 200:\n", + " query_response_json = query_response.json()\n", + " \n", + " df = pd.DataFrame({'Part Usage Name':[], 'Part Usage ID':[]})\n", + " for p in query_response_json:\n", + " df = pd.concat([df, pd.DataFrame({'Part Usage Name':[p['name']], 'Part Usage ID':[p['@id']]})], ignore_index=True)\n", + " display(df)" + ] + }, + { + "cell_type": "markdown", + "id": "004deca6-4832-4352-a682-dddbb2f92127", + "metadata": {}, + "source": [ + "## Query to find Part Usage with name vehicle1" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "3d724e27", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{'@id': '149effb8-9cfb-4f55-80db-a984830eec55',\n", + " '@type': 'PartUsage',\n", + " 'name': 'vehicle1',\n", + " 'owner': {'@id': 'ccc70fb3-8bba-40c1-aa18-b9c2ed15b041'}}]\n" + ] + } + ], + "source": [ + "# Query vehicle1 (PartUsage) in the \n", + "data = {\n", + " '@type':'Query',\n", + " 'select': ['name','@id','@type','owner'],\n", + " 'where': {\n", + " '@type': 'CompositeConstraint',\n", + " 'operator': 'and',\n", + " 'constraint': [\n", + " {\n", + " '@type': 'PrimitiveConstraint',\n", + " 'inverse': False,\n", + " 'operator': '=',\n", + " 'property': 'name',\n", + " 'value': 'vehicle1'\n", + " },\n", + " {\n", + " '@type': 'PrimitiveConstraint',\n", + " 'inverse': False,\n", + " 'operator': '=',\n", + " 'property': '@type',\n", + " 'value': 'PartUsage'\n", + " }\n", + " ]\n", + " }\n", + "}\n", + "\n", + "payload = json.dumps(data)\n", + "\n", + "vehicle1_id = ''\n", + "query_url = f\"{host}/projects/{parts_tree_project_id}/query-results\" \n", + "\n", + "query_response = requests.post(query_url, json=data)\n", + "\n", + "if query_response.status_code == 200:\n", + " query_response_json = query_response.json()\n", + " pprint(query_response_json)\n", + " vehicle1_id = query_response_json[0]['@id']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bd2276aa", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From c279cc3ff4b4354a97c4a8299131d2e73d998927 Mon Sep 17 00:00:00 2001 From: Manas Bajaj Date: Thu, 21 Jul 2022 16:35:15 -0400 Subject: [PATCH 4/5] Updated Readme - adding Queries recipe --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 4f665fe..bda3c1b 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,20 @@ The SysML v2 API Cookbook repository is a collection of API recipes to demonstrate patterns and examples for using the [SysML v2 API & Services](https://github.com/Systems-Modeling/SysML-v2-API-Services). In the current release, the cookbook contains recipes that use the SysML v2 REST/HTTP API (PSM). Each recipe is a [Jupyter notebook](https://jupyter.org/) with a sequence of API calls to the SysML v2 REST/HTTP API. + +## Description of recipes + +### Requirement, Structure, Behavior decomposition recipe +This recipe shows patterns and examples for navigating the decomposition of requirements, structure, and behavior elements using the SysML v2 API. The SysML v2 meta-model has harmonized the concepts related to element decomposition and the same concepts are used when decomposing requirements, structure, and behavior releated elements. This recipe shows the use of a common recursive function to navigate the decomposition of requirements, structure, and behavior elements. + +See the Jupyter notebook **Req_Str_Beh_Decomposition_Recipe.ipynb** for details. + +### Project, Commit, Branch, and Tag recipe +This recipe shows patterns and examples for fetching and creating commits, branches, and tags in a project. It shows an example scenario for SysML v2 project evolution over time with concurrent users working on different branches, creating new commits, and creating tags for baseline or milestone releases of the project. + +See the Jupyter notebook **Project_Commit_Branch_Tag_Recipe.ipynb** for details. + +### Queries recipe +This recipe shows patterns and examples for formulating and executing queries in a project. + +See the Jupyter notebook **Project_Commit_Branch_Tag_Recipe.ipynb** for details. From 425f31563e61062080fd9e8671b8791700cce83d Mon Sep 17 00:00:00 2001 From: Manas Bajaj Date: Thu, 21 Jul 2022 16:36:08 -0400 Subject: [PATCH 5/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bda3c1b..90b65e5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,6 @@ This recipe shows patterns and examples for fetching and creating commits, branc See the Jupyter notebook **Project_Commit_Branch_Tag_Recipe.ipynb** for details. ### Queries recipe -This recipe shows patterns and examples for formulating and executing queries in a project. +This recipe shows patterns and examples for formulating and executing queries in a project. Examples show queries with multiple constraints. -See the Jupyter notebook **Project_Commit_Branch_Tag_Recipe.ipynb** for details. +See the Jupyter notebook **Queries.ipynb** for details.