From 6dc2b15338d92c9dca278116bd9a7c59fd838836 Mon Sep 17 00:00:00 2001 From: Eric Kansa Date: Mon, 28 Aug 2023 13:53:00 -0700 Subject: [PATCH 1/4] Added requirement for graph identification in resource PUT --- docs/developing/reference/api.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/developing/reference/api.txt b/docs/developing/reference/api.txt index f584a8fb..2723fd3c 100644 --- a/docs/developing/reference/api.txt +++ b/docs/developing/reference/api.txt @@ -495,9 +495,13 @@ Resources } } -.. http:put:: /resources/{uuid:resouce instance id} +.. http:put:: /resources/{uuid: graph id}/{uuid:resource instance id} (or) PUT /resources/{string: graph slug}/{uuid:resource instance id} - updates a single resource instance + .. note:: + To get or set the slug for the graph, navigate to the root node of the :ref:`Graph Designer`. + + + Updates a single resource instance :query format: {"json-ld", "arches-json"} :query indent: number of spaces to indent json output From d726c0f1e76039c57fe578fe127d23f0671f3abd Mon Sep 17 00:00:00 2001 From: Eric Kansa Date: Mon, 28 Aug 2023 18:08:06 -0700 Subject: [PATCH 2/4] Fixed example to include the graph-id --- docs/developing/reference/api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developing/reference/api.txt b/docs/developing/reference/api.txt index 2723fd3c..41272ea0 100644 --- a/docs/developing/reference/api.txt +++ b/docs/developing/reference/api.txt @@ -512,7 +512,7 @@ Resources .. code-block:: none - curl -H "Authorization: Bearer {token}" -X PUT -d {data in json-ld format} http://localhost:8000/resources/{resource instance id} + curl -H "Authorization: Bearer {token}" -X PUT -d {data in json-ld format} http://localhost:8000/resources//{uuid: graph id}/{resource instance id} curl -H "Authorization: Bearer zo41Q1IMgAW30xOroiCUxjv3yci8Os" -X PUT \ -d '{ From 211b44f597900c014db32f03d178544deca2a933 Mon Sep 17 00:00:00 2001 From: Eric Kansa Date: Mon, 28 Aug 2023 18:08:41 -0700 Subject: [PATCH 3/4] Removed double slash typo --- docs/developing/reference/api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developing/reference/api.txt b/docs/developing/reference/api.txt index 41272ea0..ab9c2712 100644 --- a/docs/developing/reference/api.txt +++ b/docs/developing/reference/api.txt @@ -512,7 +512,7 @@ Resources .. code-block:: none - curl -H "Authorization: Bearer {token}" -X PUT -d {data in json-ld format} http://localhost:8000/resources//{uuid: graph id}/{resource instance id} + curl -H "Authorization: Bearer {token}" -X PUT -d {data in json-ld format} http://localhost:8000/resources/{uuid: graph id}/{resource instance id} curl -H "Authorization: Bearer zo41Q1IMgAW30xOroiCUxjv3yci8Os" -X PUT \ -d '{ From 54d2594d24b2aab9d5093531f6ce94b6b12796e9 Mon Sep 17 00:00:00 2001 From: Eric Kansa Date: Tue, 29 Aug 2023 14:39:50 -0700 Subject: [PATCH 4/4] Improved PUT resource slug formatting --- docs/developing/reference/api.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/developing/reference/api.txt b/docs/developing/reference/api.txt index ab9c2712..f2bd5e66 100644 --- a/docs/developing/reference/api.txt +++ b/docs/developing/reference/api.txt @@ -495,10 +495,12 @@ Resources } } -.. http:put:: /resources/{uuid: graph id}/{uuid:resource instance id} (or) PUT /resources/{string: graph slug}/{uuid:resource instance id} +.. http:put:: /resources/{uuid: graph id}/{uuid:resource instance id} .. note:: - To get or set the slug for the graph, navigate to the root node of the :ref:`Graph Designer`. + Instead of identifying a graph by a UUID, one can also identify a graph by by a slug identifier. + To get or set the slug for the graph, navigate to the root node of the :ref:`Graph Designer`. A request using a slug identifier for a graph looks like: + ``PUT /resources/{string: graph slug}/{uuid:resource instance id}`` Updates a single resource instance @@ -512,7 +514,7 @@ Resources .. code-block:: none - curl -H "Authorization: Bearer {token}" -X PUT -d {data in json-ld format} http://localhost:8000/resources/{uuid: graph id}/{resource instance id} + curl -H "Authorization: Bearer {token}" -X PUT -d {data in json-ld format} http://localhost:8000/resources/{graph id}/{resource instance id} curl -H "Authorization: Bearer zo41Q1IMgAW30xOroiCUxjv3yci8Os" -X PUT \ -d '{