From d8cab238d36c7678523a4c44533c7f9f4c33d872 Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 17 Feb 2025 15:28:48 +0100 Subject: [PATCH 01/27] Added first test cases for init --- .github/workflows/Build-test-spec.yml | 29 +++++++++++++ 04-tests.bs | 61 +++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/Build-test-spec.yml create mode 100644 04-tests.bs diff --git a/.github/workflows/Build-test-spec.yml b/.github/workflows/Build-test-spec.yml new file mode 100644 index 0000000..acf7f18 --- /dev/null +++ b/.github/workflows/Build-test-spec.yml @@ -0,0 +1,29 @@ +name: Build TREE discovery spec +on: + workflow_dispatch: {} + pull_request: {} + push: + branches: [master] +jobs: + main: + name: Build, Validate and Deploy + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - uses: w3c/spec-prod@v2 + with: + TOOLCHAIN: bikeshed + + # Modify as appropriate + GH_PAGES_BRANCH: gh-pages + + # if your doc isn’t in the root folder, + # or Bikeshed otherwise can’t find it: + SOURCE: 04-tests.bs + + # output filename defaults to your input + # with .html extension instead, + # but if you want to customize it: + DESTINATION: tests.html diff --git a/04-tests.bs b/04-tests.bs new file mode 100644 index 0000000..54e1408 --- /dev/null +++ b/04-tests.bs @@ -0,0 +1,61 @@ +
+Title: TREE client tests
+Shortname: tests
+Level: 1
+Status: w3c/CG-DRAFT
+Markup Shorthands: markdown yes
+URL: https://w3id.org/tree/specification/tests
+Repository: https://github.com/treecg/specification
+Mailing List: public-treecg@w3.org
+Mailing List Archives: https://lists.w3.org/Archives/Public/public-treecg/
+Editor: Pieter Colpaert, https://pietercolpaert.be
+Abstract:
+	A set of tests for testing compliance of clients to the TREE specification.
+
+ +# Tests # {#overview} + +## 01. Initialization ## {#01} + +This test is about a function `initialization(url)`. The function will return a the collection and the URL of the root node. + +We’ll test this with various URLs containing different contents. + +### 01.1 The URL to a rootnode without redirects ### {#01.1} + +File url `test01.1.ttl` + +```turtle +@prefix tree: . + tree:view . +``` + +Returns: + * Collection: + * Root node: + +### 01.2 The URL to a collection without redirects ### {#01.2} + +File url `test01.2.ttl#collection` + +```turtle +@prefix tree: . + tree:view . +``` + +Returns: + * Collection: + * Root node: + +### 01.3 The URL to a rootnode before redirects ### {#01.1} + +File url `test01.3` should redirect to `test01.3.ttl` + +```turtle +@prefix tree: . + tree:view . +``` + +Returns: + * Collection: + * Root node: From 1f4f7a2fc7c06489229a9c3519310ae7c1f164ad Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 17 Feb 2025 15:30:01 +0100 Subject: [PATCH 02/27] Correct title --- .github/workflows/Build-test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build-test-spec.yml b/.github/workflows/Build-test-spec.yml index acf7f18..b6df631 100644 --- a/.github/workflows/Build-test-spec.yml +++ b/.github/workflows/Build-test-spec.yml @@ -1,4 +1,4 @@ -name: Build TREE discovery spec +name: Build TREE tests spec on: workflow_dispatch: {} pull_request: {} From 85b979a1123c57e826a7dba88262251dc00ce881 Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 17 Feb 2025 15:33:19 +0100 Subject: [PATCH 03/27] Minor fixes --- 04-tests.bs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 54e1408..11a6238 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -31,8 +31,8 @@ File url `test01.1.ttl` ``` Returns: - * Collection: - * Root node: + * Collection: `` + * Root node: `` ### 01.2 The URL to a collection without redirects ### {#01.2} @@ -44,10 +44,10 @@ File url `test01.2.ttl#collection` ``` Returns: - * Collection: - * Root node: + * Collection: `` + * Root node: `` -### 01.3 The URL to a rootnode before redirects ### {#01.1} +### 01.3 The URL to a rootnode before redirects ### {#01.3} File url `test01.3` should redirect to `test01.3.ttl` @@ -57,5 +57,5 @@ File url `test01.3` should redirect to `test01.3.ttl` ``` Returns: - * Collection: - * Root node: + * Collection: `` + * Root node: `` From 2c00a26cf2cb0be8fa935f62dda4244c63dc8cc8 Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 24 Feb 2025 15:25:24 +0100 Subject: [PATCH 04/27] Test cases further worked out --- 04-tests.bs | 95 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 81 insertions(+), 14 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 11a6238..09d5d50 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -15,47 +15,114 @@ Abstract: # Tests # {#overview} -## 01. Initialization ## {#01} +## 1. Initialization ## {#1} + +Purpose: Ensuring that it is unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. This test is about a function `initialization(url)`. The function will return a the collection and the URL of the root node. We’ll test this with various URLs containing different contents. -### 01.1 The URL to a rootnode without redirects ### {#01.1} +### 1.1 The URL to a rootnode without redirects ### {#1.1} -File url `test01.1.ttl` +File url `test1.1.ttl` ```turtle @prefix tree: . - tree:view . + tree:view . ``` Returns: * Collection: `` - * Root node: `` + * Root node: `` -### 01.2 The URL to a collection without redirects ### {#01.2} +### 1.2 The URL to a collection without redirects ### {#1.2} -File url `test01.2.ttl#collection` +File url `test1.2.ttl#collection` ```turtle @prefix tree: . - tree:view . + tree:view . ``` Returns: - * Collection: `` - * Root node: `` + * Collection: `` + * Root node: `` -### 01.3 The URL to a rootnode before redirects ### {#01.3} +### 1.3 The URL to a rootnode before redirects ### {#1.3} -File url `test01.3` should redirect to `test01.3.ttl` +File url `test1.3` should redirect to `test1.3.ttl` ```turtle @prefix tree: . - tree:view . + tree:view . ``` Returns: * Collection: `` - * Root node: `` + * Root node: `` + +TODO: Search forms + +## 2. Members ## {#2} + +Goal: Once we have the container URL, we must ensure we know what the members of the collection mentioned in this page are. + +### 2.1 Finding member IRIs ### {#2.1} + +File url `` + +Operation: Finding the set of members in ``. + +```turtle +@prefix tree: . + tree:view ; + tree:member , , _:b0 . +``` + +Returns: + * 2 member identifiers ``, `` and a blank node member. + +### 2.2 Empty page ### {#2.2} + +File url `` + +Operation: Finding the set of members in ``. + +```turtle +@prefix tree: . + tree:view . +``` + +Returns: an empty set. + +## 3. Extracting members ## {#3} + +Goal: Checking whether your implementation will extract the right set of quads + + +### 3.1 Star pattern ### {#3.1} + +File url `` + +Operation: Finding all quads that belong to ``. + +```turtle +@prefix tree: . +@prefix ex: . + tree:view ; + tree:member . + ex:p ex:o . +``` + +Returns: an array with 1 quad ` ex:p ex:o`. + +TODO: take more tests from the extract cbd shape repository + +## 4. Pruning relations ## {#4} + +TODO: These test cases will get more complex + +## 5. Using search forms ## {#5} + +TODO: Search forms \ No newline at end of file From d41525288f88102d94da3b2547277b20ffdc495e Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 3 Mar 2025 14:19:15 +0100 Subject: [PATCH 05/27] Remove chapter numbers --- 04-tests.bs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 09d5d50..b0336ba 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -15,7 +15,7 @@ Abstract: # Tests # {#overview} -## 1. Initialization ## {#1} +## Initialization ## {#1} Purpose: Ensuring that it is unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. @@ -23,7 +23,7 @@ This test is about a function `initialization(url)`. The function will return a We’ll test this with various URLs containing different contents. -### 1.1 The URL to a rootnode without redirects ### {#1.1} +### The URL to a rootnode without redirects ### {#1.1} File url `test1.1.ttl` @@ -36,7 +36,7 @@ Returns: * Collection: `` * Root node: `` -### 1.2 The URL to a collection without redirects ### {#1.2} +### The URL to a collection without redirects ### {#1.2} File url `test1.2.ttl#collection` @@ -49,7 +49,7 @@ Returns: * Collection: `` * Root node: `` -### 1.3 The URL to a rootnode before redirects ### {#1.3} +### The URL to a rootnode before redirects ### {#1.3} File url `test1.3` should redirect to `test1.3.ttl` @@ -64,11 +64,11 @@ Returns: TODO: Search forms -## 2. Members ## {#2} +## Members ## {#2} Goal: Once we have the container URL, we must ensure we know what the members of the collection mentioned in this page are. -### 2.1 Finding member IRIs ### {#2.1} +### Finding member IRIs ### {#2.1} File url `` @@ -83,7 +83,7 @@ Operation: Finding the set of members in ``. Returns: * 2 member identifiers ``, `` and a blank node member. -### 2.2 Empty page ### {#2.2} +### Empty page ### {#2.2} File url `` @@ -96,12 +96,12 @@ Operation: Finding the set of members in ``. Returns: an empty set. -## 3. Extracting members ## {#3} +## Extracting members ## {#3} Goal: Checking whether your implementation will extract the right set of quads -### 3.1 Star pattern ### {#3.1} +### Star pattern ### {#3.1} File url `` @@ -119,10 +119,10 @@ Returns: an array with 1 quad ` ex:p ex:o`. TODO: take more tests from the extract cbd shape repository -## 4. Pruning relations ## {#4} +## Pruning relations ## {#4} TODO: These test cases will get more complex -## 5. Using search forms ## {#5} +## Using search forms ## {#5} TODO: Search forms \ No newline at end of file From 8c2e50b6c8d4539c8a34998b9f5e8a7bc8e43b1d Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 31 Mar 2025 12:24:44 +0200 Subject: [PATCH 06/27] Update 04-tests.bs Co-authored-by: Ieben Smessaert --- 04-tests.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-tests.bs b/04-tests.bs index b0336ba..1c517d8 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -17,7 +17,7 @@ Abstract: ## Initialization ## {#1} -Purpose: Ensuring that it is unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. +Purpose: Ensuring that there is an unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. This test is about a function `initialization(url)`. The function will return a the collection and the URL of the root node. From cb1c0f564c2cbef5962c208a182f158368f41496 Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 31 Mar 2025 12:24:54 +0200 Subject: [PATCH 07/27] Update 04-tests.bs Co-authored-by: Ieben Smessaert --- 04-tests.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-tests.bs b/04-tests.bs index 1c517d8..4656e64 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -19,7 +19,7 @@ Abstract: Purpose: Ensuring that there is an unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. -This test is about a function `initialization(url)`. The function will return a the collection and the URL of the root node. +This test is about a function `initialization(url)`. The function will return the URL of the collection and the URL of the root node. We’ll test this with various URLs containing different contents. From d8919afd3eebfb3682061fec3e2b15650b384b81 Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 31 Mar 2025 12:26:36 +0200 Subject: [PATCH 08/27] Apply suggestions from code review Co-authored-by: Ieben Smessaert --- 04-tests.bs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/04-tests.bs b/04-tests.bs index 4656e64..57f3ca2 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -25,7 +25,9 @@ We’ll test this with various URLs containing different contents. ### The URL to a rootnode without redirects ### {#1.1} -File url `test1.1.ttl` +**Test:** Initializing with the URL to a rootnode without redirects returns the Collection URL and Root node URL + +File URL `test1.1.ttl` ```turtle @prefix tree: . From 8f7835ff8b7986a5f5210de2a256b7d83c902fa2 Mon Sep 17 00:00:00 2001 From: Pieter Colpaert Date: Mon, 31 Mar 2025 12:53:11 +0200 Subject: [PATCH 09/27] Further tests based on code review --- 04-tests.bs | 73 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 57f3ca2..bdce8bc 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -8,63 +8,88 @@ URL: https://w3id.org/tree/specification/tests Repository: https://github.com/treecg/specification Mailing List: public-treecg@w3.org Mailing List Archives: https://lists.w3.org/Archives/Public/public-treecg/ -Editor: Pieter Colpaert, https://pietercolpaert.be +Editor: + - Pieter Colpaert, https://pietercolpaert.be + - Xueying Deng Abstract: A set of tests for testing compliance of clients to the TREE specification. # Tests # {#overview} +In the test snippets below, the URL will always be relative. You can decide your own base IRI for all of the HTTP requests and relative IRIs in your test framework. + ## Initialization ## {#1} Purpose: Ensuring that there is an unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. This test is about a function `initialization(url)`. The function will return the URL of the collection and the URL of the root node. -We’ll test this with various URLs containing different contents. +We will test this with various URLs containing different contents. -### The URL to a rootnode without redirects ### {#1.1} +### The URL to a root node without redirects ### {#1.1} -**Test:** Initializing with the URL to a rootnode without redirects returns the Collection URL and Root node URL +**Test:** Initializing with the URL to a root node without redirects returns the Collection URL and Root node URL. -File URL `test1.1.ttl` +File URL `test1.1.ttl`. ```turtle @prefix tree: . tree:view . ``` -Returns: +The test executes an HTTP request to `test1.1.ttl`. The algorithm returns: * Collection: `` * Root node: `` ### The URL to a collection without redirects ### {#1.2} -File url `test1.2.ttl#collection` +**Test:** Initializing with the URL to a collection IRI without redirects returns the Collection IRI and root node URL. + +Contents of the file `test1.2.ttl`: ```turtle @prefix tree: . - tree:view . + tree:view . ``` -Returns: - * Collection: `` +The test executes an HTTP request to `test1.2.ttl#Collection`. The algorithm returns: + * Collection: `` * Root node: `` -### The URL to a rootnode before redirects ### {#1.3} +### The URL to a root node before redirects ### {#1.3} + +**Test:** Initializing with the URL to a collection IRI that results in a redirect, still returns the Collection IRI and root node URL. -File url `test1.3` should redirect to `test1.3.ttl` +File url `test1.3` that provides a `303 See Other` redirect to `test1.3.ttl`. ```turtle @prefix tree: . tree:view . ``` -Returns: +The test executes an HTTP request to `test1.3`. The algorithm returns: * Collection: `` * Root node: `` -TODO: Search forms +The same test MUST be repeated with a `301` response code. + +### The URL that does not match ### {#1.4} + +**Test:** Initializing with a URL that does not match a collection or a root node must result into an exception. + +File url `test1.4.ttl`: + +```turtle +@prefix tree: . + tree:view . +``` + +The test executes an HTTP request to `test1.4.ttl#NonExistingNodeOrCollection`. The algorithm returns an exception that indicates the requested root node or collection is not described in the response. + +### Search Forms ### {#1.x} + +This is yet to be defined: the search forms should also be extracted. ## Members ## {#2} @@ -72,9 +97,9 @@ Goal: Once we have the container URL, we must ensure we know what the members of ### Finding member IRIs ### {#2.1} -File url `` +**Test:** Finding both named node and blank node member terms in a page. -Operation: Finding the set of members in ``. +File url `` contains: ```turtle @prefix tree: . @@ -82,21 +107,19 @@ Operation: Finding the set of members in ``. tree:member , , _:b0 . ``` -Returns: - * 2 member identifiers ``, `` and a blank node member. +The test suite executes the function to find all member identifiers in the page `` of the collection `` and returns 2 member identifiers ``, `` and a blank node member. ### Empty page ### {#2.2} -File url `` +**Test:** Finding no member terms in a page when there are none. -Operation: Finding the set of members in ``. +File url `` ```turtle @prefix tree: . tree:view . ``` - -Returns: an empty set. +The test to find the set of members in the page `` of the collection `` returns an empty set. ## Extracting members ## {#3} @@ -105,6 +128,8 @@ Goal: Checking whether your implementation will extract the right set of quads ### Star pattern ### {#3.1} +**Test:** Finding all quads that belong to a member based on a simple star pattern. + File url `` Operation: Finding all quads that belong to ``. @@ -119,7 +144,7 @@ Operation: Finding all quads that belong to ``. Returns: an array with 1 quad ` ex:p ex:o`. -TODO: take more tests from the extract cbd shape repository +TODO: take more tests from the [extract cbd shape repository](https://github.com/TREEcg/extract-cbd-shape) ## Pruning relations ## {#4} @@ -127,4 +152,4 @@ TODO: These test cases will get more complex ## Using search forms ## {#5} -TODO: Search forms \ No newline at end of file +TODO: Search forms From 5a5af5ff9ab7a3ec46960152069f69d0c2b16dce Mon Sep 17 00:00:00 2001 From: Xueying Deng Date: Thu, 22 May 2025 16:11:22 +0200 Subject: [PATCH 10/27] feat: update test specification - Restructured the documentation to create a narrative. - Addressed my concern regarding the comment left in [issue #141](https://github.com/TREEcg/specification/issues/141), questioning whether this specification is ONLY focused on client behavior. - OFC, a work in progress --- 04-tests.bs | 57 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index bdce8bc..300630d 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -1,5 +1,5 @@ +# Overview # {#overview} -# Tests # {#overview} +The TREE specification follows the [RFC 2119](https://www.rfc-editor.org/rfc2119.txt) norms for defining conformance requirements. +This document lists all conformance points from the TREE specification, and provides corresponding test cases, test environments, and expected results for implementations. + + +## Conformance ## {#conformance} + +The conformance points in this document are based on the [TREE specification](https://w3c.github.io/treecg/specification/) and are intended for testing implementations of the TREE specification. +Conformance points are divided into two categories: **MUST** and **SHOULD**. + +Each conformance point is described in detail, including the expected behavior of the implementation and the test cases used to verify compliance. + +- **MUST** conformance points are mandatory for all implementations. Implementations that do not meet these requirements are not considered compliant with the specification. +- **SHOULD** conformance points are optional but recommended. Implementations that do not meet these requirements may still be considered compliant, but may not provide the same level of functionality or interoperability. + + +## MUST Conformance Points## {#must} + + -## Initialization ## {#1} +### Initialization ### {#1} Purpose: Ensuring that there is an unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. @@ -27,7 +50,7 @@ This test is about a function `initialization(url)`. The function will return th We will test this with various URLs containing different contents. -### The URL to a root node without redirects ### {#1.1} +#### The URL to a root node without redirects #### {#1.1} **Test:** Initializing with the URL to a root node without redirects returns the Collection URL and Root node URL. @@ -42,7 +65,7 @@ The test executes an HTTP request to `test1.1.ttl`. The algorithm returns: * Collection: `` * Root node: `` -### The URL to a collection without redirects ### {#1.2} +#### The URL to a collection without redirects #### {#1.2} **Test:** Initializing with the URL to a collection IRI without redirects returns the Collection IRI and root node URL. @@ -57,7 +80,7 @@ The test executes an HTTP request to `test1.2.ttl#Collection`. The algorithm ret * Collection: `` * Root node: `` -### The URL to a root node before redirects ### {#1.3} +#### The URL to a root node before redirects #### {#1.3} **Test:** Initializing with the URL to a collection IRI that results in a redirect, still returns the Collection IRI and root node URL. @@ -74,7 +97,7 @@ The test executes an HTTP request to `test1.3`. The algorithm returns: The same test MUST be repeated with a `301` response code. -### The URL that does not match ### {#1.4} +#### The URL that does not match #### {#1.4} **Test:** Initializing with a URL that does not match a collection or a root node must result into an exception. @@ -87,15 +110,15 @@ File url `test1.4.ttl`: The test executes an HTTP request to `test1.4.ttl#NonExistingNodeOrCollection`. The algorithm returns an exception that indicates the requested root node or collection is not described in the response. -### Search Forms ### {#1.x} +#### Search Forms #### {#1.x} This is yet to be defined: the search forms should also be extracted. -## Members ## {#2} +### Members ## {#2} Goal: Once we have the container URL, we must ensure we know what the members of the collection mentioned in this page are. -### Finding member IRIs ### {#2.1} +#### Finding member IRIs #### {#2.1} **Test:** Finding both named node and blank node member terms in a page. @@ -109,7 +132,7 @@ File url `` contains: The test suite executes the function to find all member identifiers in the page `` of the collection `` and returns 2 member identifiers ``, `` and a blank node member. -### Empty page ### {#2.2} +#### Empty page #### {#2.2} **Test:** Finding no member terms in a page when there are none. @@ -121,12 +144,12 @@ File url `` ``` The test to find the set of members in the page `` of the collection `` returns an empty set. -## Extracting members ## {#3} +### Extracting members ### {#3} Goal: Checking whether your implementation will extract the right set of quads -### Star pattern ### {#3.1} +#### Star pattern #### {#3.1} **Test:** Finding all quads that belong to a member based on a simple star pattern. @@ -146,10 +169,10 @@ Returns: an array with 1 quad ` ex:p ex:o`. TODO: take more tests from the [extract cbd shape repository](https://github.com/TREEcg/extract-cbd-shape) -## Pruning relations ## {#4} +### Pruning relations ### {#4} TODO: These test cases will get more complex -## Using search forms ## {#5} +### Using search forms ### {#5} TODO: Search forms From 6d213bee21e97e2e2c4af56f91921a43d08c1060 Mon Sep 17 00:00:00 2001 From: Xueying Deng Date: Thu, 19 Jun 2025 16:37:11 +0200 Subject: [PATCH 11/27] Update 04-tests.bs --- 04-tests.bs | 219 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 131 insertions(+), 88 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 300630d..4430029 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -22,157 +22,200 @@ This document lists all conformance points from the TREE specification, and prov ## Conformance ## {#conformance} The conformance points in this document are based on the [TREE specification](https://w3c.github.io/treecg/specification/) and are intended for testing implementations of the TREE specification. + +As TREE is based on hypermedia, the conformance is designed for HTTP-based implementation, the test cases are designed to be executed over HTTP(s), and the expected results are based on the HTTP(s) responses. + Conformance points are divided into two categories: **MUST** and **SHOULD**. -Each conformance point is described in detail, including the expected behavior of the implementation and the test cases used to verify compliance. +Each conformance point is described in detail, including the expected behavior of the implementation. The test cases used to verify compliance are also provided. - **MUST** conformance points are mandatory for all implementations. Implementations that do not meet these requirements are not considered compliant with the specification. - **SHOULD** conformance points are optional but recommended. Implementations that do not meet these requirements may still be considered compliant, but may not provide the same level of functionality or interoperability. - + ## MUST Conformance Points## {#must} +### TREE basic elements ### {#1.1} + +- When there is a `tree:view` in the payload of the current HTTP response, the subject of the `tree:view` must be a `tree:Collection` + +```turtle +@prefix sh: . +@prefix tree: . +@prefix rdf: . + +# SHACL Node Shape to validate that any subject having tree:view must be a tree:Collection + +<#TreeViewSubjectMustBeCollectionShape> + a sh:NodeShape ; + sh:targetSubjectsOf tree:view ; + sh:property [ + sh:path rdf:type ; + sh:hasValue tree:Collection ; + sh:message "Subjects that have a tree:view must be a tree:Collection." ; + ] . + +``` + +- When there is a `tree:member` in the payload of the current HTTP response, the subject of the `tree:member` must be a `tree:Collection` or a `tree:RootNode` +- When there is a `tree:Relation` in the payload of the current HTTP response, the subject of the `tree:Relation` must also point to a `tree:path` + +### Initialization ### {#1.2} +### The member extraction algorithm ### {#1.3} +### Traversing the search tree ### {#1.4} +### Pruning branches ### {#1.5} + + + +## SHOULD Conformance Points## {#must} + +### Initialization ### {#2.1} +### The member extraction algorithm ### {#2.2} +### Traversing the search tree ### {#2.3} +### Pruning branches ### {#2.4} + +// In the test snippets below, the URL will always be relative. You can decide your own base IRI for all of the HTTP requests and relative IRIs in your test framework. -### Initialization ### {#1} -Purpose: Ensuring that there is an unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. +// ### Initialization ### {#1} -This test is about a function `initialization(url)`. The function will return the URL of the collection and the URL of the root node. +// Purpose: Ensuring that there is an unambiguous yet user friendly way of knowing the identifier of the collection, as well as the current page of the collection’s view. -We will test this with various URLs containing different contents. +// This test is about a function `initialization(url)`. The function will return the URL of the collection and the URL of the root node. -#### The URL to a root node without redirects #### {#1.1} +// We will test this with various URLs containing different contents. -**Test:** Initializing with the URL to a root node without redirects returns the Collection URL and Root node URL. +// #### The URL to a root node without redirects #### {#1.1} -File URL `test1.1.ttl`. +// **Test:** Initializing with the URL to a root node without redirects returns the Collection URL and Root node URL. -```turtle -@prefix tree: . - tree:view . -``` +// File URL `test1.1.ttl`. -The test executes an HTTP request to `test1.1.ttl`. The algorithm returns: - * Collection: `` - * Root node: `` +// ```turtle +// @prefix tree: . +// tree:view . +// ``` -#### The URL to a collection without redirects #### {#1.2} +// The test executes an HTTP request to `test1.1.ttl`. The algorithm returns: +// * Collection: `` +// * Root node: `` -**Test:** Initializing with the URL to a collection IRI without redirects returns the Collection IRI and root node URL. +// #### The URL to a collection without redirects #### {#1.2} -Contents of the file `test1.2.ttl`: +// **Test:** Initializing with the URL to a collection IRI without redirects returns the Collection IRI and root node URL. -```turtle -@prefix tree: . - tree:view . -``` +// Contents of the file `test1.2.ttl`: -The test executes an HTTP request to `test1.2.ttl#Collection`. The algorithm returns: - * Collection: `` - * Root node: `` +// ```turtle +// @prefix tree: . +// tree:view . +// ``` -#### The URL to a root node before redirects #### {#1.3} +// The test executes an HTTP request to `test1.2.ttl#Collection`. The algorithm returns: +// * Collection: `` +// * Root node: `` -**Test:** Initializing with the URL to a collection IRI that results in a redirect, still returns the Collection IRI and root node URL. +// #### The URL to a root node before redirects #### {#1.3} -File url `test1.3` that provides a `303 See Other` redirect to `test1.3.ttl`. +// **Test:** Initializing with the URL to a collection IRI that results in a redirect, still returns the Collection IRI and root node URL. -```turtle -@prefix tree: . - tree:view . -``` +// File url `test1.3` that provides a `303 See Other` redirect to `test1.3.ttl`. -The test executes an HTTP request to `test1.3`. The algorithm returns: - * Collection: `` - * Root node: `` +// ```turtle +// @prefix tree: . +// tree:view . +// ``` -The same test MUST be repeated with a `301` response code. +// The test executes an HTTP request to `test1.3`. The algorithm returns: +// * Collection: `` +// * Root node: `` -#### The URL that does not match #### {#1.4} +// The same test MUST be repeated with a `301` response code. -**Test:** Initializing with a URL that does not match a collection or a root node must result into an exception. +// #### The URL that does not match #### {#1.4} -File url `test1.4.ttl`: +// **Test:** Initializing with a URL that does not match a collection or a root node must result into an exception. -```turtle -@prefix tree: . - tree:view . -``` +// File url `test1.4.ttl`: -The test executes an HTTP request to `test1.4.ttl#NonExistingNodeOrCollection`. The algorithm returns an exception that indicates the requested root node or collection is not described in the response. +// ```turtle +// @prefix tree: . +// tree:view . +// ``` -#### Search Forms #### {#1.x} +// The test executes an HTTP request to `test1.4.ttl#NonExistingNodeOrCollection`. The algorithm returns an exception that indicates the requested root node or collection is not described in the response. -This is yet to be defined: the search forms should also be extracted. +// #### Search Forms #### {#1.x} -### Members ## {#2} +// This is yet to be defined: the search forms should also be extracted. -Goal: Once we have the container URL, we must ensure we know what the members of the collection mentioned in this page are. +// ### Members ## {#2} -#### Finding member IRIs #### {#2.1} +// Goal: Once we have the container URL, we must ensure we know what the members of the collection mentioned in this page are. -**Test:** Finding both named node and blank node member terms in a page. +// #### Finding member IRIs #### {#2.1} -File url `` contains: +// **Test:** Finding both named node and blank node member terms in a page. -```turtle -@prefix tree: . - tree:view ; - tree:member , , _:b0 . -``` +// File url `` contains: -The test suite executes the function to find all member identifiers in the page `` of the collection `` and returns 2 member identifiers ``, `` and a blank node member. +// ```turtle +// @prefix tree: . +// tree:view ; +// tree:member , , _:b0 . +// ``` -#### Empty page #### {#2.2} +// The test suite executes the function to find all member identifiers in the page `` of the collection `` and returns 2 member identifiers ``, `` and a blank node member. -**Test:** Finding no member terms in a page when there are none. +// #### Empty page #### {#2.2} -File url `` +// **Test:** Finding no member terms in a page when there are none. -```turtle -@prefix tree: . - tree:view . -``` -The test to find the set of members in the page `` of the collection `` returns an empty set. +// File url `` -### Extracting members ### {#3} +// ```turtle +// @prefix tree: . +// tree:view . +// ``` +// The test to find the set of members in the page `` of the collection `` returns an empty set. -Goal: Checking whether your implementation will extract the right set of quads +// ### Extracting members ### {#3} +// Goal: Checking whether your implementation will extract the right set of quads -#### Star pattern #### {#3.1} -**Test:** Finding all quads that belong to a member based on a simple star pattern. +// #### Star pattern #### {#3.1} -File url `` +// **Test:** Finding all quads that belong to a member based on a simple star pattern. -Operation: Finding all quads that belong to ``. +// File url `` -```turtle -@prefix tree: . -@prefix ex: . - tree:view ; - tree:member . - ex:p ex:o . -``` +// Operation: Finding all quads that belong to ``. + +// ```turtle +// @prefix tree: . +// @prefix ex: . +// tree:view ; +// tree:member . +// ex:p ex:o . +// ``` -Returns: an array with 1 quad ` ex:p ex:o`. +// Returns: an array with 1 quad ` ex:p ex:o`. -TODO: take more tests from the [extract cbd shape repository](https://github.com/TREEcg/extract-cbd-shape) +// TODO: take more tests from the [extract cbd shape repository](https://github.com/TREEcg/extract-cbd-shape) -### Pruning relations ### {#4} +// ### Pruning relations ### {#4} -TODO: These test cases will get more complex +// TODO: These test cases will get more complex -### Using search forms ### {#5} +// ### Using search forms ### {#5} -TODO: Search forms +// TODO: Search forms +--> \ No newline at end of file From 4b3b299aa2d322400eb5bbf718121bb80f101803 Mon Sep 17 00:00:00 2001 From: Xueying Deng Date: Thu, 19 Jun 2025 17:03:09 +0200 Subject: [PATCH 12/27] Update 04-tests.bs --- 04-tests.bs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/04-tests.bs b/04-tests.bs index 4430029..ae75409 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -60,7 +60,33 @@ Each conformance point is described in detail, including the expected behavior o - When there is a `tree:member` in the payload of the current HTTP response, the subject of the `tree:member` must be a `tree:Collection` or a `tree:RootNode` - When there is a `tree:Relation` in the payload of the current HTTP response, the subject of the `tree:Relation` must also point to a `tree:path` -### Initialization ### {#1.2} +### Search TREE ### {#1.2} +- During the construction of the complete RDF graph of the search tree at any point in the traversal, the inbound link to any tree:Node via a tree:Relation can originate from only one other tree:Node. + +```turtle +@prefix sh: . +@prefix tree: . +@prefix ex: . + +ex:NodeInboundUniquenessShape + a sh:NodeShape ; + sh:targetClass tree:Node ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "Each tree:Node must not be the target of more than one tree:Relation.tree:node link from another node." ; + sh:select """ + SELECT ?this (COUNT(?sourceNode) AS ?inboundCount) + WHERE { + ?sourceNode tree:relation ?relation . + ?relation tree:node ?this . + FILTER (?sourceNode != ?this) + } + GROUP BY ?this + HAVING (COUNT(?sourceNode) > 1) + """ ; + ] . + +```` ### The member extraction algorithm ### {#1.3} ### Traversing the search tree ### {#1.4} ### Pruning branches ### {#1.5} From b3b47fb0c4913eeaedd5d9a79d0b14100539b745 Mon Sep 17 00:00:00 2001 From: XD Date: Fri, 20 Jun 2025 14:22:14 +0200 Subject: [PATCH 13/27] Update 04-tests.bs --- 04-tests.bs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index ae75409..670d14b 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -10,7 +10,7 @@ Mailing List: public-treecg@w3.org Mailing List Archives: https://lists.w3.org/Archives/Public/public-treecg/ Editor: - Pieter Colpaert, https://pietercolpaert.be - - Xueying Deng + - Xueying Deng, https://xdxxxdx.github.io/ Abstract: The TREE test specification aims to provide enough resource that for a TREE implementation to be able to test itself against the TREE specification.This test specification will be continuously updated to align with changes and improvements in the TREE specification. # Overview # {#overview} @@ -61,7 +61,7 @@ Each conformance point is described in detail, including the expected behavior o - When there is a `tree:Relation` in the payload of the current HTTP response, the subject of the `tree:Relation` must also point to a `tree:path` ### Search TREE ### {#1.2} -- During the construction of the complete RDF graph of the search tree at any point in the traversal, the inbound link to any tree:Node via a tree:Relation can originate from only one other tree:Node. +- At any point in the TREE, each `tree:Node` may have at most one inbound link via a `tree:Relation` from another `tree:Node`. ```turtle @prefix sh: . @@ -73,7 +73,7 @@ ex:NodeInboundUniquenessShape sh:targetClass tree:Node ; sh:sparql [ a sh:SPARQLConstraint ; - sh:message "Each tree:Node must not be the target of more than one tree:Relation.tree:node link from another node." ; + sh:message "Each tree:Node must not be the target of more than one tree:Relation, tree:node link from another node." ; sh:select """ SELECT ?this (COUNT(?sourceNode) AS ?inboundCount) WHERE { @@ -87,19 +87,20 @@ ex:NodeInboundUniquenessShape ] . ```` -### The member extraction algorithm ### {#1.3} -### Traversing the search tree ### {#1.4} -### Pruning branches ### {#1.5} - - +- Whenever `tree:GreaterThanRelation` is used as a comparator within the TREE, the values pointed by `tree:path` in the members MUST be compared using the rules defined in the [SPARQL algebra functions](https://www.w3.org/TR/sparql11-query/#expressions). + -## Conformance ## {#conformance} +# Conformance Points # {#conformance-points} The conformance points in this document are based on the [TREE specification](https://w3c.github.io/treecg/specification/) and are intended for testing implementations of the TREE specification. -As TREE is based on hypermedia, the conformance is designed for HTTP-based implementation, the test cases are designed to be executed over HTTP(s), and the expected results are based on the HTTP(s) responses. +TREE conformance is designed for HTTP-based implementations; all test cases are expected to be executed over HTTP(s), and results are determined from the HTTP(s) responses. Since TREE is an RDF (Resource Description Framework) specification, all response payloads must use standard RDF serialization formats, such as Turtle, RDF/XML, or JSON-LD. -Conformance points are divided into two categories: **MUST** and **SHOULD**. -Each conformance point is described in detail, including the expected behavior of the implementation. The test cases used to verify compliance are also provided. + -- **MUST** conformance points are mandatory for all implementations. Implementations that do not meet these requirements are not considered compliant with the specification. -- **SHOULD** conformance points are optional but recommended. Implementations that do not meet these requirements may still be considered compliant, but may not provide the same level of functionality or interoperability. + - -## MUST Conformance Points## {#must} +## TREE basic elements ## {#1.1} + +### Subject of `tree:view` must be a `tree:Collection` ### {#1.1.1} +**Description:** When there is a `tree:view` in the payload of the current HTTP(s) response, the subject of the `tree:view` must be a `tree:Collection` + +**SHACL shape against the HTTP(s) response:** +```turtle +@prefix sh: . +@prefix tree: . -### TREE basic elements ### {#1.1} +tree:ViewSubjectConstraintShape + a sh:NodeShape ; + sh:targetSubjectsOf tree:view ; + sh:class tree:Collection ; + sh:message "Subject of tree:view must be a tree:Collection" . -- When there is a `tree:view` in the payload of the current HTTP response, the subject of the `tree:view` must be a `tree:Collection` +``` +### Subject of `tree:member` must be either a `tree:Collection` or a `tree:RootNode` ### {#1.1.2} +**Description:** If a `tree:member` property appears in the payload of the current HTTP(s) response, its subject MUST be either a `tree:Collection` or a `tree:RootNode`. +**SHACL shape against the HTTP(s) response:** ```turtle @prefix sh: . @prefix tree: . -@prefix rdf: . -# SHACL Node Shape to validate that any subject having tree:view must be a tree:Collection +tree:MemberSubjectConstraintShape + a sh:NodeShape ; + sh:targetSubjectsOf tree:member ; + sh:or ( + [ sh:class tree:Collection ] + [ sh:class tree:RootNode ] + ) ; + sh:message "Subject of tree:member must be either a tree:Collection or a tree:RootNode" . + +``` +### `tree:Relation` properties ### {#1.1.3} + +**Description:** If a `tree:Relation` appears in the payload of the current HTTP(s) response, it MUST have a `tree:path` property and a `tree:node` property which pointing to another `tree:Node`. + `tree:Relation` is a superclass for all TREE-supported relation types (such as `tree:GreaterThanRelation`, `tree:LessThanRelation`, `tree:GreaterThanOrEqualToRelation`, etc.). + For the complete list of subclasses of `tree:Relation`, see [tree.ttl](https://github.com/TREEcg/specification/blob/master/tree.ttl). + +**SHACL shape against the HTTP(s) response:** +```turtle +@prefix sh: . +@prefix tree: . -<#TreeViewSubjectMustBeCollectionShape> +tree:RelationConstraintShape a sh:NodeShape ; - sh:targetSubjectsOf tree:view ; + sh:targetClass tree:Relation ; + sh:property [ + sh:path tree:path ; + sh:minCount 1 ; + sh:message "tree:Relation must have a tree:path property" + ] ; sh:property [ - sh:path rdf:type ; - sh:hasValue tree:Collection ; - sh:message "Subjects that have a tree:view must be a tree:Collection." ; + sh:path tree:node ; + sh:minCount 1 ; + sh:class tree:Node ; + sh:message "tree:Relation must have a tree:node property pointing to a tree:Node" ] . +``` + +### Initialization of TREE structure via `tree:view` after dereferencing ### {#1.1.4} +**Description:** When a `tree:view` triple exists in the payload of the final HTTP(s) response (after following all redirects), the final IRI MUST be the object of a `tree:view` triple whose subject is a `tree:Collection`. This ensures that dereferencing a resource leads to a valid TREE view associated with a collection. + +**SHACL shape against the HTTP(s) response:** + +```turtle +@prefix sh: . +@prefix tree: . +tree:ViewObjectConstraintShape + a sh:NodeShape ; + sh:targetObjectsOf tree:view ; + sh:sparql [ + sh:select """ + SELECT $this + WHERE { + ?collection a tree:Collection . + ?collection tree:view $this . + } + """ ; + sh:message "The final IRI must be the object of a tree:view triple whose subject is a tree:Collection" + ] . ``` - -- When there is a `tree:member` in the payload of the current HTTP response, the subject of the `tree:member` must be a `tree:Collection` or a `tree:RootNode` -- When there is a `tree:Relation` in the payload of the current HTTP response, the subject of the `tree:Relation` must also point to a `tree:path` +## Search TREE ## {#1.2} + +### `tree:Node` inbound link uniqueness ### {#1.2.1} +**Description:** During traversal of the TREE structure, each `tree:Node` MUST NOT be the target of more than one inbound `tree:Relation` (i.e., via the `tree:node` property) from a different `tree:Node`. In other words, no `tree:Node` should have more than one parent node. This requirement ensures that the TREE remains a valid tree structure, where each node has at most one parent. -### Search TREE ### {#1.2} -- At any point in the TREE, each `tree:Node` may have at most one inbound link via a `tree:Relation` from another `tree:Node`. +**SHACL shape against the RDF graph:** ```turtle @prefix sh: . @@ -87,24 +146,18 @@ ex:NodeInboundUniquenessShape ] . ```` -- Whenever `tree:GreaterThanRelation` is used as a comparator within the TREE, the values pointed by `tree:path` in the members MUST be compared using the rules defined in the [SPARQL algebra functions](https://www.w3.org/TR/sparql11-query/#expressions). - \ No newline at end of file +--> From ade9082ba0a3687a4da4eb03a46c40e48f52ad8d Mon Sep 17 00:00:00 2001 From: XD Date: Thu, 31 Jul 2025 17:04:49 +0200 Subject: [PATCH 16/27] feat: delete redundancy --- 04-tests.bs | 2 +- 04-tests.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 7df98f1..e65dfe9 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -93,7 +93,7 @@ tree:RelationConstraintShape ``` ### Initialization of TREE structure via `tree:view` after dereferencing ### {#1.1.4} -**Description:** When a `tree:view` triple exists in the payload of the final HTTP(s) response (after following all redirects), the final IRI MUST be the object of a `tree:view` triple whose subject is a `tree:Collection`. This ensures that dereferencing a resource leads to a valid TREE view associated with a collection. +**Description:** When a `tree:view` triple exists in the payload of the final HTTP(s) response (after following all redirects), the final IRI MUST be the object of a `tree:view` triple whose subject is a `tree:Collection`. **SHACL shape against the HTTP(s) response:** diff --git a/04-tests.html b/04-tests.html index 31b14d2..a828852 100644 --- a/04-tests.html +++ b/04-tests.html @@ -8,7 +8,7 @@ - + - - - - - - - -
-

-

-

TREE Test Specification

-

Draft Community Group Report, -

-
- More details about this document -
-
-
This version: -
https://w3id.org/tree/specification/tests -
Feedback: -
public-treecg@w3.org with subject line “[tests] … message topic …” (archives) -
Issue Tracking: -
GitHub -
Editors: -
-
- Pieter Colpaert -
- Xueying Deng -
-
-
-
- -
-
-
-

Abstract

-

The TREE test specification aims to provide resource that for a TREE implementation to be able to test itself against the TREE specification.This test specification will be continuously updated to align with changes and improvements in the TREE specification.

-
-

Status of this document

-
-

-
-
- -
-

1. Overview

-

The TREE specification follows the RFC 2119 norms for defining conformance requirements. -This document outlines the minimum conformance requirements from the TREE specification and provides corresponding test cases to verify the compliance.

-

2. Conformance Points

-

The conformance points in this document are based on the TREE specification and are intended for testing implementations of the TREE specification.

-

TREE conformance is designed for HTTP-based implementations; all test cases are expected to be executed over HTTP(s), and results are determined from the HTTP(s) responses. Since TREE is an RDF (Resource Description Framework) specification, all response payloads must use standard RDF serialization formats, such as Turtle, RDF/XML, or JSON-LD.

-

2.1. TREE basic elements

-

2.1.1. Subject of tree:view must be a tree:Collection

- -Description: When there is a tree:view in the payload of the current HTTP(s) response, the subject of the tree:view must be a tree:Collection - - -

SHACL shape against the HTTP(s) response:

-
@prefix sh: <http://www.w3.org/ns/shacl#> .
-@prefix tree: <https://w3id.org/tree#> .
-
-tree:ViewSubjectConstraintShape
-    a sh:NodeShape ;
-    sh:targetSubjectsOf tree:view ;
-    sh:class tree:Collection ;
-    sh:message "Subject of tree:view must be a tree:Collection" .
-
-
-

2.1.2. Subject of tree:member must be either a tree:Collection or a tree:RootNode

- -Description: If a tree:member property appears in the payload of the current HTTP(s) response, its subject MUST be either a tree:Collection or a tree:RootNode. - - -

SHACL shape against the HTTP(s) response:

-
@prefix sh: <http://www.w3.org/ns/shacl#> .
-@prefix tree: <https://w3id.org/tree#> .
-
-tree:MemberSubjectConstraintShape
-    a sh:NodeShape ;
-    sh:targetSubjectsOf tree:member ;
-    sh:or (
-        [ sh:class tree:Collection ]
-        [ sh:class tree:RootNode ]
-    ) ;
-    sh:message "Subject of tree:member must be either a tree:Collection or a tree:RootNode" .
-
-
-

2.1.3. tree:Relation properties

-

Description: If a tree:Relation appears in the payload of the current HTTP(s) response, it MUST have a tree:path property and a tree:node property which pointing to another tree:Node. - tree:Relation is a superclass for all TREE-supported relation types (such as tree:GreaterThanRelation, tree:LessThanRelation, tree:GreaterThanOrEqualToRelation, etc.). - For the complete list of subclasses of tree:Relation, see tree.ttl.

-

SHACL shape against the HTTP(s) response:

-
@prefix sh: <http://www.w3.org/ns/shacl#> .
-@prefix tree: <https://w3id.org/tree#> .
-
-tree:RelationConstraintShape
-    a sh:NodeShape ;
-    sh:targetClass tree:Relation ;
-    sh:property [
-        sh:path tree:path ;
-        sh:minCount 1 ;
-        sh:message "tree:Relation must have a tree:path property"
-    ] ;
-    sh:property [
-        sh:path tree:node ;
-        sh:minCount 1 ;
-        sh:class tree:Node ;
-        sh:message "tree:Relation must have a tree:node property pointing to a tree:Node"
-    ] .
-
-

2.1.4. Initialization of TREE structure via tree:view after dereferencing

- -Description: When a tree:view triple exists in the payload of the final HTTP(s) response (after following all redirects), the final IRI MUST be the object of a tree:view triple whose subject is a tree:Collection. - - -

SHACL shape against the HTTP(s) response:

-
@prefix sh: <http://www.w3.org/ns/shacl#> .
-@prefix tree: <https://w3id.org/tree#> .
-
-tree:ViewObjectConstraintShape
-    a sh:NodeShape ;
-    sh:targetObjectsOf tree:view ;
-    sh:sparql [
-        sh:select """
-            SELECT $this
-            WHERE {
-                ?collection a tree:Collection .
-                ?collection tree:view $this .
-            }
-        """ ;
-        sh:message "The final IRI must be the object of a tree:view triple whose subject is a tree:Collection"
-    ] .
-
-

2.2. Search TREE

-

2.2.1. tree:Node inbound link uniqueness

- -Description: During traversal of the TREE structure, each tree:Node MUST NOT be the target of more than one inbound tree:Relation (i.e., via the tree:node property) from a different tree:Node. In other words, no tree:Node should have more than one parent node. This requirement ensures that the TREE remains a valid tree structure, where each node has at most one parent. - - -

SHACL shape against the RDF graph:

-
@prefix sh: <http://www.w3.org/ns/shacl#> .
-@prefix tree: <https://w3id.org/tree#> .
-@prefix ex: <http://example.org/> .
-
-ex:NodeInboundUniquenessShape
-    a sh:NodeShape ;
-    sh:targetClass tree:Node ;
-    sh:sparql [
-        a sh:SPARQLConstraint ;
-        sh:message "Each tree:Node must not be the target of more than one tree:Relation, tree:node link from another node." ;
-        sh:select """
-            SELECT ?this (COUNT(?sourceNode) AS ?inboundCount)
-            WHERE {
-                ?sourceNode tree:relation ?relation .
-                ?relation tree:node ?this .
-                FILTER (?sourceNode != ?this)
-            }
-            GROUP BY ?this
-            HAVING (COUNT(?sourceNode) > 1)
-        """ ;
-    ] .
-   
-
-

2.2.2. tree:GreaterThanRelation

- -Description: When traversing a TREE structure by following tree:Relation links (after making one or more HTTP(s) requests and aggregating the resulting RDF graphs), if a tree:GreaterThanRelation is present, then for each member referenced by the relation, the value of the property specified by tree:path MUST be greater than the value specified in the relation, according to the comparison rules defined in the SPARQL algebra functions. This ensures that the tree:GreaterThanRelation accurately represents a "greater than" relationship as defined by SPARQL semantics. - - - -

2.2.3. xsd:dateTime literals without a timezone comparisons

- -Description: When traversing a TREE structure, if an implementation employs xsd:dateTime literals without an explicit timezone, it MUST treat these values as representing the entire range from that date and time at UTC-14:00 (inclusive) to UTC+14:00 (exclusive). Comparisons involving such xsd:dateTime values MUST be performed as interval comparisons: a value without a timezone matches if and only if the comparison holds for at least one instant within this interval. Implementations MUST NOT assume any default timezone or offset for such values. - - - - - - -
-
-

Conformance

-

Document conventions

-

Conformance requirements are expressed - with a combination of descriptive assertions - and RFC 2119 terminology. - The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” - in the normative parts of this document - are to be interpreted as described in RFC 2119. - However, for readability, - these words do not appear in all uppercase letters in this specification. - -

-

All of the text of this specification is normative - except sections explicitly marked as non-normative, examples, and notes. [RFC2119] - -

-

Examples in this specification are introduced with the words “for example” - or are set apart from the normative text - with class="example", - like this: - -

-
- - -

This is an example of an informative example. -

-
-

Informative notes begin with the word “Note” - and are set apart from the normative text - with class="note", - like this: - -

-

Note, this is an informative note.

-
- -

References

-

Normative References

-
-
[RFC2119] -
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119 -
\ No newline at end of file From 3f8148608285d79c387170a19db5b21a82780521 Mon Sep 17 00:00:00 2001 From: XD Date: Thu, 25 Sep 2025 18:47:27 +0200 Subject: [PATCH 20/27] Update 04-tests.bs refine --- 04-tests.bs | 263 +++++++++++++++++++--------------------------------- 1 file changed, 96 insertions(+), 167 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 1a8eb4f..c54ce30 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -26,13 +26,10 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client initializes correctly with a Tree Stream endpoint. * **Test Prerequisites**: - * A valid Tree Stream endpoint URL, the URL that is the IRI of the root `tree:Node`, and there is no redirection. * The TREE client service is up and running. * **Test Steps**: - - 1. Initialize the TREE client with the provided Tree Stream endpoint URL. - + 1. Initialize the TREE client with the provided Tree Stream endpoint URL. * **Expected Output**: Client initializes without errors and is ready to make requests. * **Pass/Fail Criteria**: Pass if the client initializes successfully; fail if any errors occur during initialization. @@ -42,13 +39,10 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client initializes correctly with a Tree Stream endpoint that involves redirection. * **Test Prerequisites**: - - * A valid Tree Stream endpoint URL, the URL leads to the IRI of the root `tree:Node` with one or more HTTP redirections. - * The TREE client service is up and running. + * A valid Tree Stream endpoint URL, the URL leads to the IRI of the root `tree:Node` with one or more HTTP redirections. + * The TREE client service is up and running. * **Test Steps**: - - 1. Initialize the TREE client with the provided Tree Stream endpoint URL. - + 1. Initialize the TREE client with the provided Tree Stream endpoint URL. * **Expected Output**: Client initializes without errors and is ready to make requests following any redirections as necessary. The final IRI after all HTTP redirects corresponds to the object of a `tree:view` triple linking it to a `tree:Collection`. * **Pass/Fail Criteria**: Pass if the client initializes successfully; fail if any errors occur during initialization. @@ -58,15 +52,12 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles invalid initialization parameters gracefully. * **Test Prerequisites**: - - * An invalid Tree Stream endpoint URL (e.g., malformed URL). - * The TREE client service is up and running. + * An invalid Tree Stream endpoint URL (e.g., malformed URL). + * The TREE client service is up and running. * **Test Steps**: - - 1. Attempt to initialize the TREE client with the invalid Tree Stream endpoint URL. - -* **Expected Output**: Client returns an appropriate error message indicating the invalid parameter. -* **Pass/Fail Criteria**: Pass if the client returns an error message; fail if it initializes without errors. + 1. Attempt to initialize the TREE client with the invalid Tree Stream endpoint URL. +* **Expected Output**: Client returns an appropriate error message indicating why the initialization failed, such as "Invalid `tree:Node`". +* **Pass/Fail Criteria**: Pass if the client returns an error message; fail if it initializes without error messages. --- @@ -76,187 +67,142 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client can successfully retrieve members from a Tree Stream. * **Test Prerequisites**: - - * A valid Tree Stream endpoint URL with known amount of members. - * The TREE client service is up and running. -* **Test Steps**: - - 1. Initialize the TREE client with the Tree Stream endpoint URL. - 2. Wait for the client synchronization to complete. - -* **Expected Output**: Client retrieves all members from the Tree Stream, and the amount of retrieved members matches the expected count. -* **Pass/Fail Criteria**: Pass if the client retrieves the expected number of members; fail if the count does not match or if any errors occur during retrieval. - ---- - -### Test Case 1.2.2 : Retrieve members from a Tree Stream with time-based fragmentation ### {#test-case-1-2-2-retrieve-data-from-a-tree-stream-pagination-timebased} - -* **Test Description**: Verify that the client can successfully retrieve members from a Tree Stream that uses timebased pagination. -* **Test Prerequisites**: - - * A valid Tree Stream endpoint URL with known amount of members and pagination enabled. - * The TREE client service is up and running. + * A valid Tree Stream endpoint URL with a known number of members. + * The TREE client service is up and running. * **Test Steps**: - - 1. Initialize the TREE client with the Tree Stream endpoint URL. - 2. Wait for the client synchronization to complete, ensuring it handles pagination correctly. - -* **Expected Output**: Client retrieves all members from the Tree Stream across all pages, and the amount of retrieved members matches the expected count. + 1. Initialize the TREE client with the Tree Stream endpoint URL. + 2. Wait for the client synchronization to complete. + 3. Collect retrieved members. +* **Expected Output**: Client retrieves all members from the Tree Stream, and the number of retrieved members matches the expected count. * **Pass/Fail Criteria**: Pass if the client retrieves the expected number of members; fail if the count does not match or if any errors occur during retrieval. --- -##Traverse Search Tree: Relation Handling ## {#relation-handling} +## Traverse Search Tree: Relation Handling ## {#relation-handling} ### Test Case 1.3.1 : tree:PrefixRelation ### {#test-case-1-3-1-prefix-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:PrefixRelation`. +* **Test Description**: Verify that the client handles `tree:PrefixRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with a `tree:PrefixRelation` defined (e.g., `"abc"`). + * A Tree Stream containing a single `tree:PrefixRelation` with a `tree:value` (e.g., `"abc"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:PrefixRelation` points to a `tree:Node` whose members' `tree:path`'s value all have values that start with `"abc"`, consistent with the `STRSTARTS` SPARQL function. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the `tree:PrefixRelation`. - 3. Collect retrieved members. - -* **Expected Output**: All retrieved members have values starting with `"abc"`, consistent with the `STRSTARTS` SPARQL function. + 1. Initialize the TREE client. + 2. Wait for the client synchronization to complete. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:PrefixRelation`. All members are retrieved by the client. * **Pass/Fail Criteria**: Pass if all members match the prefix condition; fail otherwise. --- ### Test Case 1.3.2 : tree:SubstringRelation ### {#test-case-1-3-2-substring-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:SubstringRelation`. +* **Test Description**: Verify that the client handles `tree:SubstringRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with a `tree:SubstringRelation` defined (e.g., substring `"mid"`). + * A Tree Stream containing a single `tree:SubstringRelation` with a `tree:value` (e.g., `"mid"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SubstringRelation` points to a `tree:Node` whose members' `tree:path`'s values all contain `"mid"`, consistent with the `SUBSTR` SPARQL function. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the `tree:SubstringRelation`. - 3. Collect retrieved members. - -* **Expected Output**: All retrieved members contain `"mid"`, consistent with the `SUBSTR` SPARQL function. + 1. Initialize the TREE client. + 2. Wait for the client synchronization to complete. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:SubstringRelation`. All members are retrieved by the client. * **Pass/Fail Criteria**: Pass if all members contain the substring; fail otherwise. --- ### Test Case 1.3.3 : tree:SuffixRelation ### {#test-case-1-3-3-suffix-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:SuffixRelation`. +* **Test Description**: Verify that the client handles `tree:SuffixRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with a `tree:SuffixRelation` defined (e.g., `"xyz"`). + * A Tree Stream containing a single `tree:SuffixRelation` with a `tree:value` (e.g., `"xyz"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SuffixRelation` points to a `tree:Node` whose members' `tree:path`'s values all end with `"xyz"`, consistent with the `STRENDS` SPARQL function. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the `tree:SuffixRelation`. - 3. Collect retrieved members. - -* **Expected Output**: All retrieved members end with `"xyz"`, consistent with the `STRENDS` SPARQL function. + 1. Initialize the TREE client. + 2. Wait for the client synchronization to complete. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:SuffixRelation`. All members are retrieved by the client. * **Pass/Fail Criteria**: Pass if all members match the suffix condition; fail otherwise. --- ### Test Case 1.3.4 : tree:GreaterThanRelation ### {#test-case-1-3-4-greater-than-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:GreaterThanRelation`. -* **Test Prerequisites**: +* **Test Description**: Verify that the client handles `tree:GreaterThanRelation`. - * A Tree Stream endpoint with members that can be filtered using `> threshold`. +* **Test Prerequisites**: + * A Tree Stream containing a single `tree:GreaterThanRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than `10`. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the `tree:GreaterThanRelation`. - 3. Collect retrieved members. - -* **Expected Output**: All retrieved members are greater than the threshold value, consistent with SPARQL operator mapping. -* **Pass/Fail Criteria**: Pass if all members satisfy the condition; fail otherwise. + 1. Initialize the TREE client. + 2. Wait for the client synchronization to complete. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:GreaterThanRelation`. All members are retrieved by the client. +* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. --- ### Test Case 1.3.5 : tree:GreaterThanOrEqualToRelation ### {#test-case-1-3-5-greater-than-equal-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:GreaterThanOrEqualToRelation`. +* **Test Description**: Verify that the client handles `tree:GreaterThanOrEqualToRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with members ≥ threshold. + * A Tree Stream containing a single `tree:GreaterThanOrEqualToRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than or equal to `10`. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the relation. - 3. Collect retrieved members. - -* **Expected Output**: All members are greater than or equal to the threshold. -* **Pass/Fail Criteria**: Pass if all members satisfy the condition; fail otherwise. + 1. Initialize the TREE client. + 2. Traverse the node via the relation. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:GreaterThanOrEqualToRelation`. All members are retrieved by the client. +* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. --- ### Test Case 1.3.6 : tree:LessThanRelation ### {#test-case-1-3-6-less-than-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:LessThanRelation`. +* **Test Description**: Verify that the client handles `tree:LessThanRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with members < threshold. + * A Tree Stream containing a single `tree:LessThanRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than `20`. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the relation. - 3. Collect retrieved members. - -* **Expected Output**: All members are less than the threshold. -* **Pass/Fail Criteria**: Pass if all members satisfy the condition; fail otherwise. + 1. Initialize the TREE client. + 2. Traverse the node via the relation. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:LessThanRelation`. All members are retrieved by the client. +* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. --- -### Test Case 1.3.7 : tree:LessThanOrEqualToRelation ### {#test-case-1-3-7-less-than-equal-relation} +### Test Case 1.3.7 : tree:LessThanOrEqualToRelation ### {#test-case-1-3-7-less-than-equal-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:LessThanOrEqualToRelation`. +* **Test Description**: Verify that the client handles `tree:LessThanOrEqualToRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with members ≤ threshold. + * A Tree Stream containing a single `tree:LessThanOrEqualToRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than or equal to `20`. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the relation. - 3. Collect retrieved members. - -* **Expected Output**: All members are less than or equal to the threshold. -* **Pass/Fail Criteria**: Pass if all members satisfy the condition; fail otherwise. + 1. Initialize the TREE client. + 2. Traverse the node via the relation. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:LessThanOrEqualToRelation`. All members are retrieved by the client. +* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. --- ### Test Case 1.3.8 : tree:EqualToRelation ### {#test-case-1-3-8-equal-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:EqualToRelation`. +* **Test Description**: Verify that the client handles `tree:EqualToRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with members matching an exact value. + * A Tree Stream containing a single `tree:EqualToRelation` with a `tree:value` (e.g., `15`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:EqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all equal to `15`. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the relation. - 3. Collect retrieved members. - -* **Expected Output**: All members equal the specified value. -* **Pass/Fail Criteria**: Pass if all members satisfy the condition; fail otherwise. + 1. Initialize the TREE client. + 2. Traverse the node via the relation. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:EqualToRelation`. All members are retrieved by the client. +* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. --- ### Test Case 1.3.9 : tree:NotEqualToRelation ### {#test-case-1-3-9-not-equal-relation} -* **Test Description**: Verify that the client handles traversal using a `tree:NotEqualToRelation`. +* **Test Description**: Verify that the client handles `tree:NotEqualToRelation`. * **Test Prerequisites**: - - * A Tree Stream endpoint with members not equal to a specific value. + * A Tree Stream containing a single `tree:NotEqualToRelation` with a `tree:value` (e.g., `14`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:NotEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all not equal to `14`. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the node via the relation. - 3. Collect retrieved members. - -* **Expected Output**: All members are not equal to the specified value. -* **Pass/Fail Criteria**: Pass if all members satisfy the condition; fail otherwise. + 1. Initialize the TREE client. + 2. Traverse the node via the relation. + 3. Collect retrieved members. +* **Expected Output**: The client successfully traverses the TREE via `tree:NotEqualToRelation`. All members are retrieved by the client. +* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. --- @@ -266,13 +212,10 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior when a node has no members. * **Test Prerequisites**: - - * A Tree Stream endpoint containing an empty node. + * A Tree Stream endpoint containing an empty node. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse to the empty node. - + 1. Initialize the TREE client. + 2. Traverse to the empty node. * **Expected Output**: Client returns an empty result set gracefully. * **Pass/Fail Criteria**: Pass if empty set returned without error; fail otherwise. @@ -282,13 +225,10 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior when relations form a circular loop. * **Test Prerequisites**: - - * A Tree Stream endpoint with circular relation between nodes. + * A Tree Stream endpoint with circular relation between nodes. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the graph. - + 1. Initialize the TREE client. + 2. Traverse the graph. * **Expected Output**: Client detects and prevents infinite recursion or traversal. * **Pass/Fail Criteria**: Pass if client terminates safely; fail if stuck in infinite loop. @@ -298,12 +238,10 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior when relation value is malformed (e.g., string instead of number). * **Test Prerequisites**: - - * A Tree Stream endpoint with invalid relation definition. + * A Tree Stream endpoint with invalid relation definition. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the malformed relation. + 1. Initialize the TREE client. + 2. Traverse the malformed relation. * **Expected Output**: Client raises error or skips invalid relation safely. * **Pass/Fail Criteria**: Pass if client does not crash and handles gracefully; fail otherwise. @@ -316,13 +254,10 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client performance when traversing a large Tree Stream. * **Test Prerequisites**: - - * Endpoint with ≥ 10,000 members. + * Endpoint with ≥ 10,000 members. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Retrieve all members. - + 1. Initialize the TREE client. + 2. Retrieve all members. * **Expected Output**: Traversal completes within acceptable performance thresholds (e.g., <5s). * **Pass/Fail Criteria**: Pass if traversal completes on time; fail otherwise. @@ -332,13 +267,10 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client scalability with increasing members and relations. * **Test Prerequisites**: - - * Endpoint with multiple large fragments and complex relations. + * Endpoint with multiple large fragments and complex relations. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Traverse the entire collection. - + 1. Initialize the TREE client. + 2. Traverse the entire collection. * **Expected Output**: Client retrieves all members without memory leaks or degradation. * **Pass/Fail Criteria**: Pass if successful; fail otherwise. @@ -348,12 +280,9 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior during network interruptions. * **Test Prerequisites**: - - * Endpoint accessible over unstable connection. + * Endpoint accessible over unstable connection. * **Test Steps**: - - 1. Initialize the TREE client. - 2. Simulate network drop during traversal. - + 1. Initialize the TREE client. + 2. Simulate network drop during traversal. * **Expected Output**: Client retries automatically or fails gracefully with an error message. * **Pass/Fail Criteria**: Pass if handled gracefully; fail otherwise. From cdbcaf64ecb85dc0df87afadc1cda239019317ce Mon Sep 17 00:00:00 2001 From: deng49 Date: Fri, 26 Sep 2025 14:03:37 +0200 Subject: [PATCH 21/27] feat: first draft for test spec --- 04-tests.bs | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index c54ce30..5818d3e 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -52,12 +52,12 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles invalid initialization parameters gracefully. * **Test Prerequisites**: - * An invalid Tree Stream endpoint URL (e.g., malformed URL). + * An invalid Tree Stream endpoint URL (e.g., the content is an invalid `tree:Node`). * The TREE client service is up and running. * **Test Steps**: 1. Attempt to initialize the TREE client with the invalid Tree Stream endpoint URL. * **Expected Output**: Client returns an appropriate error message indicating why the initialization failed, such as "Invalid `tree:Node`". -* **Pass/Fail Criteria**: Pass if the client returns an error message; fail if it initializes without error messages. +* **Pass/Fail Criteria**: Pass if the client returns an error message; fail if it initializes without an error message. --- @@ -83,13 +83,14 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:PrefixRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:PrefixRelation` with a `tree:value` (e.g., `"abc"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:PrefixRelation` points to a `tree:Node` whose members' `tree:path`'s value all have values that start with `"abc"`, consistent with the `STRSTARTS` SPARQL function. + * A Tree Stream containing a single `tree:PrefixRelation` with a `tree:value` (e.g., `"abc"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:PrefixRelation` points to a `tree:Node` whose members' `tree:path`'s value all start with `"abc"` consistent with the `STRSTARTS` SPARQL function. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Wait for the client synchronization to complete. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:PrefixRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members match the prefix condition; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -98,12 +99,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:SubstringRelation`. * **Test Prerequisites**: * A Tree Stream containing a single `tree:SubstringRelation` with a `tree:value` (e.g., `"mid"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SubstringRelation` points to a `tree:Node` whose members' `tree:path`'s values all contain `"mid"`, consistent with the `SUBSTR` SPARQL function. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Wait for the client synchronization to complete. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:SubstringRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members contain the substring; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -112,12 +114,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:SuffixRelation`. * **Test Prerequisites**: * A Tree Stream containing a single `tree:SuffixRelation` with a `tree:value` (e.g., `"xyz"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SuffixRelation` points to a `tree:Node` whose members' `tree:path`'s values all end with `"xyz"`, consistent with the `STRENDS` SPARQL function. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Wait for the client synchronization to complete. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:SuffixRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members match the suffix condition; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -127,12 +130,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Prerequisites**: * A Tree Stream containing a single `tree:GreaterThanRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than `10`. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Wait for the client synchronization to complete. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:GreaterThanRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -141,12 +145,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:GreaterThanOrEqualToRelation`. * **Test Prerequisites**: * A Tree Stream containing a single `tree:GreaterThanOrEqualToRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than or equal to `10`. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the node via the relation. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:GreaterThanOrEqualToRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -155,12 +160,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:LessThanRelation`. * **Test Prerequisites**: * A Tree Stream containing a single `tree:LessThanRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than `20`. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the node via the relation. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:LessThanRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -169,12 +175,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:LessThanOrEqualToRelation`. * **Test Prerequisites**: * A Tree Stream containing a single `tree:LessThanOrEqualToRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than or equal to `20`. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the node via the relation. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:LessThanOrEqualToRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -183,12 +190,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:EqualToRelation`. * **Test Prerequisites**: * A Tree Stream containing a single `tree:EqualToRelation` with a `tree:value` (e.g., `15`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:EqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all equal to `15`. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the node via the relation. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:EqualToRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -197,12 +205,13 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:NotEqualToRelation`. * **Test Prerequisites**: * A Tree Stream containing a single `tree:NotEqualToRelation` with a `tree:value` (e.g., `14`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:NotEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all not equal to `14`. + * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the node via the relation. 3. Collect retrieved members. * **Expected Output**: The client successfully traverses the TREE via `tree:NotEqualToRelation`. All members are retrieved by the client. -* **Pass/Fail Criteria**: Pass if all members that satisfy the condition are retrieved; fail otherwise. +* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise. --- @@ -212,12 +221,12 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior when a node has no members. * **Test Prerequisites**: - * A Tree Stream endpoint containing an empty node. + * A Tree Stream endpoint only linking to an empty `tree:Node`. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse to the empty node. -* **Expected Output**: Client returns an empty result set gracefully. -* **Pass/Fail Criteria**: Pass if empty set returned without error; fail otherwise. +* **Expected Output**: Client returns an empty member set gracefully. +* **Pass/Fail Criteria**: Pass if empty set is returned without error; fail otherwise. --- @@ -230,7 +239,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas 1. Initialize the TREE client. 2. Traverse the graph. * **Expected Output**: Client detects and prevents infinite recursion or traversal. -* **Pass/Fail Criteria**: Pass if client terminates safely; fail if stuck in infinite loop. +* **Pass/Fail Criteria**: Pass if client terminates safely; fail if stuck in an infinite loop. --- @@ -243,7 +252,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas 1. Initialize the TREE client. 2. Traverse the malformed relation. -* **Expected Output**: Client raises error or skips invalid relation safely. +* **Expected Output**: Client raises an error or skips the invalid relation safely. * **Pass/Fail Criteria**: Pass if client does not crash and handles gracefully; fail otherwise. --- @@ -267,7 +276,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client scalability with increasing members and relations. * **Test Prerequisites**: - * Endpoint with multiple large fragments and complex relations. + * Endpoint with multiple large fragments and complex relations, please refer to [ldes-registry](https://imec-int.github.io/ldes-registry/dashboard.html) for example endpoints. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the entire collection. @@ -280,7 +289,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior during network interruptions. * **Test Prerequisites**: - * Endpoint accessible over unstable connection. + * Endpoint accessible over an unstable connection. * **Test Steps**: 1. Initialize the TREE client. 2. Simulate network drop during traversal. From 6842d89385ef9e21435a6a085ba7dc5670e2159e Mon Sep 17 00:00:00 2001 From: Xueying Deng Date: Fri, 12 Dec 2025 20:47:01 +0100 Subject: [PATCH 22/27] refactor: update terminology from 'Tree Stream' to 'TREE view' for consistency Signed-off-by: XD --- 04-tests.bs | 78 ++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 5818d3e..859b764 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -11,39 +11,39 @@ Mailing List Archives: https://lists.w3.org/Archives/Public/public-treecg/ Editor: - Pieter Colpaert, https://pietercolpaert.be - Xueying Deng, https://xdxxxdx.github.io/ -Abstract: The TREE Test Specification offers a test plan for Tree Client implementations, enabling implementers to validate their conformance with the TREE Specification. This test specification will be regularly updated to reflect changes and enhancements in the TREE specification. +Abstract: The TREE Test Specification offers a test plan for TREE Client implementations, enabling implementers to validate their conformance with the TREE Specification. This test specification will be regularly updated to reflect changes and enhancements in the TREE specification. # Overview # {#overview} -This specification targets implementations of TREE client services and outlines a comprehensive suite of test cases to assess their compliance with the TREE specification. -It covers functional, boundary, error handling, and nonfunctional performance testing. -Each test case specifies its purpose, input data, expected output, and clear pass/fail criteria. +This specification targets implementations of TREE clients and outlines a comprehensive suite of test cases to assess their compliance with the TREE specification. +It covers functional, boundary, error handling, and optional non-functional performance testing. +Each test case specifies its purpose, input data, expected output, and pass/fail criteria. # Functional Tests # {#functional-tests} ## Client Initialization ## {#client-initialization} -### Test Case 1.1.1 : tree client initialization without redirection ### {#test-case-1-1-1-tree-client-initialization} +### Test Case 1.1.1 : TREE client initialization without redirection ### {#test-case-1-1-1-tree-client-initialization} -* **Test Description**: Verify that the client initializes correctly with a Tree Stream endpoint. +* **Test Description**: Verify that the client initializes correctly with a TREE view endpoint. * **Test Prerequisites**: - * A valid Tree Stream endpoint URL, the URL that is the IRI of the root `tree:Node`, and there is no redirection. + * A valid TREE view endpoint URL, the URL that is the IRI of the root `tree:Node`, and there is no redirection. * The TREE client service is up and running. * **Test Steps**: - 1. Initialize the TREE client with the provided Tree Stream endpoint URL. + 1. Initialize the TREE client with the provided TREE view endpoint URL. * **Expected Output**: Client initializes without errors and is ready to make requests. * **Pass/Fail Criteria**: Pass if the client initializes successfully; fail if any errors occur during initialization. --- -### Test Case 1.1.2 : tree client initialization with redirection ### {#test-case-1-1-2-tree-client-initialization-redirection} +### Test Case 1.1.2 : TREE client initialization with redirection ### {#test-case-1-1-2-tree-client-initialization-redirection} -* **Test Description**: Verify that the client initializes correctly with a Tree Stream endpoint that involves redirection. +* **Test Description**: Verify that the client initializes correctly with a TREE view endpoint that involves redirection. * **Test Prerequisites**: - * A valid Tree Stream endpoint URL, the URL leads to the IRI of the root `tree:Node` with one or more HTTP redirections. + * A valid TREE view endpoint URL, the URL leads to the IRI of the root `tree:Node` with one or more HTTP redirects. * The TREE client service is up and running. * **Test Steps**: - 1. Initialize the TREE client with the provided Tree Stream endpoint URL. -* **Expected Output**: Client initializes without errors and is ready to make requests following any redirections as necessary. The final IRI after all HTTP redirects corresponds to the object of a `tree:view` triple linking it to a `tree:Collection`. + 1. Initialize the TREE client with the provided TREE view endpoint URL. +* **Expected Output**: Client initializes without errors and is ready to make requests following any redirects as necessary. The final IRI after all HTTP redirects corresponds to the object of a `tree:view` triple that links it to a `tree:Collection`. * **Pass/Fail Criteria**: Pass if the client initializes successfully; fail if any errors occur during initialization. --- @@ -52,38 +52,40 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles invalid initialization parameters gracefully. * **Test Prerequisites**: - * An invalid Tree Stream endpoint URL (e.g., the content is an invalid `tree:Node`). + * An invalid TREE view endpoint URL (e.g., the content is an invalid `tree:Node`). * The TREE client service is up and running. * **Test Steps**: - 1. Attempt to initialize the TREE client with the invalid Tree Stream endpoint URL. + 1. Attempt to initialize the TREE client with the invalid TREE view endpoint URL. * **Expected Output**: Client returns an appropriate error message indicating why the initialization failed, such as "Invalid `tree:Node`". * **Pass/Fail Criteria**: Pass if the client returns an error message; fail if it initializes without an error message. --- -## Traverse Search Tree ## {#traverse-search-tree} +## Traversing the TREE ## {#traverse-search-tree} -### Test Case 1.2.1 : Retrieve members from a Tree Stream ### {#test-case-1-2-1-retrieve-data-from-a-tree-stream} +### Test Case 1.2.1 : Retrieve members from a TREE view ### {#test-case-1-2-1-retrieve-data-from-a-tree-stream} -* **Test Description**: Verify that the client can successfully retrieve members from a Tree Stream. +* **Test Description**: Verify that the client can successfully retrieve members from a TREE view. * **Test Prerequisites**: - * A valid Tree Stream endpoint URL with a known number of members. + * A valid TREE view endpoint URL with a known number of members. * The TREE client service is up and running. * **Test Steps**: - 1. Initialize the TREE client with the Tree Stream endpoint URL. + 1. Initialize the TREE client with the TREE view endpoint URL. 2. Wait for the client synchronization to complete. 3. Collect retrieved members. -* **Expected Output**: Client retrieves all members from the Tree Stream, and the number of retrieved members matches the expected count. +* **Expected Output**: Client retrieves all members from the TREE view, and the number of retrieved members matches the expected count. * **Pass/Fail Criteria**: Pass if the client retrieves the expected number of members; fail if the count does not match or if any errors occur during retrieval. --- -## Traverse Search Tree: Relation Handling ## {#relation-handling} +## Traverse Search TREE: Relation Handling ## {#relation-handling} + +The following test cases are optional to implement and depend on the type of relation used in your TREE. ### Test Case 1.3.1 : tree:PrefixRelation ### {#test-case-1-3-1-prefix-relation} * **Test Description**: Verify that the client handles `tree:PrefixRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:PrefixRelation` with a `tree:value` (e.g., `"abc"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:PrefixRelation` points to a `tree:Node` whose members' `tree:path`'s value all start with `"abc"` consistent with the `STRSTARTS` SPARQL function. + * A TREE view containing a single `tree:PrefixRelation` with a `tree:value` (e.g., "abc") for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:PrefixRelation` points to a `tree:Node` whose members have `tree:path` values that all start with "abc", consistent with the `STRSTARTS` SPARQL function. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -98,7 +100,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:SubstringRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:SubstringRelation` with a `tree:value` (e.g., `"mid"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SubstringRelation` points to a `tree:Node` whose members' `tree:path`'s values all contain `"mid"`, consistent with the `SUBSTR` SPARQL function. + * A TREE view containing a single `tree:SubstringRelation` with a `tree:value` (e.g., `"mid"`) for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:SubstringRelation` points to a `tree:Node` whose members have `tree:path` values that all contain `"mid"`, consistent with the `CONTAINS` SPARQL function. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -113,7 +115,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:SuffixRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:SuffixRelation` with a `tree:value` (e.g., `"xyz"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SuffixRelation` points to a `tree:Node` whose members' `tree:path`'s values all end with `"xyz"`, consistent with the `STRENDS` SPARQL function. + * A TREE view containing a single `tree:SuffixRelation` with a `tree:value` (e.g., "xyz") for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:SuffixRelation` points to a `tree:Node` whose members have `tree:path` values that all end with "xyz", consistent with the `STRENDS` SPARQL function. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -129,7 +131,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:GreaterThanRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:GreaterThanRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than `10`. + * A TREE view containing a single `tree:GreaterThanRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:GreaterThanRelation` points to a `tree:Node` whose members have `tree:path` values that are all greater than `10`. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -144,7 +146,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:GreaterThanOrEqualToRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:GreaterThanOrEqualToRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than or equal to `10`. + * A TREE view containing a single `tree:GreaterThanOrEqualToRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:GreaterThanOrEqualToRelation` points to a `tree:Node` whose members have `tree:path` values that are all greater than or equal to `10`. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -159,7 +161,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:LessThanRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:LessThanRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than `20`. + * A TREE view containing a single `tree:LessThanRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:LessThanRelation` points to a `tree:Node` whose members have `tree:path` values that are all less than `20`. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -170,11 +172,11 @@ Each test case specifies its purpose, input data, expected output, and clear pas --- -### Test Case 1.3.7 : tree:LessThanOrEqualToRelation ### {#test-case-1-3-7-less-than-equal-relation} +### Test Case 1.3.7 : tree:LessThanOrEqualToRelation ### {#test-case-1-3-7-less-than-equal-relation} * **Test Description**: Verify that the client handles `tree:LessThanOrEqualToRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:LessThanOrEqualToRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than or equal to `20`. + * A TREE view containing a single `tree:LessThanOrEqualToRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:LessThanOrEqualToRelation` points to a `tree:Node` whose members have `tree:path` values that are all less than or equal to `20`. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -189,7 +191,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:EqualToRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:EqualToRelation` with a `tree:value` (e.g., `15`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:EqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all equal to `15`. + * A TREE view containing a single `tree:EqualToRelation` with a `tree:value` (e.g., `15`) for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:EqualToRelation` points to a `tree:Node` whose members have `tree:path` values that are all equal to `15`. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -204,7 +206,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify that the client handles `tree:NotEqualToRelation`. * **Test Prerequisites**: - * A Tree Stream containing a single `tree:NotEqualToRelation` with a `tree:value` (e.g., `14`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:NotEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all not equal to `14`. + * A TREE view containing a single `tree:NotEqualToRelation` with a `tree:value` (e.g., `14`) for a specific `tree:path`. This TREE view has only one `tree:Relation`: the `tree:NotEqualToRelation` points to a `tree:Node` whose members have `tree:path` values that are all not equal to `14`. * The number of members of the TREE is known. * **Test Steps**: 1. Initialize the TREE client. @@ -221,7 +223,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior when a node has no members. * **Test Prerequisites**: - * A Tree Stream endpoint only linking to an empty `tree:Node`. + * A TREE view endpoint only linking to an empty `tree:Node`. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse to the empty node. @@ -234,7 +236,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior when relations form a circular loop. * **Test Prerequisites**: - * A Tree Stream endpoint with circular relation between nodes. + * A TREE view endpoint with a circular relation between nodes. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the graph. @@ -247,7 +249,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client behavior when relation value is malformed (e.g., string instead of number). * **Test Prerequisites**: - * A Tree Stream endpoint with invalid relation definition. + * A TREE view endpoint with invalid relation definition. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the malformed relation. @@ -259,9 +261,11 @@ Each test case specifies its purpose, input data, expected output, and clear pas ## Non-Functional Testing ## {#non-functional} +The following tests are optional to implement and should align with the non-functional requirements of your implementation. This section is provided for suggestion purposes only. + ### Test Case 1.5.1 : Performance under load ### {#test-case-1-5-1-performance} -* **Test Description**: Verify client performance when traversing a large Tree Stream. +* **Test Description**: Verify client performance when traversing a large TREE view. * **Test Prerequisites**: * Endpoint with ≥ 10,000 members. * **Test Steps**: @@ -276,7 +280,7 @@ Each test case specifies its purpose, input data, expected output, and clear pas * **Test Description**: Verify client scalability with increasing members and relations. * **Test Prerequisites**: - * Endpoint with multiple large fragments and complex relations, please refer to [ldes-registry](https://imec-int.github.io/ldes-registry/dashboard.html) for example endpoints. + * Endpoint with multiple large fragments and complex relations; refer to [ldes-registry](https://imec-int.github.io/ldes-registry/dashboard.html) for example endpoints. * **Test Steps**: 1. Initialize the TREE client. 2. Traverse the entire collection. From a36699d30f86cec7b7138b05084bb2563a0bd782 Mon Sep 17 00:00:00 2001 From: XD Date: Fri, 12 Dec 2025 20:49:43 +0100 Subject: [PATCH 23/27] fix: update test prerequisites to clarify TREE client reference Signed-off-by: XD --- 04-tests.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 859b764..4e94042 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -27,7 +27,7 @@ Each test case specifies its purpose, input data, expected output, and pass/fail * **Test Description**: Verify that the client initializes correctly with a TREE view endpoint. * **Test Prerequisites**: * A valid TREE view endpoint URL, the URL that is the IRI of the root `tree:Node`, and there is no redirection. - * The TREE client service is up and running. + * The TREE client is up and running. * **Test Steps**: 1. Initialize the TREE client with the provided TREE view endpoint URL. * **Expected Output**: Client initializes without errors and is ready to make requests. @@ -40,7 +40,7 @@ Each test case specifies its purpose, input data, expected output, and pass/fail * **Test Description**: Verify that the client initializes correctly with a TREE view endpoint that involves redirection. * **Test Prerequisites**: * A valid TREE view endpoint URL, the URL leads to the IRI of the root `tree:Node` with one or more HTTP redirects. - * The TREE client service is up and running. + * The TREE client is up and running. * **Test Steps**: 1. Initialize the TREE client with the provided TREE view endpoint URL. * **Expected Output**: Client initializes without errors and is ready to make requests following any redirects as necessary. The final IRI after all HTTP redirects corresponds to the object of a `tree:view` triple that links it to a `tree:Collection`. @@ -53,7 +53,7 @@ Each test case specifies its purpose, input data, expected output, and pass/fail * **Test Description**: Verify that the client handles invalid initialization parameters gracefully. * **Test Prerequisites**: * An invalid TREE view endpoint URL (e.g., the content is an invalid `tree:Node`). - * The TREE client service is up and running. + * The TREE client is up and running. * **Test Steps**: 1. Attempt to initialize the TREE client with the invalid TREE view endpoint URL. * **Expected Output**: Client returns an appropriate error message indicating why the initialization failed, such as "Invalid `tree:Node`". @@ -68,7 +68,7 @@ Each test case specifies its purpose, input data, expected output, and pass/fail * **Test Description**: Verify that the client can successfully retrieve members from a TREE view. * **Test Prerequisites**: * A valid TREE view endpoint URL with a known number of members. - * The TREE client service is up and running. + * The TREE client is up and running. * **Test Steps**: 1. Initialize the TREE client with the TREE view endpoint URL. 2. Wait for the client synchronization to complete. From 4471f19cc7ecc12cccc2f3c45cfcbc2f94f539f2 Mon Sep 17 00:00:00 2001 From: XD Date: Fri, 12 Dec 2025 20:50:50 +0100 Subject: [PATCH 24/27] fix: correct reference in test case for TREE view Signed-off-by: XD --- 04-tests.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-tests.bs b/04-tests.bs index 4e94042..6ef85a2 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -63,7 +63,7 @@ Each test case specifies its purpose, input data, expected output, and pass/fail ## Traversing the TREE ## {#traverse-search-tree} -### Test Case 1.2.1 : Retrieve members from a TREE view ### {#test-case-1-2-1-retrieve-data-from-a-tree-stream} +### Test Case 1.2.1 : Retrieve members from a TREE view ### {#test-case-1-2-1-retrieve-data-from-a-tree-view} * **Test Description**: Verify that the client can successfully retrieve members from a TREE view. * **Test Prerequisites**: From de6b44f2468b4957af974866c3f526b433176d6f Mon Sep 17 00:00:00 2001 From: XD Date: Fri, 12 Dec 2025 20:53:37 +0100 Subject: [PATCH 25/27] fix: update section title. Signed-off-by: XD --- 04-tests.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-tests.bs b/04-tests.bs index 6ef85a2..72266e0 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -259,7 +259,7 @@ The following test cases are optional to implement and depend on the type of rel --- -## Non-Functional Testing ## {#non-functional} +## Non-Functional Tests ## {#non-functional} The following tests are optional to implement and should align with the non-functional requirements of your implementation. This section is provided for suggestion purposes only. From 50f1682dc036f0739a1a98bd54a7e4a3ce7905ac Mon Sep 17 00:00:00 2001 From: XD Date: Fri, 12 Dec 2025 20:54:25 +0100 Subject: [PATCH 26/27] fix: update wording in overview section for clarity Signed-off-by: XD --- 04-tests.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-tests.bs b/04-tests.bs index 72266e0..3dc6223 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -15,7 +15,7 @@ Abstract: The TREE Test Specification offers a test plan for TREE Client impleme # Overview # {#overview} This specification targets implementations of TREE clients and outlines a comprehensive suite of test cases to assess their compliance with the TREE specification. -It covers functional, boundary, error handling, and optional non-functional performance testing. +It covers functional, boundary, error handling, and optional non-functional performance tests. Each test case specifies its purpose, input data, expected output, and pass/fail criteria. # Functional Tests # {#functional-tests} From 443b122cbe65f47a77ab1fdd47ad92a94487a14b Mon Sep 17 00:00:00 2001 From: XD Date: Fri, 12 Dec 2025 21:00:07 +0100 Subject: [PATCH 27/27] fix: update section titles for consistency in TREE documentation Signed-off-by: XD --- 04-tests.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04-tests.bs b/04-tests.bs index 3dc6223..99b3034 100644 --- a/04-tests.bs +++ b/04-tests.bs @@ -61,7 +61,7 @@ Each test case specifies its purpose, input data, expected output, and pass/fail --- -## Traversing the TREE ## {#traverse-search-tree} +## Traverse TREE ## {#traverse-search-tree} ### Test Case 1.2.1 : Retrieve members from a TREE view ### {#test-case-1-2-1-retrieve-data-from-a-tree-view} @@ -79,7 +79,7 @@ Each test case specifies its purpose, input data, expected output, and pass/fail --- ## Traverse Search TREE: Relation Handling ## {#relation-handling} -The following test cases are optional to implement and depend on the type of relation used in your TREE. +The following test cases are optional to implement and depend on the type of `tree:Relation` used in your TREE. ### Test Case 1.3.1 : tree:PrefixRelation ### {#test-case-1-3-1-prefix-relation}