├── .gitattributes
├── .github
├── ISSUE_TEMPLATE
│ ├── bug-report.md
│ ├── config.yml
│ └── feature-request.md
├── PULL_REQUEST_TEMPLATE.md
├── actions
│ └── setup-java
│ │ └── action.yaml
├── scripts
│ ├── checkout-tags.sh
│ └── index.html
└── workflows
│ ├── autopublish.yaml
│ └── pr-check.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── PR_ETIQUETTE.md
├── README.md
├── WEBSITE.md
├── artifacts
├── .gitignore
├── README.md
├── build.gradle.kts
├── buildSrc
│ ├── README.md
│ ├── build.gradle.kts
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── eclipse
│ │ │ └── dsp
│ │ │ └── generation
│ │ │ ├── SchemaTableGeneratorPlugin.java
│ │ │ ├── SchemaTableGeneratorPluginExtension.java
│ │ │ ├── jsom
│ │ │ ├── ElementDefinition.java
│ │ │ ├── JsomParser.java
│ │ │ ├── JsonSchemaKeywords.java
│ │ │ ├── JsonTypeMappings.java
│ │ │ ├── JsonTypes.java
│ │ │ ├── SchemaModel.java
│ │ │ ├── SchemaModelContext.java
│ │ │ ├── SchemaProperty.java
│ │ │ ├── SchemaPropertyReference.java
│ │ │ └── SchemaType.java
│ │ │ └── transformer
│ │ │ ├── HtmlTableTransformer.java
│ │ │ └── SchemaTypeTransformer.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── eclipse
│ │ └── dsp
│ │ └── generation
│ │ ├── jsom
│ │ ├── JsomParserTest.java
│ │ ├── JsonTypesTest.java
│ │ ├── SchemaModelContextTest.java
│ │ ├── SchemaTypeTest.java
│ │ └── TestSchema.java
│ │ └── transformer
│ │ └── HtmlTableTransformerTest.java
├── config
│ └── checkstyle
│ │ ├── checkstyle.xml
│ │ └── suppressions.xml
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle.kts
└── src
│ ├── main
│ └── resources
│ │ ├── catalog
│ │ ├── catalog-error-schema.json
│ │ ├── catalog-request-message-schema.json
│ │ ├── catalog-schema.json
│ │ ├── dataset-request-message-schema.json
│ │ ├── dataset-schema.json
│ │ └── example
│ │ │ ├── catalog-error.json
│ │ │ ├── catalog-request-message.json
│ │ │ ├── catalog.json
│ │ │ ├── dataset-request-message.json
│ │ │ ├── dataset.json
│ │ │ └── nested-catalog.json
│ │ ├── common
│ │ ├── context-schema.json
│ │ ├── did-service-schema.json
│ │ ├── example
│ │ │ ├── catalogservice-did-service.json
│ │ │ ├── dataservice-did-service.json
│ │ │ └── protocol-version.json
│ │ └── protocol-version-schema.json
│ │ ├── context
│ │ ├── dspace.jsonld
│ │ └── odrl.jsonld
│ │ ├── negotiation
│ │ ├── contract-agreement-message-schema.json
│ │ ├── contract-agreement-verification-message-schema.json
│ │ ├── contract-negotiation-error-schema.json
│ │ ├── contract-negotiation-event-message-schema.json
│ │ ├── contract-negotiation-schema.json
│ │ ├── contract-negotiation-termination-message-schema.json
│ │ ├── contract-offer-message-schema.json
│ │ ├── contract-request-message-schema.json
│ │ ├── contract-schema.json
│ │ └── example
│ │ │ ├── contract-agreement-message-full.json
│ │ │ ├── contract-agreement-message.json
│ │ │ ├── contract-agreement-verification-message.json
│ │ │ ├── contract-negotiation-error.json
│ │ │ ├── contract-negotiation-event-message.json
│ │ │ ├── contract-negotiation-termination-message.json
│ │ │ ├── contract-negotiation.json
│ │ │ ├── contract-offer-message.json
│ │ │ ├── contract-offer-message_initial.json
│ │ │ ├── contract-request-message.json
│ │ │ └── contract-request-message_initial.json
│ │ └── transfer
│ │ ├── data-address-schema.json
│ │ ├── example
│ │ ├── transfer-completion-message.json
│ │ ├── transfer-error.json
│ │ ├── transfer-process.json
│ │ ├── transfer-request-message.json
│ │ ├── transfer-start-message.json
│ │ ├── transfer-suspension-message.json
│ │ └── transfer-termination-message.json
│ │ ├── transfer-completion-message-schema.json
│ │ ├── transfer-error-schema.json
│ │ ├── transfer-process-schema.json
│ │ ├── transfer-request-message-schema.json
│ │ ├── transfer-schema.json
│ │ ├── transfer-start-message-schema.json
│ │ ├── transfer-suspension-message-schema.json
│ │ └── transfer-termination-message-schema.json
│ └── test
│ └── java
│ └── org
│ └── eclipse
│ └── dsp
│ ├── DspConstants.java
│ ├── context
│ ├── catalog
│ │ └── CatalogContextTest.java
│ ├── fixtures
│ │ └── AbstractJsonLdTest.java
│ ├── negotiation
│ │ └── ContractNegotiationContextTest.java
│ └── transfer
│ │ └── TransferContextTest.java
│ └── schema
│ ├── catalog
│ ├── CatalogErrorSchemaTest.java
│ ├── CatalogRequestMessageSchemaTest.java
│ ├── CatalogSchemaTest.java
│ ├── DatasetRequestMessageSchemaTest.java
│ ├── DatasetResponseTest.java
│ ├── DatasetSchemaTest.java
│ ├── InvalidCatalogSchemaTest.java
│ ├── InvalidDatasetSchemaTest.java
│ └── NestedCatalogSchemaTest.java
│ ├── common
│ ├── CommonSchemaTest.java
│ ├── InvalidVersionSchemaTest.java
│ └── VersionSchemaTest.java
│ ├── fixtures
│ └── AbstractSchemaTest.java
│ ├── negotiation
│ ├── AgreementSchemaTest.java
│ ├── ContractAgreementMessageSchemaTest.java
│ ├── ContractAgreementVerificationMessageSchemaTest.java
│ ├── ContractNegotiationErrorSchemaTest.java
│ ├── ContractNegotiationEventMessageSchemaTest.java
│ ├── ContractNegotiationSchemaTest.java
│ ├── ContractNegotiationTerminationMessageSchemaTest.java
│ ├── ContractOfferMessageSchemaTest.java
│ ├── ContractRequestMessageSchemaTest.java
│ ├── InvalidContractAgreementMessageSchemaTest.java
│ ├── InvalidContractAgreementVerificationMessageSchemaTest.java
│ ├── InvalidContractNegotiationErrorSchemaTest.java
│ ├── InvalidContractNegotiationEventMessageSchemaTest.java
│ ├── InvalidContractNegotiationSchemaTest.java
│ ├── InvalidContractNegotiationTerminationMessageSchemaTest.java
│ ├── InvalidContractOfferMessageSchemaTest.java
│ ├── InvalidContractRequestMessageSchemaTest.java
│ ├── InvalidPolicySchemaTest.java
│ └── PolicySchemaTest.java
│ └── transfer
│ ├── InvalidTransferCompletionMessageSchemaTest.java
│ ├── InvalidTransferErrorSchemaTest.java
│ ├── InvalidTransferProcessSchemaTest.java
│ ├── InvalidTransferRequestMessageSchemaTest.java
│ ├── InvalidTransferSchemaTest.java
│ ├── InvalidTransferStartMessageSchemaTest.java
│ ├── InvalidTransferSuspensionMessageSchemaTest.java
│ ├── InvalidTransferTerminationMessageSchemaTest.java
│ ├── TransferCompletionMessageSchemaTest.java
│ ├── TransferErrorSchemaTest.java
│ ├── TransferProcessSchemaTest.java
│ ├── TransferRequestMessageSchemaTest.java
│ ├── TransferSchemaTest.java
│ ├── TransferStartMessageSchemaTest.java
│ ├── TransferSuspensionMessageSchemaTest.java
│ └── TransferTerminationMessageSchemaTest.java
├── index.html
└── specifications
├── catalog
├── README.md
├── catalog.binding.https.md
└── catalog.protocol.md
├── common
├── common.protocol.md
├── foreword.md
├── introduction.md
├── normative.references.md
├── scope.md
├── style
│ └── diagram.styles.puml
├── terminology.md
└── type.definitions.md
├── negotiation
├── README.md
├── contract.negotiation.binding.https.md
├── contract.negotiation.protocol.md
├── figures
│ ├── contract.negotiation.state.machine.png
│ └── contract.negotiation.state.machine.puml
└── message
│ └── diagram
│ ├── contract-agreement-message.png
│ ├── contract-agreement-message.puml
│ ├── contract-agreement-verification-message.png
│ ├── contract-agreement-verification-message.puml
│ ├── contract-negotiation-error.png
│ ├── contract-negotiation-error.puml
│ ├── contract-negotiation-event-message.png
│ ├── contract-negotiation-event-message.puml
│ ├── contract-negotiation-termination-message.png
│ ├── contract-negotiation-termination-message.puml
│ ├── contract-negotiation.png
│ ├── contract-negotiation.puml
│ ├── contract-offer-message.png
│ ├── contract-offer-message.puml
│ ├── contract-offer-message_initial.png
│ ├── contract-offer-message_initial.puml
│ ├── contract-request-message.png
│ ├── contract-request-message.puml
│ ├── contract-request-message_initial.png
│ └── contract-request-message_initial.puml
└── transfer
├── README.md
├── figures
├── pull-transfer-process.png
├── pull-transfer-process.puml
├── push-transfer-process.png
├── push-transfer-process.puml
├── transfer-process-state-machine.png
└── transfer-process-state-machine.puml
├── transfer.process.binding.https.md
└── transfer.process.protocol.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | #
2 | # https://help.github.com/articles/dealing-with-line-endings/
3 | #
4 | # These are explicitly windows files and should use crlf
5 | *.bat text eol=crlf
6 |
7 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug Report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: [ "bug_report", "triage" ]
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Bug Report
11 |
12 | ## Describe the Bug
13 |
14 | _A clear and concise description of the bug._
15 |
16 | **Type**: `normative` / `non-normative` _<-- please specify the affected scope_
17 |
18 | ### Expected Behavior
19 |
20 | _A clear and concise description of what you expected to happen._
21 |
22 | ### Observed Behavior
23 |
24 | _A clear and concise description of what happened instead._
25 |
26 | ### Detailed Description
27 |
28 | _If applicable, add some context information to help explain your problem._
29 |
30 | ## Possible Implementation
31 |
32 | _You already know the root cause of the erroneous state and how to fix it? Feel free to share your thoughts._
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | ---
2 | blank_issues_enabled: false
3 | contact_links:
4 | - name: Ask a question or get support
5 | url: https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol/discussions
6 | about: Ask a question or request support for using the Dataspace Protocol
7 | - name: Take a look at the best practices
8 | url: https://github.com/eclipse-dataspace-protocol-base/dsp_best_practices
9 | about: Browse the best practices documents for more information
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Help us with new ideas
4 | title: ''
5 | labels: [ "feature_request", "triage" ]
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Feature Request
11 |
12 | _If you are missing a feature or have an idea how to improve this project that should first be discussed, please feel free to open up a [discussion](https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol/discussions/new)._
13 |
14 | ## Which Areas Would Be Affected?
15 |
16 | _e.g., data offering, policy negotiation, data transfer, etc._
17 |
18 | **Type**: `normative` / `non-normative` _<-- please specify the affected scope_
19 |
20 | ## Why Is the Feature Desired?
21 |
22 | _Are there any requirements?_
23 |
24 | ## Solution Proposal
25 |
26 | _If possible, provide a (brief!) solution proposal._
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## What this PR changes/adds
2 |
3 | _Briefly describe WHAT your PR changes, which features it adds/modifies._
4 |
5 | ## Why it does that
6 |
7 | _Briefly state why the change was necessary._
8 |
9 | ## Further notes
10 |
11 | _List other areas of the documents that have changed but are not necessarily linked to the main feature. This could be editorial changes or mistakes in example files that were encountered and were fixed inline, etc._
12 |
13 | ## Linked Issue(s)
14 |
15 | Closes # <-- _insert issue number if one exists_
16 |
17 | _Please be sure to take a look at the [contributing guidelines](../CONTRIBUTING.md#submit-a-pull-request) and our [etiquette for pull requests](../PR_ETIQUETTE.md)._
--------------------------------------------------------------------------------
/.github/actions/setup-java/action.yaml:
--------------------------------------------------------------------------------
1 | name: "Setup JDK 17"
2 | description: "Setup JDK 17"
3 | runs:
4 | using: "composite"
5 | steps:
6 | - name: Setup JDK 17
7 | uses: actions/setup-java@v4.1.0
8 | with:
9 | java-version: '17'
10 | distribution: 'temurin'
11 | cache: 'gradle'
12 |
--------------------------------------------------------------------------------
/.github/scripts/checkout-tags.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | mkdir -p HEAD
5 | git fetch --all --tags
6 | tags_string=$(git tag)
7 | echo got tag string
8 | echo $tags_string
9 | tags_array=($tags_string)
10 | mv $(ls --ignore=HEAD) HEAD/
11 | for tag in "${tags_array[@]}"
12 | do
13 | echo starting with tag $tag
14 | mkdir $tag
15 | cd $tag
16 | git clone https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol.git --depth 1 --branch ${tag} --quiet
17 | mv ./DataspaceProtocol/* .
18 | cd ..
19 | done
20 | for dir in */; do
21 | echo "$dir"
22 | pwd
23 | ls -l
24 | if [ -f "$dir/index.html" ]; then
25 | cd "$dir/artifacts"
26 | ./gradlew build
27 | ./gradlew generateTablesFromSchemas
28 | cd ..
29 | pwd
30 | mkdir ./figures
31 | mkdir -p ./message/schema
32 | mkdir -p ./message/example
33 | mkdir -p ./message/table
34 | cp -r ./artifacts/src/main/resources/**/*-schema.json ./message/schema
35 | echo "successfully copied message schemas"
36 | cp -r ./artifacts/src/main/resources/context/*.jsonld ./message/schema
37 | echo "successfully copied jsonld contexts"
38 | cp -r ./artifacts/src/main/resources/**/example/*.json ./message/example
39 | echo "successfully copied message examples"
40 | cp -r ./specifications/**/figures/*.png ./figures/
41 | echo "successfully copied figures"
42 | cp -r ./artifacts/build/generated/tables/*.html ./message/table
43 | echo "successfully copied message property tables"
44 | cd ..
45 | else
46 | echo "index does not exist. No copy operations"
47 | fi
48 | done
--------------------------------------------------------------------------------
/.github/scripts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 | This redirects to the latest Release Candidate here
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.github/workflows/autopublish.yaml:
--------------------------------------------------------------------------------
1 | name: Auto-Publish
2 | on:
3 | push:
4 | branches:
5 | - main
6 | workflow_dispatch:
7 |
8 | jobs:
9 | build:
10 | name: Build and Validate
11 | runs-on: ubuntu-22.04
12 | permissions:
13 | contents: write
14 | steps:
15 | - uses: actions/checkout@v4
16 | - uses: ./.github/actions/setup-java
17 | - name: Copy files for correct web access
18 | run: |
19 | chmod +x ./.github/scripts/checkout-tags.sh
20 | ./.github/scripts/checkout-tags.sh
21 | - name: Redirect top to head
22 | run: cp .github/scripts/index.html .
23 | - uses: actions/upload-pages-artifact@v3
24 | with:
25 | path: .
26 | deploy:
27 | needs: build
28 | permissions:
29 | pages: write
30 | id-token: write
31 | environment:
32 | name: github-pages
33 | url: ${{ steps.deployment.outputs.page_url }}
34 | runs-on: ubuntu-22.04
35 | steps:
36 | - name: Deploy to GitHub Pages
37 | id: deployment
38 | uses: actions/deploy-pages@v4
--------------------------------------------------------------------------------
/.github/workflows/pr-check.yml:
--------------------------------------------------------------------------------
1 | name: Check Pull Request
2 |
3 | on:
4 | pull_request:
5 | branches: [ main ]
6 | types: [opened, edited, synchronize, reopened]
7 |
8 | jobs:
9 | trigger-workflow:
10 | uses: eclipse-dataspace-protocol-base/.github/.github/workflows/scan-pr-title.yml@main
11 | run-tests:
12 | name: gradle
13 | runs-on: ubuntu-22.04
14 | steps:
15 | - uses: actions/checkout@v4
16 | - uses: ./.github/actions/setup-java
17 | - name: run
18 | run: |
19 | cd artifacts
20 | chmod +x ./gradlew
21 | ./gradlew build
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.log
2 | # Package Files #
3 | *.jar
4 | *.war
5 | *.nar
6 | *.ear
7 | *.zip
8 | *.tar.gz
9 | *.rar
10 |
11 | .idea
12 | *.iml
13 | .vs
14 | .vscode
15 |
16 | /secrets
17 | **/secrets
18 |
19 | .DS_Store
20 | .env
21 |
22 | /message
23 | /2024-1
24 | /v0.8
25 | /figures
26 | /HEAD
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | See the [Eclipse Code Of Conduct](https://www.eclipse.org/org/documents/Community_Code_of_Conduct.php).
--------------------------------------------------------------------------------
/PR_ETIQUETTE.md:
--------------------------------------------------------------------------------
1 | # Etiquette for Pull Requests
2 |
3 | ## As a contributor
4 |
5 | Submitting pull requests should be done while adhering to a couple of simple rules.
6 |
7 | - Familiarize yourself with our [contribution guidelines](CONTRIBUTING.md).
8 | - Before you submit a PR, open a [discussion](https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol/discussions/new) or an [issue](https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol/issues/new) outlining your planned work and give people time to comment. It may even be advisable to contact committers using the `@mention` feature. Unsolicited PRs may get ignored or rejected.
9 | - Create focused PRs: Your work should focus on one feature or bugfix. Do not create broad-scoped PRs that solve multiple issues, as reviewers may reject those PR bombs outright.
10 | - Provide a clear description and motivation in the PR description in GitHub. This makes the reviewer's life much easier. It is also helpful to outline the broad changes that were made.
11 | - All tests should be green, especially when your PR is in `"Ready for review"`
12 | - Mark PRs as `"Ready for review"` only when you're prepared to defend your work. By then, you have completed your work and shouldn't need to push any more commits other than to incorporate review comments.
13 | - Merge conflicts should be resolved by rebasing onto `main` and force-pushing. Do this when your PR is ready to review.
14 | - If you require a reviewer's input while it's still in draft, please get in touch with the designated reviewer using the `@mention` feature and let them know what you'd like them to look at.
15 | - Request a review from one of the [project's committers](https://projects.eclipse.org/projects/technology.dataspace-protocol-base/who). Requesting a review from anyone else is still possible and sometimes may be advisable. Still, only committers can merge PRs, so include them early on.
16 | - Re-request reviews after all remarks have been adopted. This helps reviewers track their work in GitHub.
17 | - If you disagree with a committer's remarks, feel free to object and argue. Still, if no agreement is reached, you must either accept the decision or withdraw your PR.
18 | - Be civil and objective. No foul language, insulting, or otherwise abusive language will be tolerated.
19 | - The PR titles must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
20 | - The title must follow the format as `(): `.
21 | `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, and `test` are allowed for the ``.
22 | - The length must be kept under 80 characters.
23 |
24 | ## As a reviewer
25 |
26 | - Please complete reviews within five business days or delegate to another committer, removing yourself as a reviewer.
27 | If you have been requested as a reviewer but cannot do the review for any reason (time, lack of knowledge in a particular area, etc.), please comment on that in the PR and remove yourself as a reviewer, suggesting a stand-in.
28 | - Don't be overly pedantic.
29 | - Don't argue basic principles (e.g., protocol architecture).
30 | - Don't just wave through any PR. Please take the time to look at them carefully.
31 | - Be civil and objective. No foul language, insulting, or otherwise abusive language will be tolerated. The goal is to _encourage_ contributions.
32 | - Committers can merge PRs with the approval of one other committer, provided there are no objections.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dataspace Protocol
2 |
3 | The __Dataspace Protocol__ is a set of specifications designed to facilitate interoperable data sharing between entities governed by usage control and based on Web technologies. These specifications define the schemas and protocols required for entities to publish data, negotiate [Agreements](https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#dfn-agreement), and access data as part of a federation of technical systems termed a [Dataspace](https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/#dfn-dataspace).
4 |
5 | The web rendering of the Dataspace Protocol represents the current state on this repo's main branch: https://eclipse-dataspace-protocol-base.github.io/DataspaceProtocol/.
6 |
7 | ## About versions
8 |
9 | Previous versions of the Dataspace Protocol ([0.8](https://github.com/International-Data-Spaces-Association/ids-specification/releases/tag/v0.8) and [2024-1](https://github.com/International-Data-Spaces-Association/ids-specification/releases/tag/2024-1)) have been developed and released under the governance of the [International Data Spaces Association (IDSA)](https://internationaldataspaces.org/).
10 |
11 | Subsequent versions of the Dataspace Protocol are maintained and developed within the [Eclipse Dataspace Protocol project](https://projects.eclipse.org/projects/technology.dataspace-protocol-base) associated with the [Eclipse Dataspace Working Group](https://dataspace.eclipse.org/), under the governance of the [Eclipse Foundation (EF)](https://www.eclipse.org/). Version [2024-1](https://github.com/International-Data-Spaces-Association/ids-specification/releases/tag/2024-1) marks the initial contribution to the [Eclipse Dataspace Protocol project](https://projects.eclipse.org/projects/technology.dataspace-protocol-base) by the IDSA.
12 |
13 | ## Best practices
14 |
15 | Additional, non-normative information related to the Dataspace Protocol can be found in the [DSP Best Practices Guide](https://github.com/eclipse-dataspace-protocol-base/dsp_best_practices).
16 |
17 | ## How to contribute
18 |
19 | Users of the Dataspace Protocol are invited to provide feedback such as, but not limited to:
20 |
21 | * What information is missing?
22 | * What information, including examples, would you like to see?
23 | * What did you like in this document?
24 |
25 | Please provide your feedback as a [Discussion](https://github.com/eclipse-dataspace-protocol-base/DataspaceProtocol/discussions) in this repository.
26 |
27 | For more information, please take a look at the [CONTRIBUTING](CONTRIBUTING.md) file.
28 |
--------------------------------------------------------------------------------
/WEBSITE.md:
--------------------------------------------------------------------------------
1 | ## Static Rendering and Web Deployment
2 |
3 | This repository contains the set of artifacts that make up the normative
4 | and non-normative sections of the Dataspace Protocol. All artifacts are
5 | bundled by the [respec framework](https://www.respec.org) which takes care
6 | of rendering a static website.
7 |
8 | ### Conventions
9 |
10 | The following extensions to the basic markdown syntax are used in this
11 | specification project. Keep them handy and navigating the document will
12 | be easy.
13 |
14 | - Referencing an external specification document. [Respec Docs](https://respec.org/docs/#references-0)
15 | - with identifier inline `[[foreign-spec-id]]`
16 | - with the foreign spec's display name inline `[[[foreign-spec-id]]]`
17 | - referencing a particular section in a remote document works via ordinary markdown links. The reference has to be added to the `References` section manually (if it's not already there).
18 | - Defining terminology: A term is defined by wrapping it in `Defineable `. [Respec Docs](https://respec.org/docs/#definitions-and-linking)
19 | - Custom section IDs: If various sections have the same heading, they must be given a unique id manually via `{#my-custom-section-id}` that can then be used for referencing it. [Respec Docs](https://respec.org/docs/#example-specifying-a-custom-id-for-a-heading)
20 | - Referencing within the document. Please note that despite separation in multiple markdown files, there is only one html document. References to sections must be flat `(#section)` instead of path-based `../catalog/catalog.protocol.md#response-types`.
21 | - with the sections number and display name inline `[[[#my-section-id]]]`
22 | - If that's not desired, ordinary links work as well. `[my custom link](#my-section-id)`
23 | - referencing terminology: `[=Defineable=]`. This will work out of the box with Plurals such that `[=Definables=]` refers to the definition of `Defineable `.
24 | - Code blocks work natively like in markdown.
25 |
26 | ### Rendering in your IDE
27 |
28 | 1. Locally execute the commands from the [autopublish](.github/workflows/autopublish.yaml) workflow's "Copy files for correct web access" step. All resulting folders and files are duplicates, gitignored and don't break anything.
29 | 2. Open the `index.html` file.
30 | 3. You IDE should have a feature to display html documents (either in your browser of choice or inline). Use that and you should always see the updated webpage when saving.
--------------------------------------------------------------------------------
/artifacts/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | build/
3 | !gradle/wrapper/gradle-wrapper.jar
4 | !**/src/main/**/build/
5 | !**/src/test/**/build/
6 |
7 | ### IntelliJ IDEA ###
8 | .idea/modules.xml
9 | .idea/jarRepositories.xml
10 | .idea/compiler.xml
11 | .idea/libraries/
12 | *.iws
13 | *.iml
14 | *.ipr
15 | .idea
16 | out/
17 | !**/src/main/**/out/
18 | !**/src/test/**/out/
19 |
20 | ### Eclipse ###
21 | .apt_generated
22 | .classpath
23 | .factorypath
24 | .project
25 | .settings
26 | .springBeans
27 | .sts4-cache
28 | bin/
29 | !**/src/main/**/bin/
30 | !**/src/test/**/bin/
31 |
32 | ### NetBeans ###
33 | /nbproject/private/
34 | /nbbuild/
35 | /dist/
36 | /nbdist/
37 | /.nb-gradle/
38 |
39 | ### VS Code ###
40 | .vscode/
41 |
42 | ### Mac OS ###
43 | .DS_Store
44 |
45 |
46 |
--------------------------------------------------------------------------------
/artifacts/README.md:
--------------------------------------------------------------------------------
1 | # dsp-schemas
2 | Tools for defining and generating DSP schemas
3 |
--------------------------------------------------------------------------------
/artifacts/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import org.eclipse.dsp.generation.SchemaTableGeneratorPlugin
2 | import org.eclipse.dsp.generation.SchemaTableGeneratorPluginExtension
3 |
4 | /*
5 | * Copyright (c) 2024 Metaform Systems, Inc.
6 | *
7 | * This program and the accompanying materials are made available under the
8 | * terms of the Apache License, Version 2.0 which is available at
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * SPDX-License-Identifier: Apache-2.0
12 | *
13 | * Contributors:
14 | * Metaform Systems, Inc. - initial API and implementation
15 | *
16 | */
17 |
18 | plugins {
19 | `java-library`
20 | checkstyle
21 | }
22 |
23 | apply();
24 |
25 | repositories {
26 | mavenCentral()
27 | }
28 |
29 | configure {
30 | schemaPrefix = "https://w3id.org/dspace/2025/1/"
31 | schemaFileSuffix = "-schema.json"
32 | }
33 |
34 | dependencies {
35 | implementation("com.networknt:json-schema-validator:1.5.2") {
36 | exclude("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml")
37 | }
38 |
39 | testImplementation("org.assertj:assertj-core:3.26.3")
40 | testImplementation("com.apicatalog:titanium-json-ld:1.4.1")
41 | testImplementation("org.glassfish:jakarta.json:2.0.1")
42 | testImplementation("com.fasterxml.jackson.core:jackson-databind:2.18.0")
43 | testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jakarta-jsonp:2.18.0")
44 | }
45 |
46 | testing {
47 | suites {
48 | val test by getting(JvmTestSuite::class) {
49 | useJUnitJupiter("5.8.1")
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/artifacts/buildSrc/README.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | This directory contains the Schema Table Generator plugin. The plugin generates readable type information in HTML for Json
4 | schema definitions found in the project source set.
5 |
6 | For example:
7 |
8 | ```html
9 |
10 |
11 |
12 | MessageOffer
13 |
14 |
15 | Required properties
16 |
17 |
18 | @id
19 | string
20 |
21 |
22 |
23 | @type
24 | string
25 | Value must be Offer
26 |
27 |
28 | Optional properties
29 |
30 |
31 | obligation
32 | array
33 |
34 |
35 |
36 | permission
37 | array
38 |
39 |
40 |
41 | profile
42 | any
43 |
44 |
45 |
46 | ```
47 |
48 | For each type, a generated HTML table is created and output to `/generated/tables`. File names are the
49 | typename in lowercase with an `.html` suffix. These files may then be imported into the ReSpec-based documentation using
50 | the `aside` element in the appropriate Markdown file:
51 |
52 | ```html
53 |
54 |
55 | ```
56 |
57 | ## Implementation notes
58 |
59 | The Json Schema Object Model parser does not yet support all Json Schema features such `anyOf` or `oneOf`.
60 |
61 | # Build Setup
62 |
63 | The plugin can be applied and configured as follows:
64 |
65 | ```kotlin
66 | apply();
67 |
68 | configure {
69 | schemaPrefix = "https://w3id.org/dspace/2025/1/"
70 | schemaFileSuffix = "-schema.json"
71 | }
72 | ```
73 |
74 | The `schemPrefix` property is used to specify the base URL for resolving schema references. This base URL will be mapped
75 | relative to where the schema files reside on the local filesystem. The `schemaFileSuffix` propery is used to filter
76 | schema files to include.
77 |
78 | # Running
79 |
80 | The generation process can be run by specifying the `generateTablesFromSchemas` task:
81 |
82 | ```
83 | ./gradlew generateTablesFromSchemas
84 | ```
85 |
86 | To debug the generation process, use:
87 |
88 | ```
89 | ./gradlew -Dorg.gradle.debug=true --no-daemon generateTablesFromSchemas
90 | ```
91 |
92 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | plugins {
16 | `java-library`
17 | checkstyle
18 | }
19 |
20 | repositories {
21 | mavenCentral()
22 | }
23 |
24 | dependencies {
25 | implementation("com.networknt:json-schema-validator:1.5.2") {
26 | exclude("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml")
27 | }
28 | testImplementation("org.assertj:assertj-core:3.26.3")
29 | }
30 |
31 | testing {
32 | suites {
33 | val test by getting(JvmTestSuite::class) {
34 | useJUnitJupiter("5.8.1")
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/SchemaTableGeneratorPluginExtension.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation;
16 |
17 | /**
18 | * Defines the plugin configuration.
19 | */
20 | public class SchemaTableGeneratorPluginExtension {
21 | private String schemaPrefix;
22 | private String schemaFileSuffix = "-schema.json";
23 |
24 | public SchemaTableGeneratorPluginExtension() {
25 | }
26 |
27 | public String getSchemaPrefix() {
28 | return schemaPrefix;
29 | }
30 |
31 | public void setSchemaPrefix(String schemaPrefix) {
32 | this.schemaPrefix = schemaPrefix;
33 | }
34 |
35 | public String getSchemaFileSuffix() {
36 | return schemaFileSuffix;
37 | }
38 |
39 | public void setSchemaFileSuffix(String schemaFileSuffix) {
40 | this.schemaFileSuffix = schemaFileSuffix;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/jsom/ElementDefinition.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | import org.jetbrains.annotations.NotNull;
18 |
19 | import java.util.Set;
20 | import java.util.TreeSet;
21 |
22 | /**
23 | * Models an element such as {@code contains} object or an {@code items} object.
24 | */
25 | public class ElementDefinition implements Comparable {
26 |
27 | public enum Type {
28 | REFERENCE, CONSTANT, JSON
29 | }
30 |
31 | private final Type type;
32 | private final String value;
33 | private final Set resolvedTypes = new TreeSet<>();
34 |
35 | public ElementDefinition(Type type, String value) {
36 | this.type = type;
37 | this.value = value;
38 | }
39 |
40 | public Type getType() {
41 | return type;
42 | }
43 |
44 | public String getValue() {
45 | return value;
46 | }
47 |
48 | public Set getResolvedTypes() {
49 | return resolvedTypes;
50 | }
51 |
52 | public void resolvedType(SchemaType resolvedType) {
53 | this.resolvedTypes.add(resolvedType);
54 | }
55 |
56 | @Override
57 | public int compareTo(@NotNull ElementDefinition o) {
58 | return value.compareTo(o.value);
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/jsom/JsonSchemaKeywords.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | /**
18 | * Json Schema keywords.
19 | */
20 | public interface JsonSchemaKeywords {
21 | String REF = "$ref";
22 | String ALL_OF = "allOf";
23 | String ANY_OF = "anyOf";
24 | String COMMENT = "$comment";
25 | String CONST = "const";
26 | String CONTAINS = "contains";
27 | String DEFINITIONS = "definitions";
28 | String ITEMS = "items";
29 | String ONE_OF = "oneOf";
30 | String PROPERTIES = "properties";
31 | String REQUIRED = "required";
32 | String TYPE = "type";
33 | }
34 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/jsom/JsonTypeMappings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | import java.util.HashMap;
18 | import java.util.Map;
19 |
20 | import static org.eclipse.dsp.generation.jsom.JsonTypes.ANY;
21 | import static org.eclipse.dsp.generation.jsom.JsonTypes.ARRAY;
22 | import static org.eclipse.dsp.generation.jsom.JsonTypes.BOOLEAN;
23 | import static org.eclipse.dsp.generation.jsom.JsonTypes.INTEGER;
24 | import static org.eclipse.dsp.generation.jsom.JsonTypes.NULL;
25 | import static org.eclipse.dsp.generation.jsom.JsonTypes.NUMBER;
26 | import static org.eclipse.dsp.generation.jsom.JsonTypes.OBJECT;
27 | import static org.eclipse.dsp.generation.jsom.JsonTypes.STRING;
28 |
29 | /**
30 | * Maps Json base types to their name.
31 | */
32 | public class JsonTypeMappings {
33 |
34 | public static final Map TYPE_MAPPINGS = new HashMap<>();
35 |
36 | static {
37 | TYPE_MAPPINGS.put(STRING.getBaseType(), STRING);
38 | TYPE_MAPPINGS.put(NUMBER.getBaseType(), NUMBER);
39 | TYPE_MAPPINGS.put(INTEGER.getBaseType(), INTEGER);
40 | TYPE_MAPPINGS.put(OBJECT.getBaseType(), OBJECT);
41 | TYPE_MAPPINGS.put(ARRAY.getBaseType(), ARRAY);
42 | TYPE_MAPPINGS.put(BOOLEAN.getBaseType(), BOOLEAN);
43 | TYPE_MAPPINGS.put(NULL.getBaseType(), NULL);
44 | TYPE_MAPPINGS.put(ANY.getBaseType(), ANY);
45 | }
46 |
47 | private JsonTypeMappings() {
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/jsom/JsonTypes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | /**
18 | * The Json Schema type system.
19 | */
20 | public interface JsonTypes {
21 |
22 | SchemaType STRING = new SchemaType("string");
23 |
24 | SchemaType NUMBER = new SchemaType("number");
25 |
26 | SchemaType INTEGER = new SchemaType("integer");
27 |
28 | SchemaType OBJECT = new SchemaType("object");
29 |
30 | SchemaType ARRAY = new SchemaType("array");
31 |
32 | SchemaType BOOLEAN = new SchemaType("boolean");
33 |
34 | SchemaType NULL = new SchemaType("null");
35 |
36 | SchemaType ANY = new SchemaType("any");
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/jsom/SchemaModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | import org.jetbrains.annotations.NotNull;
18 |
19 | import java.util.Collection;
20 |
21 | /**
22 | * Represents a JSON Schema Object Model (JSOM).
23 | */
24 | public interface SchemaModel {
25 |
26 | /**
27 | * Resolves a reference to a schema type for a given context or null if not found.
28 | */
29 | SchemaType resolveType(String reference, String typeContext);
30 |
31 | /**
32 | * Returns all schema types defined in the model.
33 | */
34 | @NotNull
35 | Collection getSchemaTypes();
36 | }
37 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/jsom/SchemaPropertyReference.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | import org.jetbrains.annotations.NotNull;
18 |
19 | import static java.util.Objects.requireNonNull;
20 |
21 | /**
22 | * A reference to a schema property.
23 | */
24 | public class SchemaPropertyReference implements Comparable {
25 | private final String name;
26 | private SchemaProperty resolvedProperty;
27 |
28 | public SchemaPropertyReference(String name) {
29 | this.name = requireNonNull(name);
30 | }
31 |
32 | public SchemaPropertyReference(String name, SchemaProperty resolvedProperty) {
33 | this.name = name;
34 | this.resolvedProperty = resolvedProperty;
35 | }
36 |
37 | public String getName() {
38 | return name;
39 | }
40 |
41 | public SchemaProperty getResolvedProperty() {
42 | return resolvedProperty;
43 | }
44 |
45 | public void resolvedProperty(SchemaProperty property) {
46 | this.resolvedProperty = property;
47 | }
48 |
49 | @Override
50 | public int compareTo(@NotNull SchemaPropertyReference o) {
51 | return name.compareTo(o.name);
52 | }
53 |
54 | @Override
55 | public String toString() {
56 | return name;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/transformer/SchemaTypeTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.transformer;
16 |
17 | import org.eclipse.dsp.generation.jsom.SchemaType;
18 | import org.jetbrains.annotations.NotNull;
19 |
20 | /**
21 | * Transforms a {@link SchemaType} to an output format.
22 | */
23 | public interface SchemaTypeTransformer {
24 |
25 | @NotNull
26 | OUTPUT transform(SchemaType schemaType);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/test/java/org/eclipse/dsp/generation/jsom/JsomParserTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | import com.fasterxml.jackson.core.JsonProcessingException;
18 | import com.fasterxml.jackson.databind.ObjectMapper;
19 | import org.junit.jupiter.api.BeforeEach;
20 | import org.junit.jupiter.api.Test;
21 |
22 | import java.util.Map;
23 | import java.util.stream.Stream;
24 |
25 | import static org.assertj.core.api.Assertions.assertThat;
26 | import static org.eclipse.dsp.generation.jsom.TestSchema.TEST_SCHEMA;
27 |
28 | class JsomParserTest {
29 | private static final String LOCAL = "/local/";
30 | private static final String SCHEMA_PREFIX = "http://foo.com/schema/";
31 | private ObjectMapper mapper;
32 | private JsomParser parser;
33 |
34 | @Test
35 | @SuppressWarnings("unchecked")
36 | void verifyParse() throws JsonProcessingException {
37 | var schema = (Map) mapper.readValue(TEST_SCHEMA, Map.class);
38 | var schemaModel = parser.parseInstances(Stream.of(new JsomParser.SchemaInstance(LOCAL + "foo.json", schema)));
39 |
40 | assertThat(schemaModel.getSchemaTypes()).isNotEmpty();
41 |
42 | var policyClass = schemaModel.resolveType("PolicyClass", LOCAL);
43 |
44 | assertThat(policyClass.getProperties().size()).isEqualTo(4); // PolicyClass should have 4 properties
45 | //noinspection OptionalGetWithoutIsPresent
46 | assertThat(policyClass.getProperties().stream()
47 | .filter(p -> p.getName().equals("profile"))
48 | .findFirst().get()
49 | .getItemTypes().iterator().next().getValue())
50 | .isEqualTo(JsonTypes.STRING.getBaseType());
51 |
52 | var agreement = schemaModel.resolveType("Agreement", LOCAL);
53 | assertThat(agreement.getResolvedAllOf()).contains(policyClass);
54 | assertThat(agreement.getProperties().size()).isEqualTo(5); // Agreement should have 5 properties
55 | assertThat(agreement.getTransitiveRequiredProperties().size()).isEqualTo(5);
56 | assertThat(agreement.getTransitiveOptionalProperties().size()).isEqualTo(4);
57 |
58 | assertThat(agreement.getRequiredProperties())
59 | .filteredOn(p -> p.getName().equals("assignee"))
60 | .first()
61 | .extracting(p -> p.getResolvedProperty().getDescription())
62 | .isEqualTo("The dataset consumer");
63 |
64 | }
65 |
66 | @BeforeEach
67 | void setUp() {
68 | mapper = new ObjectMapper();
69 | parser = new JsomParser(SCHEMA_PREFIX, LOCAL, mapper);
70 | }
71 | }
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/test/java/org/eclipse/dsp/generation/jsom/JsonTypesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | import org.junit.jupiter.api.Test;
18 |
19 | import static org.assertj.core.api.Assertions.assertThat;
20 |
21 | class JsonTypesTest {
22 |
23 | @Test
24 | void verifyTypes() {
25 | assertThat(JsonTypes.ANY.getBaseType()).isEqualTo("any");
26 | assertThat(JsonTypes.ARRAY.getBaseType()).isEqualTo("array");
27 | assertThat(JsonTypes.BOOLEAN.getBaseType()).isEqualTo("boolean");
28 | assertThat(JsonTypes.INTEGER.getBaseType()).isEqualTo("integer");
29 | assertThat(JsonTypes.NULL.getBaseType()).isEqualTo("null");
30 | assertThat(JsonTypes.NUMBER.getBaseType()).isEqualTo("number");
31 | assertThat(JsonTypes.OBJECT.getBaseType()).isEqualTo("object");
32 | assertThat(JsonTypes.STRING.getBaseType()).isEqualTo("string");
33 | }
34 | }
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/test/java/org/eclipse/dsp/generation/jsom/SchemaTypeTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.jsom;
16 |
17 | import org.junit.jupiter.api.Test;
18 |
19 | import java.util.List;
20 | import java.util.Set;
21 |
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | class SchemaTypeTest {
25 |
26 | @Test
27 | void verifyResolvePropertyReferences() {
28 | var fooSchema = new SchemaType("Bar", "SchemaFile");
29 |
30 | var requiredProperty = SchemaProperty.Builder.newInstance()
31 | .name("requiredProperty")
32 | .types(Set.of("string"))
33 | .build();
34 |
35 | var optionalProperty = SchemaProperty.Builder.newInstance()
36 | .name("optionalProperty")
37 | .types(Set.of("string"))
38 | .build();
39 |
40 | fooSchema.properties(List.of(requiredProperty, optionalProperty));
41 | fooSchema.required(Set.of(new SchemaPropertyReference("requiredProperty")));
42 |
43 | fooSchema.resolvePropertyReferences();
44 |
45 | assertThat(fooSchema.getTransitiveRequiredProperties().size()).isEqualTo(1);
46 | assertThat(fooSchema.getTransitiveRequiredProperties().iterator().next().getResolvedProperty()).isEqualTo(requiredProperty);
47 |
48 | assertThat(fooSchema.getTransitiveOptionalProperties().size()).isEqualTo(1);
49 | assertThat(fooSchema.getTransitiveOptionalProperties().iterator().next().getResolvedProperty()).isEqualTo(optionalProperty);
50 |
51 | }
52 |
53 | @Test
54 | void verifyTransitiveProperties() {
55 | var abstractFooSchema = new SchemaType("AbstractFoo", "SchemaFile");
56 |
57 | var abstractProperty = SchemaProperty.Builder.newInstance()
58 | .name("abstractProperty")
59 | .types(Set.of("string"))
60 | .build();
61 |
62 | var abstractRequiredProperty = SchemaProperty.Builder.newInstance()
63 | .name("abstractRequiredProperty")
64 | .types(Set.of("string"))
65 | .build();
66 |
67 | abstractFooSchema.properties(List.of(abstractProperty, abstractRequiredProperty));
68 |
69 | var fooSchema = new SchemaType("Foo", "SchemaFile");
70 | var abstractRequiredReference = new SchemaPropertyReference("abstractRequiredProperty");
71 | fooSchema.required(Set.of(abstractRequiredReference));
72 | fooSchema.resolvedAllOfType(abstractFooSchema);
73 |
74 | abstractFooSchema.resolvePropertyReferences();
75 | fooSchema.resolvePropertyReferences();
76 |
77 | assertThat(fooSchema.getTransitiveRequiredProperties().size()).isEqualTo(1);
78 | assertThat(fooSchema.getTransitiveRequiredProperties().iterator().next()).isSameAs(abstractRequiredReference);
79 |
80 | assertThat(fooSchema.getTransitiveOptionalProperties().size()).isEqualTo(1);
81 | assertThat(fooSchema.getTransitiveOptionalProperties().iterator().next().getName()).isSameAs(abstractProperty.getName());
82 |
83 | }
84 | }
--------------------------------------------------------------------------------
/artifacts/buildSrc/src/test/java/org/eclipse/dsp/generation/transformer/HtmlTableTransformerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.generation.transformer;
16 |
17 | import org.eclipse.dsp.generation.jsom.ElementDefinition;
18 | import org.eclipse.dsp.generation.jsom.SchemaProperty;
19 | import org.eclipse.dsp.generation.jsom.SchemaPropertyReference;
20 | import org.eclipse.dsp.generation.jsom.SchemaType;
21 | import org.junit.jupiter.api.BeforeEach;
22 | import org.junit.jupiter.api.Test;
23 |
24 | import java.util.List;
25 | import java.util.Set;
26 |
27 | import static org.assertj.core.api.Assertions.assertThat;
28 | import static org.eclipse.dsp.generation.jsom.JsonTypes.ARRAY;
29 | import static org.eclipse.dsp.generation.jsom.JsonTypes.STRING;
30 |
31 | class HtmlTableTransformerTest {
32 | private HtmlTableTransformer transformer;
33 |
34 | @Test
35 | void verifyTransform() {
36 | var barType = new SchemaType("Bar", "object", "https://test.com/foo");
37 | var fooType = new SchemaType("Foo", "object", "https://test.com/foo");
38 |
39 | var prop1 = SchemaProperty.Builder.newInstance()
40 | .name("prop1")
41 | .types(Set.of("#/definitions/Bar"))
42 | .build();
43 | prop1.resolvedType(barType);
44 |
45 | var prop2 = SchemaProperty.Builder.newInstance()
46 | .name("prop2")
47 | .types(Set.of(STRING.getName()))
48 | .build();
49 | prop2.resolvedType(STRING);
50 |
51 | var arrayElement = new ElementDefinition(ElementDefinition.Type.REFERENCE, "#/definitions/Bar");
52 | arrayElement.resolvedType(barType);
53 | var prop3 = SchemaProperty.Builder.newInstance()
54 | .name("prop3")
55 | .types(Set.of(ARRAY.getName()))
56 | .itemTypes(Set.of(arrayElement))
57 | .build();
58 | prop3.resolvedType(ARRAY);
59 |
60 | var propertyReference = new SchemaPropertyReference("prop3");
61 | propertyReference.resolvedProperty(prop3);
62 |
63 | fooType.properties(List.of(prop1, prop2, prop3));
64 | fooType.required(Set.of(propertyReference));
65 |
66 | fooType.resolvePropertyReferences();
67 | barType.resolvePropertyReferences();
68 |
69 | var result = transformer.transform(fooType);
70 |
71 | assertThat(result.contains("Foo <")).isTrue(); // verify type name
72 | assertThat(result.contains("string ")).isTrue(); // verify property type names are included
73 | assertThat(result.contains("array[Bar]")).isTrue(); // verify array type names are included
74 | }
75 |
76 | @BeforeEach
77 | void setUp() {
78 | transformer = new HtmlTableTransformer();
79 | }
80 | }
--------------------------------------------------------------------------------
/artifacts/config/checkstyle/suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/artifacts/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/artifacts/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/artifacts/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Oct 25 08:20:36 CEST 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/artifacts/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/artifacts/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | rootProject.name = "artifacts"
2 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/catalog-error-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "CatalogErrorSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/CatalogError"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/catalog/catalog-error-schema.json",
11 | "definitions": {
12 | "CatalogError": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "CatalogError"
21 | },
22 | "code": {
23 | "type": "string"
24 | },
25 | "reason": {
26 | "type": "array"
27 | }
28 | },
29 | "required": [
30 | "@context",
31 | "@type"
32 | ]
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/catalog-request-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "CatalogRequestMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/CatalogRequestMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/catalog/catalog-request-message-schema.json",
11 | "definitions": {
12 | "CatalogRequestMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "CatalogRequestMessage"
21 | },
22 | "filter": {
23 | "type": "array"
24 | }
25 | },
26 | "required": [
27 | "@context",
28 | "@type"
29 | ]
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/catalog-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "CatalogSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/RootCatalog"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/catalog/catalog-schema.json",
11 | "definitions": {
12 | "RootCatalog": {
13 | "type": "object",
14 | "allOf": [
15 | {
16 | "$ref": "#/definitions/Catalog"
17 | }
18 | ],
19 | "properties": {
20 | "@context": {
21 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
22 | },
23 | "participantId": {
24 | "type": "string"
25 | }
26 | },
27 | "required": [
28 | "@context",
29 | "participantId"
30 | ]
31 | },
32 | "Catalog": {
33 | "type": "object",
34 | "allOf": [
35 | {
36 | "$ref": "https://w3id.org/dspace/2025/1/catalog/dataset-schema.json#/definitions/AbstractDataset"
37 | },
38 | {
39 | "properties": {
40 | "@type": {
41 | "type": "string",
42 | "const": "Catalog"
43 | },
44 | "dataset": {
45 | "type": "array",
46 | "items": {
47 | "$ref": "https://w3id.org/dspace/2025/1/catalog/dataset-schema.json#/definitions/Dataset"
48 | },
49 | "minItems": 1
50 | },
51 | "catalog": {
52 | "type": "array",
53 | "items": {
54 | "$ref": "#/definitions/Catalog"
55 | },
56 | "minItems": 1
57 | },
58 | "service": {
59 | "type": "array",
60 | "items": {
61 | "$ref": "https://w3id.org/dspace/2025/1/catalog/dataset-schema.json#/definitions/DataService"
62 | },
63 | "minItems": 1
64 | }
65 | }
66 | }
67 | ],
68 | "required": [
69 | "@id",
70 | "@type"
71 | ],
72 | "anyOf": [
73 | {
74 | "not": {
75 | "required": [
76 | "hasPolicy"
77 | ]
78 | }
79 | }
80 | ]
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/dataset-request-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "DatasetRequestMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/DatasetRequestMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/catalog/dataset-request-message-schema.json",
11 | "definitions": {
12 | "DatasetRequestMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "DatasetRequestMessage"
21 | },
22 | "dataset": {
23 | "type": "string"
24 | }
25 | },
26 | "required": [
27 | "@context",
28 | "@type",
29 | "dataset"
30 | ]
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/example/catalog-error.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "CatalogError",
6 | "code": "123-A",
7 | "reason": [
8 | "Catalog not provisioned for this requester."
9 | ]
10 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/example/catalog-request-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "CatalogRequestMessage",
6 | "filter": []
7 | }
8 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/example/catalog.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@id": "urn:uuid:3afeadd8-ed2d-569e-d634-8394a8836d57",
6 | "@type": "Catalog",
7 | "participantId": "urn:example:DataProviderA",
8 | "service": [
9 | {
10 | "@id": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77",
11 | "@type": "DataService",
12 | "endpointURL": "https://provider-a.com/connector"
13 | }
14 | ],
15 | "dataset": [
16 | {
17 | "@id": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
18 | "@type": "Dataset",
19 | "hasPolicy": [
20 | {
21 | "@id": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
22 | "@type": "Offer",
23 | "permission": [
24 | {
25 | "action": "use",
26 | "constraint": [
27 | {
28 | "leftOperand": "spatial",
29 | "operator": "eq",
30 | "rightOperand": "http://example.org/EU"
31 | }
32 | ],
33 | "duty": {
34 | "action": "Attribution"
35 | }
36 | }
37 | ]
38 | }
39 | ],
40 | "distribution": [
41 | {
42 | "@type": "Distribution",
43 | "format": "HttpData-PULL",
44 | "accessService": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77"
45 | }
46 | ]
47 | }
48 | ]
49 | }
50 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/example/dataset-request-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "DatasetRequestMessage",
6 | "dataset": "urn:uuid:3afeadd8-ed2d-569e-d634-8394a8836d57"
7 | }
8 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/example/dataset.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@id": "urn:uuid:3afeadd8-ed2d-569e-d634-8394a8836d57",
6 | "@type": "Dataset",
7 | "hasPolicy": [
8 | {
9 | "@type": "Offer",
10 | "@id": "urn:uuid:2828282:3dd1add8-4d2d-569e-d634-8394a8836a88",
11 | "assigner": "http://example.com/Provider",
12 | "permission": [
13 | {
14 | "action": "use",
15 | "constraint": [
16 | {
17 | "leftOperand": "spatial",
18 | "rightOperand": "_:EU",
19 | "operator": "eq"
20 | }
21 | ]
22 | }
23 | ]
24 | }
25 | ],
26 | "distribution": [
27 | {
28 | "@type": "Distribution",
29 | "format": "HttpData-PULL",
30 | "accessService": {
31 | "@id": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77",
32 | "@type": "DataService",
33 | "endpointURL": "https://provider-a.com/connector"
34 | }
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/catalog/example/nested-catalog.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@id": "urn:uuid:3afeadd8-ed2d-569e-d634-8394a8836d57",
6 | "@type": "Catalog",
7 | "participantId": "urn:example:DataProviderA",
8 | "catalog": [
9 | {
10 | "@id": "02e83f88-f025-4a1c-89f2-8723c98fa92b",
11 | "@type": "Catalog",
12 | "distribution": [
13 | {
14 | "@type": "Distribution",
15 | "format": "Catalog",
16 | "accessService": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77"
17 | }
18 | ],
19 | "service": [
20 | {
21 | "@id": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77",
22 | "@type": "DataService",
23 | "endpointURL": "https://provder-a.com/subcatalog"
24 | }
25 | ]
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/common/context-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContextSchema",
4 | "type": "array",
5 | "items": {
6 | "type": "string"
7 | },
8 | "allOf": [
9 | {
10 | "$ref": "#/definitions/ContextSchema"
11 | }
12 | ],
13 | "$id": "https://w3id.org/dspace/2025/1/common/context-schema.json",
14 | "definitions": {
15 | "ContextSchema": {
16 | "type": "array",
17 | "items": {
18 | "type": "string",
19 | "items": {
20 | "type": "string"
21 | }
22 | },
23 | "contains": {
24 | "const": "https://w3id.org/dspace/2025/1/context.jsonld"
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/common/did-service-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "DidServiceSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/DidService"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/common/did-service-schema.json",
11 | "definitions": {
12 | "DidService": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "allOf": [
17 | {
18 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
19 | },
20 | {
21 | "type": "array",
22 | "contains": {
23 | "type": "string",
24 | "const": "https://www.w3.org/ns/did/v1"
25 | }
26 | }
27 | ]
28 | },
29 | "type": {
30 | "type": "string",
31 | "enum": [
32 | "DataService",
33 | "CatalogService"
34 | ]
35 | },
36 | "id": {
37 | "type": "string"
38 | },
39 | "serviceEndpoint": {
40 | "type": "string",
41 | "pattern": "https?://.*?/catalog$"
42 | }
43 | },
44 | "required": [
45 | "id",
46 | "type",
47 | "serviceEndpoint"
48 | ]
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/common/example/catalogservice-did-service.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld",
4 | "https://www.w3.org/ns/did/v1"
5 | ],
6 | "id":"some:id",
7 | "type": "CatalogService",
8 | "serviceEndpoint": "https://bar.example.com/some/path/catalog"
9 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/common/example/dataservice-did-service.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld",
4 | "https://www.w3.org/ns/did/v1"
5 | ],
6 | "id":"some:id",
7 | "type": "DataService",
8 | "serviceEndpoint": "https://bar.example.com/some/path/.well-known/dspace-version"
9 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/common/example/protocol-version.json:
--------------------------------------------------------------------------------
1 | {
2 | "protocolVersions": [
3 | {
4 | "version": "2025-1",
5 | "path": "/some/path/2025-1",
6 | "binding": "HTTPS"
7 | },
8 | {
9 | "version": "2024-1",
10 | "path": "/some/path/2024-1",
11 | "binding": "HTTPS",
12 | "auth": {
13 | "protocol": "OAuth",
14 | "version": "2",
15 | "profile": [
16 | "authorization_code",
17 | "refresh_token"
18 | ]
19 | }
20 | },
21 | {
22 | "version": "2025-1",
23 | "path": "/different/path/2025-1",
24 | "binding": "HTTPS",
25 | "auth": {
26 | "protocol": "DCP",
27 | "version": "1.0",
28 | "profile": [
29 | "vc11-sl2021/jwt"
30 | ]
31 | }
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/common/protocol-version-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "VersionSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/VersionResponse"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/common/protocol-version-schema.json",
11 | "definitions": {
12 | "VersionResponse": {
13 | "type": "object",
14 | "properties": {
15 | "protocolVersions": {
16 | "type": "array",
17 | "items": {
18 | "$ref": "#/definitions/Version"
19 | },
20 | "minItems": 1
21 | }
22 | },
23 | "required": [
24 | "protocolVersions"
25 | ]
26 | },
27 | "Version": {
28 | "type": "object",
29 | "properties": {
30 | "version": {
31 | "type": "string"
32 | },
33 | "path": {
34 | "type": "string"
35 | },
36 | "binding": {
37 | "type": "string",
38 | "enum": [
39 | "HTTPS"
40 | ]
41 | },
42 | "auth": {
43 | "$ref": "#/definitions/Auth"
44 | }
45 | },
46 | "required": [
47 | "version",
48 | "path",
49 | "binding"
50 | ]
51 | },
52 | "Auth": {
53 | "type": "object",
54 | "properties": {
55 | "protocol": {
56 | "type": "string"
57 | },
58 | "version": {
59 | "type": "string"
60 | },
61 | "profile": {
62 | "type": "array",
63 | "items": "string"
64 | }
65 | },
66 | "required": [
67 | "protocol",
68 | "version"
69 | ]
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/context/odrl.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "odrl": "http://www.w3.org/ns/odrl/2/",
4 | "Policy": "odrl:Policy",
5 | "Rule": "odrl:Rule",
6 | "profile": {
7 | "@type": "@id",
8 | "@id": "odrl:profile"
9 | },
10 | "prohibit": "odrl:prohibit",
11 | "Agreement": "odrl:Agreement",
12 | "Assertion": "odrl:Assertion",
13 | "Offer": "odrl:Offer",
14 | "Set": "odrl:Set",
15 | "Asset": "odrl:Asset",
16 | "hasPolicy": {
17 | "@type": "@id",
18 | "@id": "odrl:hasPolicy"
19 | },
20 | "target": {
21 | "@type": "@id",
22 | "@id": "odrl:target"
23 | },
24 | "assignee": {
25 | "@type": "@id",
26 | "@id": "odrl:assignee"
27 | },
28 | "assigner": {
29 | "@type": "@id",
30 | "@id": "odrl:assigner"
31 | },
32 | "Action": "odrl:Action",
33 | "action": {
34 | "@type": "@vocab",
35 | "@id": "odrl:action"
36 | },
37 | "Permission": "odrl:Permission",
38 | "permission": {
39 | "@type": "@id",
40 | "@id": "odrl:permission",
41 | "@container": "@set"
42 | },
43 | "Prohibition": "odrl:Prohibition",
44 | "prohibition": {
45 | "@type": "@id",
46 | "@id": "odrl:prohibition",
47 | "@container": "@set"
48 | },
49 | "obligation": {
50 | "@type": "@id",
51 | "@id": "odrl:obligation",
52 | "@container": "@set"
53 | },
54 | "use": "odrl:use",
55 | "Duty": "odrl:Duty",
56 | "duty": {
57 | "@type": "@id",
58 | "@id": "odrl:duty"
59 | },
60 | "Constraint": "odrl:Constraint",
61 | "constraint": {
62 | "@type": "@id",
63 | "@id": "odrl:constraint",
64 | "@container": "@set"
65 | },
66 | "Operator": "odrl:Operator",
67 | "operator": {
68 | "@type": "@vocab",
69 | "@id": "odrl:operator"
70 | },
71 | "RightOperand": "odrl:RightOperand",
72 | "rightOperand": "odrl:rightOperand",
73 | "LeftOperand": "odrl:LeftOperand",
74 | "leftOperand": {
75 | "@type": "@vocab",
76 | "@id": "odrl:leftOperand"
77 | },
78 | "eq": "odrl:eq",
79 | "gt": "odrl:gt",
80 | "gteq": "odrl:gteq",
81 | "lt": "odrl:lt",
82 | "lteq": "odrl:lteq",
83 | "neq": "odrl:neq",
84 | "isA": "odrl:isA",
85 | "hasPart": "odrl:hasPart",
86 | "isPartOf": "odrl:isPartOf",
87 | "isAllOf": "odrl:isAllOf",
88 | "isAnyOf": "odrl:isAnyOf",
89 | "isNoneOf": "odrl:isNoneOf",
90 | "or": "odrl:or",
91 | "xone": "odrl:xone",
92 | "and": "odrl:and",
93 | "andSequence": "odrl:andSequence"
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-agreement-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractAgreementMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractAgreementMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-agreement-message-schema.json",
11 | "definitions": {
12 | "ContractAgreementMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractAgreementMessage"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "agreement": {
29 | "$ref": "https://w3id.org/dspace/2025/1/negotiation/contract-schema.json#/definitions/Agreement"
30 | },
31 | "callbackAddress": {
32 | "type": "string"
33 | }
34 | },
35 | "required": [
36 | "@context",
37 | "@type",
38 | "providerPid",
39 | "consumerPid",
40 | "agreement",
41 | "callbackAddress"
42 | ]
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-agreement-verification-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractAgreementVerificationMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractAgreementVerificationMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-agreement-verification-message-schema.json",
11 | "definitions": {
12 | "ContractAgreementVerificationMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractAgreementVerificationMessage"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | }
28 | },
29 | "required": [
30 | "@context",
31 | "@type",
32 | "providerPid",
33 | "consumerPid"
34 | ]
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-negotiation-error-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractNegotiationErrorSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractNegotiationError"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-negotiation-error-schema.json",
11 | "definitions": {
12 | "ContractNegotiationError": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractNegotiationError"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "code": {
29 | "type": "string"
30 | },
31 | "reason": {
32 | "type": "array",
33 | "minItems": 1,
34 | "items": {}
35 | }
36 | },
37 | "required": [
38 | "@context",
39 | "@type",
40 | "providerPid",
41 | "consumerPid"
42 | ]
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-negotiation-event-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractNegotiationEventMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractNegotiationEventMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-negotiation-event-message-schema.json",
11 | "definitions": {
12 | "ContractNegotiationEventMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractNegotiationEventMessage"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "eventType": {
29 | "type": "string",
30 | "enum": [
31 | "ACCEPTED",
32 | "FINALIZED"
33 | ]
34 | }
35 | },
36 | "required": [
37 | "@context",
38 | "@type",
39 | "providerPid",
40 | "consumerPid",
41 | "eventType"
42 | ]
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-negotiation-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractNegotiationSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractNegotiation"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-negotiation-schema.json",
11 | "definitions": {
12 | "ContractNegotiation": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractNegotiation"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "state": {
29 | "type": "string",
30 | "enum": [
31 | "REQUESTED",
32 | "OFFERED",
33 | "ACCEPTED",
34 | "AGREED",
35 | "VERIFIED",
36 | "FINALIZED",
37 | "TERMINATED"
38 | ]
39 | }
40 | },
41 | "required": [
42 | "@context",
43 | "@type",
44 | "providerPid",
45 | "consumerPid",
46 | "state"
47 | ]
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-negotiation-termination-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractNegotiationTerminationMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractNegotiationTerminationMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-negotiation-termination-message-schema.json",
11 | "definitions": {
12 | "ContractNegotiationTerminationMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractNegotiationTerminationMessage"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "code": {
29 | "type": "string"
30 | },
31 | "reason": {
32 | "type": "array",
33 | "minItems": 1,
34 | "items": {}
35 | }
36 | },
37 | "required": [
38 | "@context",
39 | "@type",
40 | "providerPid",
41 | "consumerPid"
42 | ]
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-offer-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractOfferMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractOfferMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-offer-message-schema.json",
11 | "definitions": {
12 | "ContractOfferMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractOfferMessage"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "offer": {
29 | "allOf": [
30 | {
31 | "$ref": "https://w3id.org/dspace/2025/1/negotiation/contract-schema.json#/definitions/MessageOffer"
32 | },
33 | {
34 | "properties": {
35 | "@id": {
36 | "type": "string"
37 | },
38 | "target": {
39 | "type": "string"
40 | }
41 | },
42 | "required": [
43 | "@id",
44 | "target"
45 | ]
46 | }
47 | ]
48 | },
49 | "callbackAddress": {
50 | "type": "string"
51 | }
52 | },
53 | "required": [
54 | "@context",
55 | "@type",
56 | "providerPid",
57 | "offer",
58 | "callbackAddress"
59 | ]
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/contract-request-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "ContractRequestMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/ContractRequestMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/negotiation/contract-request-message-schema.json",
11 | "definitions": {
12 | "ContractRequestMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "ContractRequestMessage"
21 | },
22 | "consumerPid": {
23 | "type": "string"
24 | },
25 | "providerPid": {
26 | "type": "string"
27 | },
28 | "offer": {
29 | "oneOf": [
30 | {
31 | "$ref": "https://w3id.org/dspace/2025/1/negotiation/contract-schema.json#/definitions/MessageOffer"
32 | },
33 | {
34 | "properties": {
35 | "@id": {
36 | "type": "string"
37 | }
38 | },
39 | "required": [
40 | "@id"
41 | ],
42 | "not": {
43 | "anyOf": [
44 | {
45 | "required": [
46 | "permission"
47 | ]
48 | },
49 | {
50 | "required": [
51 | "prohibition"
52 | ]
53 | }
54 | ]
55 | }
56 | }
57 | ]
58 | },
59 | "callbackAddress": {
60 | "type": "string",
61 | "$comment": "A URL indicating where messages to the consumer should be sent"
62 | }
63 | },
64 | "required": [
65 | "@context",
66 | "@type",
67 | "consumerPid",
68 | "offer",
69 | "callbackAddress"
70 | ]
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-agreement-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractAgreementMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "agreement": {
9 | "@id": "urn:uuid:e8dc8655-44c2-46ef-b701-4cffdc2faa44",
10 | "@type": "Agreement",
11 | "target": "urn:uuid:3dd1add4-4d2d-569e-d634-8394a8836d23",
12 | "timestamp": "2023-01-01T01:00:00Z",
13 | "assigner": "http://example.com/Provider",
14 | "assignee": "http://example.com/Consumer",
15 | "permission": [
16 | {
17 | "action": "use",
18 | "constraint": [
19 | {
20 | "leftOperand": "dateTime",
21 | "operator": "lteq",
22 | "rightOperand": "2023-12-31T06:00Z"
23 | }
24 | ]
25 | }
26 | ]
27 | },
28 | "callbackAddress": "https://example.com/callback"
29 | }
30 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-agreement-verification-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractAgreementVerificationMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
8 | }
9 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-negotiation-error.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractNegotiationError",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "code": "99",
9 | "reason": [
10 | "Catalog not provisioned for this requester."
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-negotiation-event-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractNegotiationEventMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "eventType": "ACCEPTED"
9 | }
10 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-negotiation-termination-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractNegotiationTerminationMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "code": "99",
9 | "reason": [
10 | "License model does not fit."
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-negotiation.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractNegotiation",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "state": "REQUESTED"
9 | }
10 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-offer-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractOfferMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "offer": {
9 | "@type": "Offer",
10 | "@id": "urn:uuid:6bcea82e-c509-443d-ba8c-8eef25984c07",
11 | "target": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
12 | "permission": [
13 | {
14 | "action": "use",
15 | "constraint": [
16 | {
17 | "leftOperand": "dateTime",
18 | "operator": "lteq",
19 | "rightOperand": "2023-12-31T06:00Z"
20 | }
21 | ]
22 | }
23 | ]
24 | },
25 | "callbackAddress": "https://example.com/callback"
26 | }
27 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-offer-message_initial.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractOfferMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "offer": {
8 | "@type": "Offer",
9 | "@id": "urn:uuid:d526561f-528e-4d5a-ae12-9a9dd9b7a518",
10 | "assigner": "urn:tsdshhs636378",
11 | "target": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
12 | "permission": [
13 | {
14 | "action": "use"
15 | }
16 | ]
17 | },
18 | "callbackAddress": "https://example.com/callback"
19 | }
20 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-request-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractRequestMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "offer": {
9 | "@type": "Offer",
10 | "@id": "urn:uuid:d526561f-528e-4d5a-ae12-9a9dd9b7a815",
11 | "target": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
12 | "permission": [
13 | {
14 | "action": "use",
15 | "constraint": [
16 | {
17 | "leftOperand": "dateTime",
18 | "operator": "lteq",
19 | "rightOperand": "2023-12-31T06:00Z"
20 | }
21 | ]
22 | }
23 | ]
24 | },
25 | "callbackAddress": "https://example.com/callback"
26 | }
27 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/negotiation/example/contract-request-message_initial.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "ContractRequestMessage",
6 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
7 | "offer": {
8 | "@type": "Offer",
9 | "@id": "urn:uuid:2828282:3dd1add8-4d2d-569e-d634-8394a8836a89",
10 | "target": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
11 | "permission": [
12 | {
13 | "action": "use"
14 | }
15 | ]
16 | },
17 | "callbackAddress": "https://example.com/callback"
18 | }
19 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/data-address-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/DataAddress"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/data-address-schema.json",
11 | "definitions": {
12 | "DataAddress": {
13 | "type": "object",
14 | "properties": {
15 | "@type": {
16 | "type": "string",
17 | "const": "DataAddress"
18 | },
19 | "endpointType": {
20 | "type": "string"
21 | },
22 | "endpoint": {
23 | "type": "string"
24 | },
25 | "endpointProperties": {
26 | "type": "array",
27 | "items": {
28 | "$ref": "#/definitions/EndpointProperty"
29 | },
30 | "minItems": 1
31 | }
32 | },
33 | "required": [
34 | "@type",
35 | "endpointType",
36 | "endpoint"
37 | ]
38 | },
39 | "EndpointProperty": {
40 | "type": "object",
41 | "properties": {
42 | "@type": {
43 | "type": "string",
44 | "const": "EndpointProperty"
45 | },
46 | "name": {
47 | "type": "string"
48 | },
49 | "value": {
50 | "type": "string"
51 | }
52 | },
53 | "required": [
54 | "@type",
55 | "name",
56 | "value"
57 | ]
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/example/transfer-completion-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "TransferCompletionMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
8 | }
9 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/example/transfer-error.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "TransferError",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "code": "99",
9 | "reason": [
10 | "Internal error"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/example/transfer-process.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "TransferProcess",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "state": "REQUESTED"
9 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/example/transfer-request-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "TransferRequestMessage",
6 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
7 | "agreementId": "urn:uuid:e8dc8655-44c2-46ef-b701-4cffdc2faa44",
8 | "format": "example:HTTP_PUSH",
9 | "dataAddress": {
10 | "@type": "DataAddress",
11 | "endpointType": "https://w3id.org/idsa/v4.1/HTTP",
12 | "endpoint": "http://example.com",
13 | "endpointProperties": [
14 | {
15 | "@type": "EndpointProperty",
16 | "name": "authorization",
17 | "value": "TOKEN-ABCDEFG"
18 | },
19 | {
20 | "@type": "EndpointProperty",
21 | "name": "authType",
22 | "value": "bearer"
23 | }
24 | ]
25 | },
26 | "callbackAddress": "https://example.com/callback"
27 | }
28 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/example/transfer-start-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "TransferStartMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "dataAddress": {
9 | "@type": "DataAddress",
10 | "endpointType": "https://w3id.org/idsa/v4.1/HTTP",
11 | "endpoint": "http://example.com",
12 | "endpointProperties": [
13 | {
14 | "@type": "EndpointProperty",
15 | "name": "authorization",
16 | "value": "TOKEN-ABCDEFG"
17 | },
18 | {
19 | "@type": "EndpointProperty",
20 | "name": "authType",
21 | "value": "bearer"
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/example/transfer-suspension-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"],
4 | "@type": "TransferSuspensionMessage",
5 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
6 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
7 | "code": "99",
8 | "reason": [
9 | "Policy violation"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/example/transfer-termination-message.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://w3id.org/dspace/2025/1/context.jsonld"
4 | ],
5 | "@type": "TransferTerminationMessage",
6 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
7 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
8 | "code": "99",
9 | "reason": [
10 | "Policy violation"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-completion-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferCompletionMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/TransferCompletionMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-completion-message-schema.json",
11 | "definitions": {
12 | "TransferCompletionMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "TransferCompletionMessage"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | }
28 | },
29 | "required": [
30 | "@context",
31 | "@type",
32 | "providerPid",
33 | "consumerPid"
34 | ]
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-error-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferErrorSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/TransferError"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-error-schema.json",
11 | "definitions": {
12 | "TransferError": {
13 | "allOf": [
14 | {
15 | "$ref": "https://w3id.org/dspace/2025/1/transfer/transfer-schema.json#definitions/AbstractTransferCodeMessage"
16 | },
17 | {
18 | "properties": {
19 | "@type": {
20 | "type": "string",
21 | "const": "TransferError"
22 | }
23 | },
24 | "required": [
25 | "@type"
26 | ]
27 | }
28 | ],
29 | "required": [
30 | "@context",
31 | "@type",
32 | "providerPid",
33 | "consumerPid"
34 | ]
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-process-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferProcessSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/TransferProcess"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-process-schema.json",
11 | "definitions": {
12 | "TransferProcess": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "TransferProcess"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "state": {
29 | "type": "string",
30 | "enum": [
31 | "REQUESTED",
32 | "STARTED",
33 | "TERMINATED",
34 | "COMPLETED",
35 | "SUSPENDED"
36 | ]
37 | }
38 | },
39 | "required": [
40 | "@context",
41 | "@type",
42 | "providerPid",
43 | "consumerPid",
44 | "state"
45 | ]
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-request-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferRequestMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/TransferRequestMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-request-message-schema.json",
11 | "definitions": {
12 | "TransferRequestMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "TransferRequestMessage"
21 | },
22 | "agreementId": {
23 | "type": "string"
24 | },
25 | "format": {
26 | "type": "string"
27 | },
28 | "dataAddress": {
29 | "$ref": "https://w3id.org/dspace/2025/1/transfer/data-address-schema.json"
30 | },
31 | "callbackAddress": {
32 | "type": "string"
33 | },
34 | "consumerPid": {
35 | "type": "string"
36 | }
37 | },
38 | "required": [
39 | "@context",
40 | "@type",
41 | "agreementId",
42 | "format",
43 | "callbackAddress",
44 | "consumerPid"
45 | ]
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/AbstractTransferCodeMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-schema.json",
11 | "definitions": {
12 | "AbstractTransferCodeMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "providerPid": {
19 | "type": "string"
20 | },
21 | "consumerPid": {
22 | "type": "string"
23 | },
24 | "code": {
25 | "type": "string"
26 | },
27 | "reason": {
28 | "type": "array",
29 | "minItems": 1,
30 | "items": {
31 | }
32 | }
33 | },
34 | "required": [
35 | "@context",
36 | "providerPid",
37 | "consumerPid"
38 | ]
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-start-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferStartMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/TransferStartMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-start-message-schema.json",
11 | "definitions": {
12 | "TransferStartMessage": {
13 | "type": "object",
14 | "properties": {
15 | "@context": {
16 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json"
17 | },
18 | "@type": {
19 | "type": "string",
20 | "const": "TransferStartMessage"
21 | },
22 | "providerPid": {
23 | "type": "string"
24 | },
25 | "consumerPid": {
26 | "type": "string"
27 | },
28 | "dataAddress": {
29 | "$ref": "https://w3id.org/dspace/2025/1/transfer/data-address-schema.json"
30 | }
31 | },
32 | "required": [
33 | "@context",
34 | "@type",
35 | "providerPid",
36 | "consumerPid"
37 | ]
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-suspension-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferSuspensionMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/TransferSuspensionMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-suspension-message-schema.json",
11 | "definitions": {
12 | "TransferSuspensionMessage": {
13 | "allOf": [
14 | {
15 | "$ref": "https://w3id.org/dspace/2025/1/transfer/transfer-schema.json#definitions/AbstractTransferCodeMessage"
16 | },
17 | {
18 | "properties": {
19 | "@type": {
20 | "type": "string",
21 | "const": "TransferSuspensionMessage"
22 | }
23 | },
24 | "required": [
25 | "@type"
26 | ]
27 | }
28 | ],
29 | "required": [
30 | "@context",
31 | "@type",
32 | "providerPid",
33 | "consumerPid"
34 | ]
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/artifacts/src/main/resources/transfer/transfer-termination-message-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft/2019-09/schema",
3 | "title": "TransferTerminationMessageSchema",
4 | "type": "object",
5 | "allOf": [
6 | {
7 | "$ref": "#/definitions/TransferTerminationMessage"
8 | }
9 | ],
10 | "$id": "https://w3id.org/dspace/2025/1/transfer/transfer-termination-message-schema.json",
11 | "definitions": {
12 | "TransferTerminationMessage": {
13 | "allOf": [
14 | {
15 | "$ref": "https://w3id.org/dspace/2025/1/transfer/transfer-schema.json#definitions/AbstractTransferCodeMessage"
16 | },
17 | {
18 | "properties": {
19 | "@type": {
20 | "type": "string",
21 | "const": "TransferTerminationMessage"
22 | }
23 | },
24 | "required": [
25 | "@type"
26 | ]
27 | }
28 | ]
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/DspConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp;
16 |
17 | /**
18 | * Defines constants for schema validation.
19 | */
20 | public interface DspConstants {
21 |
22 | String DSP_CONTEXT = "https://w3id.org/dspace/2025/1/context.jsonld";
23 | String ODRL_PROFILE_CONTEXT = "https://w3id.org/dspace/2025/1/odrl-profile.jsonld";
24 | String DSP_PREFIX = "https://w3id.org/dspace/2025/1/";
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/context/catalog/CatalogContextTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.context.catalog;
16 |
17 | import org.eclipse.dsp.context.fixtures.AbstractJsonLdTest;
18 | import org.junit.jupiter.api.Test;
19 |
20 | public class CatalogContextTest extends AbstractJsonLdTest {
21 |
22 | @Test
23 | void verifyCatalogError() {
24 | verifyRoundTrip("/catalog/example/catalog-error.json",
25 | "/catalog/catalog-error-schema.json");
26 | }
27 |
28 | @Test
29 | void verifyCatalog() {
30 | verifyRoundTrip("/catalog/example/catalog.json",
31 | "/catalog/catalog-schema.json");
32 | }
33 |
34 | @Test
35 | void verifyDatasetRequestMessage() {
36 | verifyRoundTrip("/catalog/example/dataset-request-message.json",
37 | "/catalog/dataset-request-message-schema.json");
38 | }
39 |
40 | @Test
41 | void verifyDataset() {
42 | verifyRoundTrip("/catalog/example/dataset.json",
43 | "/catalog/dataset-schema.json");
44 | }
45 |
46 | @Test
47 | void verifyNestedCatalog() {
48 | verifyRoundTrip("/catalog/example/nested-catalog.json",
49 | "/catalog/catalog-schema.json");
50 | }
51 |
52 | @Test
53 | void verifyCatalogRequestMessage() {
54 | verifyRoundTrip("/catalog/example/catalog-request-message.json",
55 | "/catalog/catalog-request-message-schema.json");
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/context/negotiation/ContractNegotiationContextTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.context.negotiation;
16 |
17 | import org.eclipse.dsp.context.fixtures.AbstractJsonLdTest;
18 | import org.junit.jupiter.api.Test;
19 |
20 | public class ContractNegotiationContextTest extends AbstractJsonLdTest {
21 |
22 | @Test
23 | void verifyContractAgreementMessage() {
24 | verifyRoundTrip("/negotiation/example/contract-agreement-message.json",
25 | "/negotiation/contract-agreement-message-schema.json");
26 | }
27 |
28 | @Test
29 | void verifyFullAgreementMessage() {
30 | verifyRoundTrip("/negotiation/example/contract-agreement-message-full.json",
31 | "/negotiation/contract-agreement-message-schema.json");
32 | }
33 |
34 | @Test
35 | void verifyContractAgreementVerificationMessage() {
36 | verifyRoundTrip("/negotiation/example/contract-agreement-verification-message.json",
37 | "/negotiation/contract-agreement-verification-message-schema.json");
38 | }
39 |
40 | @Test
41 | void verifyContractNegotiation() {
42 | verifyRoundTrip("/negotiation/example/contract-negotiation.json",
43 | "/negotiation/contract-negotiation-schema.json");
44 | }
45 |
46 | @Test
47 | void verifyContractNegotiationEventMessage() {
48 | verifyRoundTrip("/negotiation/example/contract-negotiation-event-message.json",
49 | "/negotiation/contract-negotiation-event-message-schema.json");
50 | }
51 |
52 | @Test
53 | void verifyContractNegotiationError() {
54 | verifyRoundTrip("/negotiation/example/contract-negotiation-error.json",
55 | "/negotiation/contract-negotiation-error-schema.json");
56 | }
57 |
58 | @Test
59 | void verifyContractNegotiationTerminationMessage() {
60 | verifyRoundTrip("/negotiation/example/contract-negotiation-termination-message.json",
61 | "/negotiation/contract-negotiation-termination-message-schema.json");
62 | }
63 |
64 | @Test
65 | void verifyContractOfferMessage() {
66 | verifyRoundTrip("/negotiation/example/contract-offer-message.json",
67 | "/negotiation/contract-offer-message-schema.json");
68 | }
69 |
70 | @Test
71 | void verifyContractRequestMessage() {
72 | verifyRoundTrip("/negotiation/example/contract-request-message.json",
73 | "/negotiation/contract-request-message-schema.json");
74 | }
75 |
76 | @Test
77 | void verifyContractRequestMessageInitial() {
78 | verifyRoundTrip("/negotiation/example/contract-request-message_initial.json",
79 | "/negotiation/contract-request-message-schema.json");
80 | }
81 |
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/context/transfer/TransferContextTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.context.transfer;
16 |
17 | import org.eclipse.dsp.context.fixtures.AbstractJsonLdTest;
18 | import org.junit.jupiter.api.Test;
19 |
20 | public class TransferContextTest extends AbstractJsonLdTest {
21 |
22 | @Test
23 | void verifyTransferCompletionMessage() {
24 | verifyRoundTrip("/transfer/example/transfer-completion-message.json",
25 | "/transfer/transfer-completion-message-schema.json");
26 | }
27 |
28 | @Test
29 | void verifyTransferError() {
30 | verifyRoundTrip("/transfer/example/transfer-error.json",
31 | "/transfer/transfer-error-schema.json");
32 | }
33 |
34 | @Test
35 | void verifyTransferProcess() {
36 | verifyRoundTrip("/transfer/example/transfer-process.json",
37 | "/transfer/transfer-process-schema.json");
38 | }
39 |
40 | @Test
41 | void verifyTransferRequestMessage() {
42 | verifyRoundTrip("/transfer/example/transfer-request-message.json",
43 | "/transfer/transfer-request-message-schema.json");
44 | }
45 |
46 | @Test
47 | void verifyTransferStartMessage() {
48 | verifyRoundTrip("/transfer/example/transfer-start-message.json",
49 | "/transfer/transfer-start-message-schema.json");
50 | }
51 |
52 | @Test
53 | void verifyTransferSuspensionMessage() {
54 | verifyRoundTrip("/transfer/example/transfer-suspension-message.json",
55 | "/transfer/transfer-suspension-message-schema.json");
56 | }
57 |
58 | @Test
59 | void verifyTransferTerminationMessage() {
60 | verifyRoundTrip("/transfer/example/transfer-termination-message.json",
61 | "/transfer/transfer-termination-message-schema.json");
62 | }
63 |
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/catalog/CatalogErrorSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.catalog;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class CatalogErrorSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifyExamples() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/catalog/example/catalog-error.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyNodeCode() {
36 | assertThat(schema.validate(VALID_NO_CODE, JSON)).isEmpty();
37 | }
38 |
39 | @Test
40 | void verifyMissingContext() {
41 | assertThat(schema.validate(INVALID_MISSING_CONTEXT, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
42 | }
43 |
44 | @Test
45 | void verifyInvalidReason() {
46 | assertThat(schema.validate(INVALID_REASON, JSON).iterator().next().getType()).isEqualTo(TYPE);
47 | }
48 |
49 | @Test
50 | void verifyInvalidCode() {
51 | assertThat(schema.validate(INVALID_CODE_TYPE, JSON).iterator().next().getType()).isEqualTo(TYPE);
52 | }
53 |
54 | @BeforeEach
55 | void setUp() {
56 | setUp("/catalog/catalog-error-schema.json");
57 | }
58 |
59 | private static final String INVALID_MISSING_CONTEXT = """
60 | {
61 | "@type": "CatalogError",
62 | "code": "123-A",
63 | "reason": [
64 | "Catalog not provisioned for this requester."
65 | ]
66 | }""";
67 |
68 | private static final String VALID_NO_CODE = """
69 | {
70 | "@context": [
71 | "https://w3id.org/dspace/2025/1/context.jsonld"
72 | ],
73 | "@type": "CatalogError"
74 | }""";
75 |
76 | private static final String INVALID_CODE_TYPE = """
77 | {
78 | "@context": [
79 | "https://w3id.org/dspace/2025/1/context.jsonld"
80 | ],
81 | "@type": "CatalogError",
82 | "code": 123,
83 | "reason": [
84 | "Catalog not provisioned for this requester."
85 | ]
86 | }""";
87 |
88 | private static final String INVALID_REASON = """
89 | {
90 | "@context": [
91 | "https://w3id.org/dspace/2025/1/context.jsonld"
92 | ],
93 | "@type": "CatalogError",
94 | "code": "123-A",
95 | "reason": "Catalog not provisioned for this requester."
96 | }""";
97 | }
98 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/catalog/CatalogRequestMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 SAP SE
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * SAP SE - extension to catalog request message
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.catalog;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class CatalogRequestMessageSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/catalog/example/catalog-request-message.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/catalog/catalog-request-message-schema.json");
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/catalog/CatalogSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.catalog;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class CatalogSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifySchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/catalog/example/catalog.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | assertThat(schema.validate(MINIMAL_CATALOG, JSON)).isEmpty();
33 | }
34 |
35 | @BeforeEach
36 | void setUp() {
37 | setUp("/catalog/catalog-schema.json");
38 | }
39 |
40 | private static final String MINIMAL_CATALOG = """
41 | {
42 | "@context": [
43 | "https://w3id.org/dspace/2025/1/context.jsonld"
44 | ],
45 | "@id": "urn:uuid:3afeadd8-ed2d-569e-d634-8394a8836d57",
46 | "@type": "Catalog",
47 | "participantId": "urn:example:DataProviderA"
48 | }
49 | """;
50 | }
51 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/catalog/DatasetRequestMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.catalog;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class DatasetRequestMessageSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/catalog/example/dataset-request-message.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/catalog/dataset-request-message-schema.json");
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/catalog/DatasetResponseTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.catalog;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class DatasetResponseTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/catalog/example/dataset.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/catalog/dataset-schema.json");
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/catalog/DatasetSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.catalog;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class DatasetSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifySchema() {
28 | assertThat(schema.validate(DATASET, JSON)).isEmpty();
29 | }
30 |
31 | @BeforeEach
32 | void setUp() {
33 | setUp("/catalog/dataset-schema.json");
34 | }
35 |
36 | private static final String DATASET = """
37 | {
38 | "@context": [
39 | "https://w3id.org/dspace/2025/1/context.jsonld"
40 | ],
41 | "@id": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
42 | "hasPolicy": [
43 | {
44 | "@id": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
45 | "@type": "Offer",
46 | "permission": [
47 | {
48 | "action": "use",
49 | "constraint": [{
50 | "leftOperand": "spatial",
51 | "operator": "eq",
52 | "rightOperand": "http://example.org/EU"
53 | }]
54 | }
55 | ]
56 | }
57 | ],
58 | "distribution": [
59 | {
60 | "@type": "Distribution",
61 | "format": "HttpData-PULL",
62 | "accessService": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77"
63 | }
64 | ]
65 | }
66 | """;
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/catalog/NestedCatalogSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.catalog;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class NestedCatalogSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/catalog/example/nested-catalog.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/catalog/catalog-schema.json");
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/common/CommonSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.common;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class CommonSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyContext() {
28 | var baseInput = """
29 | ["https://w3id.org/dspace/2025/1/context.jsonld"]
30 | """;
31 | assertThat(schema.validate(baseInput, JSON)).isEmpty();
32 |
33 | var multiValueInput = """
34 | [
35 | "https://w3id.org/dspace/2025/1/context.jsonld",
36 | "https://test.com/context.json"
37 | ]
38 | """;
39 | assertThat(schema.validate(multiValueInput, JSON)).isEmpty();
40 |
41 | var missingDspValueInput = """
42 | [
43 | "https://test.com/context.json"
44 | ]
45 | """;
46 |
47 | assertThat(schema.validate(missingDspValueInput, JSON).iterator().next().getType()).isEqualTo(MIN_CONTAINS);
48 |
49 | var emptyInput = "[]";
50 | assertThat(schema.validate(emptyInput, JSON).iterator().next().getType()).isEqualTo(MIN_CONTAINS);
51 | }
52 |
53 | @BeforeEach
54 | void setUp() {
55 | setUp("/common/context-schema.json");
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/common/VersionSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.common;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class VersionSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/common/example/protocol-version.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/common/protocol-version-schema.json");
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/fixtures/AbstractSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.fixtures;
16 |
17 | import com.fasterxml.jackson.databind.ObjectMapper;
18 | import com.networknt.schema.JsonSchema;
19 | import com.networknt.schema.JsonSchemaFactory;
20 | import com.networknt.schema.SchemaLocation;
21 |
22 | import static com.networknt.schema.SpecVersion.VersionFlag.V202012;
23 | import static org.eclipse.dsp.DspConstants.DSP_PREFIX;
24 |
25 | /**
26 | * Base test class.
27 | */
28 | public abstract class AbstractSchemaTest {
29 | protected static final String MIN_CONTAINS = "minContains";
30 | protected static final String MIN_ITEMS = "minItems";
31 | protected static final String REQUIRED = "required";
32 | protected static final String ONE_OF = "oneOf";
33 | protected static final String TYPE = "type";
34 | protected static final String ENUM = "enum";
35 |
36 | private static final String CLASSPATH_SCHEMA = "classpath:/";
37 |
38 | protected ObjectMapper mapper = new ObjectMapper();
39 | protected JsonSchema schema;
40 |
41 | protected void setUp(String schemaFile) {
42 | var schemaFactory = JsonSchemaFactory.getInstance(V202012, builder ->
43 | builder.schemaMappers(schemaMappers -> schemaMappers.mapPrefix(DSP_PREFIX, CLASSPATH_SCHEMA))
44 | );
45 |
46 | schema = schemaFactory.getSchema(SchemaLocation.of(DSP_PREFIX + schemaFile));
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractAgreementMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class ContractAgreementMessageSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-agreement-message.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/negotiation/contract-agreement-message-schema.json");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractAgreementVerificationMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class ContractAgreementVerificationMessageSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-agreement-verification-message.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/negotiation/contract-agreement-verification-message-schema.json");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractNegotiationErrorSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class ContractNegotiationErrorSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifySchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-negotiation-error.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyMinimal() {
36 | assertThat(schema.validate(MINIMAL_ERROR, JSON)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/negotiation/contract-negotiation-error-schema.json");
42 | }
43 |
44 | private static final String MINIMAL_ERROR = """
45 | {
46 | "@context": [
47 | "https://w3id.org/dspace/2025/1/context.jsonld"
48 | ],
49 | "@type": "ContractNegotiationError",
50 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
51 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
52 | }
53 | """;
54 | }
55 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractNegotiationEventMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class ContractNegotiationEventMessageSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifySchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-negotiation-event-message.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | assertThat(schema.validate(ACCEPTED_EVENT_TYPE, JSON)).isEmpty();
33 | assertThat(schema.validate(FINALIZED_EVENT_TYPE, JSON)).isEmpty();
34 | }
35 |
36 | @BeforeEach
37 | void setUp() {
38 | setUp("/negotiation/contract-negotiation-event-message-schema.json");
39 | }
40 |
41 | private static final String ACCEPTED_EVENT_TYPE = """
42 | {
43 | "@context": [
44 | "https://w3id.org/dspace/2025/1/context.jsonld"
45 | ],
46 | "@type": "ContractNegotiationEventMessage",
47 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
48 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
49 | "eventType": "ACCEPTED"
50 | }
51 | """;
52 |
53 | private static final String FINALIZED_EVENT_TYPE = """
54 | {
55 | "@context": [
56 | "https://w3id.org/dspace/2025/1/context.jsonld"
57 | ],
58 | "@type": "ContractNegotiationEventMessage",
59 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
60 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
61 | "eventType": "FINALIZED"
62 | }
63 | """;
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractNegotiationSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class ContractNegotiationSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-negotiation.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/negotiation/contract-negotiation-schema.json");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractNegotiationTerminationMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class ContractNegotiationTerminationMessageSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifySchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-negotiation-termination-message.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyMinimalMessage() {
36 | assertThat(schema.validate(MINIMAL_MESSAGE, JSON)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/negotiation/contract-negotiation-termination-message-schema.json");
42 | }
43 |
44 | private static final String MINIMAL_MESSAGE = """
45 | {
46 | "@context": [
47 | "https://w3id.org/dspace/2025/1/context.jsonld"
48 | ],
49 | "@type": "ContractNegotiationTerminationMessage",
50 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
51 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
52 | }
53 | """;
54 | }
55 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractOfferMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class ContractOfferMessageSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifyRequestSchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-offer-message.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @Test
34 | void verifyInitialRequestSchema() throws IOException {
35 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-offer-message_initial.json"));
36 | assertThat(schema.validate(node)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/negotiation/contract-offer-message-schema.json");
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/ContractRequestMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class ContractRequestMessageSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifyRequestSchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-request-message.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyInitialRequestSchema() throws IOException {
36 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-request-message_initial.json"));
37 | assertThat(schema.validate(node)).isEmpty();
38 | }
39 |
40 | @Test
41 | void verifyIdRequest() {
42 | assertThat(schema.validate(REQUEST_ID, JSON)).isEmpty();
43 | assertThat(schema.validate(REQUEST_INITIAL_ID, JSON)).isEmpty();
44 | }
45 |
46 | @BeforeEach
47 | void setUp() {
48 | setUp("/negotiation/contract-request-message-schema.json");
49 | }
50 |
51 | private static final String REQUEST_ID = """
52 | {
53 | "@context": [
54 | "https://w3id.org/dspace/2025/1/context.jsonld"
55 | ],
56 | "@type": "ContractRequestMessage",
57 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
58 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
59 | "offer": {
60 | "@id": "urn:uuid:d526561f-528e-4d5a-ae12-9a9dd9b7a815"
61 | },
62 | "callbackAddress": "https://example.com/callback"
63 | }
64 | """;
65 |
66 | private static final String REQUEST_INITIAL_ID = """
67 | {
68 | "@context": [
69 | "https://w3id.org/dspace/2025/1/context.jsonld"
70 | ],
71 | "@type": "ContractRequestMessage",
72 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
73 | "offer": {
74 | "@id": "urn:uuid:d526561f-528e-4d5a-ae12-9a9dd9b7a815"
75 | },
76 | "callbackAddress": "https://example.com/callback"
77 | }
78 | """;
79 | }
80 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/InvalidContractAgreementVerificationMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidContractAgreementVerificationMessageSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONTEXT, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_MESSAGE_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_MESSAGE_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
32 | }
33 |
34 | @BeforeEach
35 | void setUp() {
36 | setUp("/negotiation/contract-agreement-verification-message-schema.json");
37 | }
38 |
39 | private static final String INVALID_MESSAGE_NO_CONTEXT = """
40 | {
41 | "@type": "ContractAgreementVerificationMessage",
42 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
43 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
44 | }
45 | """;
46 |
47 | private static final String INVALID_MESSAGE_NO_TYPE = """
48 | {
49 | "@context": [
50 | "https://w3id.org/dspace/2025/1/context.jsonld"
51 | ],
52 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
53 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
54 | }
55 | """;
56 |
57 | private static final String INVALID_MESSAGE_NO_PROVIDER_ID = """
58 | {
59 | "@context": [
60 | "https://w3id.org/dspace/2025/1/context.jsonld"
61 | ],
62 | "@type": "ContractAgreementVerificationMessage",
63 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
64 | }
65 | """;
66 |
67 | private static final String INVALID_MESSAGE_NO_CONSUMER_ID = """
68 | {
69 | "@context": [
70 | "https://w3id.org/dspace/2025/1/context.jsonld"
71 | ],
72 | "@type": "ContractAgreementVerificationMessage",
73 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab"
74 | }
75 | """;
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/InvalidContractNegotiationErrorSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidContractNegotiationErrorSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONTEXT, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_MESSAGE_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_MESSAGE_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
32 | }
33 |
34 | @BeforeEach
35 | void setUp() {
36 | setUp("/negotiation/contract-negotiation-error-schema.json");
37 | }
38 |
39 | private static final String INVALID_MESSAGE_NO_CONTEXT = """
40 | {
41 | "@type": "ContractNegotiationError",
42 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
43 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
44 | }
45 | """;
46 |
47 | private static final String INVALID_MESSAGE_NO_TYPE = """
48 | {
49 | "@context": [
50 | "https://w3id.org/dspace/2025/1/context.jsonld"
51 | ],
52 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
53 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
54 | }
55 | """;
56 |
57 | private static final String INVALID_MESSAGE_NO_PROVIDER_ID = """
58 | {
59 | "@context": [
60 | "https://w3id.org/dspace/2025/1/context.jsonld"
61 | ],
62 | "@type": "ContractNegotiationError",
63 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
64 | }
65 | """;
66 |
67 | private static final String INVALID_MESSAGE_NO_CONSUMER_ID = """
68 | {
69 | "@context": [
70 | "https://w3id.org/dspace/2025/1/context.jsonld"
71 | ],
72 | "@type": "ContractNegotiationError",
73 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab"
74 | }
75 | """;
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/InvalidContractNegotiationTerminationMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidContractNegotiationTerminationMessageSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifySchema() {
28 | assertThat(schema.validate(MESSAGE_NO_CONTEXT, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(MESSAGE_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(MESSAGE_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | assertThat(schema.validate(MESSAGE_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
32 | }
33 |
34 | @BeforeEach
35 | void setUp() {
36 | setUp("/negotiation/contract-negotiation-termination-message-schema.json");
37 | }
38 |
39 | private static final String MESSAGE_NO_CONTEXT = """
40 | {
41 | "@type": "ContractNegotiationTerminationMessage",
42 | "consumerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
43 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
44 | "code": "99",
45 | "reason": [
46 | "License model does not fit."
47 | ]
48 | }
49 | """;
50 |
51 | private static final String MESSAGE_NO_TYPE = """
52 | {
53 | "@context": [
54 | "https://w3id.org/dspace/2025/1/context.jsonld"
55 | ],
56 | "consumerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
57 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
58 | "code": "99",
59 | "reason": [
60 | "License model does not fit."
61 | ]
62 | }
63 | """;
64 |
65 | private static final String MESSAGE_NO_CONSUMER_ID = """
66 | {
67 | "@context": [
68 | "https://w3id.org/dspace/2025/1/context.jsonld"
69 | ],
70 | "@type": "ContractNegotiationTerminationMessage",
71 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
72 | "code": "99",
73 | "reason": [
74 | "License model does not fit."
75 | ]
76 | }
77 | """;
78 |
79 | private static final String MESSAGE_NO_PROVIDER_ID = """
80 | {
81 | "@context": [
82 | "https://w3id.org/dspace/2025/1/context.jsonld"
83 | ],
84 | "@type": "ContractNegotiationTerminationMessage",
85 | "consumerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
86 | "code": "99",
87 | "reason": [
88 | "License model does not fit."
89 | ]
90 | }
91 | """;
92 | }
93 |
94 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/InvalidContractOfferMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.negotiation;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidContractOfferMessageSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_MESSAGE_NO_TARGET, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_MESSAGE_NO_CALLBACK, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | }
31 |
32 | @BeforeEach
33 | void setUp() {
34 | setUp("/negotiation/contract-offer-message-schema.json");
35 | }
36 |
37 | private static final String INVALID_MESSAGE_NO_TARGET = """
38 | {
39 | "@context": [
40 | "https://w3id.org/dspace/2025/1/context.jsonld"
41 | ],
42 | "@type": "ContractOfferMessage",
43 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
44 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
45 | "offer": {
46 | "@type": "Offer",
47 | "@id": "urn:uuid:6bcea82e-c509-443d-ba8c-8eef25984c07",
48 | "permission": [
49 | {
50 | "action": "use"
51 | }
52 | ]
53 | },
54 | "callbackAddress": "https://example.com/callback"
55 | }
56 | """;
57 |
58 | private static final String INVALID_MESSAGE_NO_CALLBACK = """
59 | {
60 | "@context": [
61 | "https://w3id.org/dspace/2025/1/context.jsonld"
62 | ],
63 | "@type": "ContractOfferMessage",
64 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
65 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
66 | "offer": {
67 | "@type": "Offer",
68 | "@id": "urn:uuid:6bcea82e-c509-443d-ba8c-8eef25984c07",
69 | "target": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88",
70 | "permission": [
71 | {
72 | "action": "use"
73 | }
74 | ]
75 | }
76 | }
77 | """;
78 | }
79 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/InvalidTransferCompletionMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidTransferCompletionMessageSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONTEXT, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_MESSAGE_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_MESSAGE_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
32 | }
33 |
34 | @BeforeEach
35 | void setUp() {
36 | setUp("/transfer/transfer-completion-message-schema.json");
37 | }
38 |
39 | private static final String INVALID_MESSAGE_NO_CONTEXT = """
40 | {
41 | "@type": "TransferCompletionMessage",
42 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
43 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
44 | }
45 | """;
46 |
47 | private static final String INVALID_MESSAGE_NO_TYPE = """
48 | {
49 | "@context": [
50 | "https://w3id.org/dspace/2025/1/context.jsonld"
51 | ],
52 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
53 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
54 | }
55 | """;
56 |
57 | private static final String INVALID_MESSAGE_NO_PROVIDER_ID = """
58 | {
59 | "@context": [
60 | "https://w3id.org/dspace/2025/1/context.jsonld"
61 | ],
62 | "@type": "TransferCompletionMessage",
63 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
64 | }
65 | """;
66 |
67 | private static final String INVALID_MESSAGE_NO_CONSUMER_ID = """
68 | {
69 | "@context": [
70 | "https://w3id.org/dspace/2025/1/context.jsonld"
71 | ],
72 | "@type": "TransferCompletionMessage",
73 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab"
74 | }
75 | """;
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/InvalidTransferErrorSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidTransferErrorSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONTEXT, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_MESSAGE_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_MESSAGE_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | assertThat(schema.validate(INVALID_MESSAGE_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
32 | }
33 |
34 | @BeforeEach
35 | void setUp() {
36 | setUp("/transfer/transfer-error-schema.json");
37 | }
38 |
39 | private static final String INVALID_MESSAGE_NO_CONTEXT = """
40 | {
41 | "@type": "TransferError",
42 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
43 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
44 | }
45 | """;
46 |
47 | private static final String INVALID_MESSAGE_NO_TYPE = """
48 | {
49 | "@context": [
50 | "https://w3id.org/dspace/2025/1/context.jsonld"
51 | ],
52 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
53 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
54 | }
55 | """;
56 |
57 | private static final String INVALID_MESSAGE_NO_PROVIDER_ID = """
58 | {
59 | "@context": [
60 | "https://w3id.org/dspace/2025/1/context.jsonld"
61 | ],
62 | "@type": "TransferError",
63 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
64 | }
65 | """;
66 |
67 | private static final String INVALID_MESSAGE_NO_CONSUMER_ID = """
68 | {
69 | "@context": [
70 | "https://w3id.org/dspace/2025/1/context.jsonld"
71 | ],
72 | "@type": "TransferError",
73 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab"
74 | }
75 | """;
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/InvalidTransferSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidTransferSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_NO_ENDPOINT_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_NO_ENDPOINT, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/transfer/transfer-schema.json");
36 | }
37 |
38 |
39 | private static final String INVALID_NO_TYPE = """
40 | {
41 | "endpointType": "https://w3id.org/idsa/v4.1/HTTP",
42 | "endpoint": "http://example.com"
43 | }
44 | """;
45 |
46 | private static final String INVALID_NO_ENDPOINT_TYPE = """
47 | {
48 | "@type": "DataAddress",
49 | "endpoint": "http://example.com"
50 | }
51 | """;
52 |
53 | private static final String INVALID_NO_ENDPOINT = """
54 | {
55 | "@type": "DataAddress",
56 | "endpointType": "https://w3id.org/idsa/v4.1/HTTP"
57 | }
58 | """;
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/InvalidTransferStartMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidTransferStartMessageSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/transfer/transfer-start-message-schema.json");
36 | }
37 |
38 | private static final String INVALID_NO_TYPE = """
39 | {
40 | "@context": [
41 | "https://w3id.org/dspace/2025/1/context.jsonld"
42 | ],
43 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
44 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
45 | }
46 | """;
47 | private static final String INVALID_NO_PROVIDER_ID = """
48 | {
49 | "@context": [
50 | "https://w3id.org/dspace/2025/1/context.jsonld"
51 | ],
52 | "@type": "TransferStartMessage",
53 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
54 | }
55 | """;
56 | private static final String INVALID_NO_CONSUMER_ID = """
57 | {
58 | "@context": [
59 | "https://w3id.org/dspace/2025/1/context.jsonld"
60 | ],
61 | "@type": "TransferStartMessage",
62 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab"
63 | }
64 | """;
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/InvalidTransferSuspensionMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidTransferSuspensionMessageSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/transfer/transfer-suspension-message-schema.json");
36 | }
37 |
38 | private static final String INVALID_NO_TYPE = """
39 | {
40 | "@context": [
41 | "https://w3id.org/dspace/2025/1/context.jsonld"
42 | ],
43 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
44 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
45 | }
46 | """;
47 | private static final String INVALID_NO_PROVIDER_ID = """
48 | {
49 | "@context": [
50 | "https://w3id.org/dspace/2025/1/context.jsonld"
51 | ],
52 | "@type": "TransferSuspensionMessage",
53 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
54 | }
55 | """;
56 | private static final String INVALID_NO_CONSUMER_ID = """
57 | {
58 | "@context": [
59 | "https://w3id.org/dspace/2025/1/context.jsonld"
60 | ],
61 | "@type": "TransferSuspensionMessage",
62 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab"
63 | }
64 | """;
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/InvalidTransferTerminationMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class InvalidTransferTerminationMessageSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifyInvalidCases() {
28 | assertThat(schema.validate(INVALID_NO_TYPE, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
29 | assertThat(schema.validate(INVALID_NO_PROVIDER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
30 | assertThat(schema.validate(INVALID_NO_CONSUMER_ID, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/transfer/transfer-suspension-message-schema.json");
36 | }
37 |
38 | private static final String INVALID_NO_TYPE = """
39 | {
40 | "@context": [
41 | "https://w3id.org/dspace/2025/1/context.jsonld"
42 | ],
43 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
44 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
45 | }
46 | """;
47 | private static final String INVALID_NO_PROVIDER_ID = """
48 | {
49 | "@context": [
50 | "https://w3id.org/dspace/2025/1/context.jsonld"
51 | ],
52 | "@type": "TransferTerminationMessage",
53 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
54 | }
55 | """;
56 | private static final String INVALID_NO_CONSUMER_ID = """
57 | {
58 | "@context": [
59 | "https://w3id.org/dspace/2025/1/context.jsonld"
60 | ],
61 | "@type": "TransferTerminationMessage",
62 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab"
63 | }
64 | """;
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferCompletionMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class TransferCompletionMessageSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/transfer/example/transfer-completion-message.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/transfer/transfer-completion-message-schema.json");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferErrorSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class TransferErrorSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifySchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/transfer/example/transfer-error.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyMinimal() {
36 | assertThat(schema.validate(MINIMAL_ERROR, JSON)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/transfer/transfer-error-schema.json");
42 | }
43 |
44 | private static final String MINIMAL_ERROR = """
45 | {
46 | "@context": [
47 | "https://w3id.org/dspace/2025/1/context.jsonld"
48 | ],
49 | "@type": "TransferError",
50 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
51 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
52 | }
53 | """;
54 | }
55 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferProcessSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static org.assertj.core.api.Assertions.assertThat;
24 |
25 | public class TransferProcessSchemaTest extends AbstractSchemaTest {
26 |
27 | @Test
28 | void verifySchema() throws IOException {
29 | var node = mapper.readTree(getClass().getResourceAsStream("/transfer/example/transfer-process.json"));
30 | assertThat(schema.validate(node)).isEmpty();
31 | }
32 |
33 | @BeforeEach
34 | void setUp() {
35 | setUp("/transfer/transfer-process-schema.json");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferRequestMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class TransferRequestMessageSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifyRequestSchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/transfer/example/transfer-request-message.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyMinimalRequestSchema() {
36 | assertThat(schema.validate(MINIMAL_REQUEST, JSON)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/transfer/transfer-request-message-schema.json");
42 | }
43 |
44 | private static final String MINIMAL_REQUEST = """
45 | {
46 | "@context": [
47 | "https://w3id.org/dspace/2025/1/context.jsonld"
48 | ],
49 | "@type": "TransferRequestMessage",
50 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833",
51 | "agreementId": "urn:uuid:e8dc8655-44c2-46ef-b701-4cffdc2faa44",
52 | "format": "example:HTTP_PUSH",
53 | "callbackAddress": "https://example.com/callback"
54 | }
55 | """;
56 | }
57 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import static com.networknt.schema.InputFormat.JSON;
22 | import static org.assertj.core.api.Assertions.assertThat;
23 |
24 | public class TransferSchemaTest extends AbstractSchemaTest {
25 |
26 | @Test
27 | void verifySchema() {
28 | assertThat(schema.validate(PROPERTIES, JSON)).isEmpty();
29 | assertThat(schema.validate(NO_PROPERTIES, JSON)).isEmpty();
30 | }
31 |
32 | @BeforeEach
33 | void setUp() {
34 | setUp("/transfer/data-address-schema.json");
35 | }
36 |
37 |
38 | private static final String PROPERTIES = """
39 | {
40 | "@type": "DataAddress",
41 | "endpointType": "https://w3id.org/idsa/v4.1/HTTP",
42 | "endpoint": "http://example.com",
43 | "endpointProperties": [
44 | {
45 | "@type": "EndpointProperty",
46 | "name": "authorization",
47 | "value": "TOKEN-ABCDEFG"
48 | },
49 | {
50 | "@type": "EndpointProperty",
51 | "name": "authType",
52 | "value": "bearer"
53 | }
54 | ]
55 | }
56 | """;
57 |
58 | private static final String NO_PROPERTIES = """
59 | {
60 | "@type": "DataAddress",
61 | "endpointType": "https://w3id.org/idsa/v4.1/HTTP",
62 | "endpoint": "http://example.com"
63 | }
64 | """;
65 |
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferStartMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class TransferStartMessageSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifyRequestSchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/transfer/example/transfer-start-message.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyMinimalRequestSchema() {
36 | assertThat(schema.validate(MINIMAL_REQUEST, JSON)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/transfer/transfer-start-message-schema.json");
42 | }
43 |
44 | private static final String MINIMAL_REQUEST = """
45 | {
46 | "@context": [
47 | "https://w3id.org/dspace/2025/1/context.jsonld"
48 | ],
49 | "@type": "TransferStartMessage",
50 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
51 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
52 | }
53 | """;
54 | }
55 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferSuspensionMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class TransferSuspensionMessageSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifyRequestSchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/transfer/example/transfer-suspension-message.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyMinimalRequestSchema() {
36 | assertThat(schema.validate(MINIMAL_REQUEST, JSON)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/transfer/transfer-suspension-message-schema.json");
42 | }
43 |
44 | private static final String MINIMAL_REQUEST = """
45 | {
46 | "@context": [
47 | "https://w3id.org/dspace/2025/1/context.jsonld"
48 | ],
49 | "@type": "TransferSuspensionMessage",
50 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
51 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
52 | }
53 | """;
54 | }
55 |
--------------------------------------------------------------------------------
/artifacts/src/test/java/org/eclipse/dsp/schema/transfer/TransferTerminationMessageSchemaTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024 Metaform Systems, Inc.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * SPDX-License-Identifier: Apache-2.0
9 | *
10 | * Contributors:
11 | * Metaform Systems, Inc. - initial API and implementation
12 | *
13 | */
14 |
15 | package org.eclipse.dsp.schema.transfer;
16 |
17 | import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest;
18 | import org.junit.jupiter.api.BeforeEach;
19 | import org.junit.jupiter.api.Test;
20 |
21 | import java.io.IOException;
22 |
23 | import static com.networknt.schema.InputFormat.JSON;
24 | import static org.assertj.core.api.Assertions.assertThat;
25 |
26 | public class TransferTerminationMessageSchemaTest extends AbstractSchemaTest {
27 |
28 | @Test
29 | void verifyRequestSchema() throws IOException {
30 | var node = mapper.readTree(getClass().getResourceAsStream("/transfer/example/transfer-termination-message.json"));
31 | assertThat(schema.validate(node)).isEmpty();
32 | }
33 |
34 | @Test
35 | void verifyMinimalRequestSchema() {
36 | assertThat(schema.validate(MINIMAL_REQUEST, JSON)).isEmpty();
37 | }
38 |
39 | @BeforeEach
40 | void setUp() {
41 | setUp("/transfer/transfer-termination-message-schema.json");
42 | }
43 |
44 | private static final String MINIMAL_REQUEST = """
45 | {
46 | "@context": [
47 | "https://w3id.org/dspace/2025/1/context.jsonld"
48 | ],
49 | "@type": "TransferTerminationMessage",
50 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab",
51 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833"
52 | }
53 | """;
54 | }
55 |
--------------------------------------------------------------------------------
/specifications/catalog/README.md:
--------------------------------------------------------------------------------
1 | Please find the schema files and examples [here](../../artifacts/src/main/resources/catalog/).
--------------------------------------------------------------------------------
/specifications/common/foreword.md:
--------------------------------------------------------------------------------
1 | # Foreword
2 |
3 | ISO (the International Organization for Standardization) is a worldwide federation of national standards bodies (ISO
4 | member bodies). The work of preparing International Standards is normally carried out through ISO technical committees.
5 | Each member body interested in a subject for which a technical committee has been established has the right to be
6 | represented on that committee. International organizations, governmental and non-governmental, in liaison with ISO, also
7 | take part in the work. ISO collaborates closely with the International Electrotechnical Commission (IEC) on all matters
8 | of electrotechnical standardization.
9 |
10 | The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC
11 | Directives, Part 1. In particular, the different approval criteria needed for the different types of ISO documents
12 | should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (
13 | see [www.iso.org/directives](www.iso.org/directives)).
14 |
15 | ISO draws attention to the possibility that the implementation of this document may involve the use of (a) patent(s).
16 | ISO takes no position concerning the evidence, validity or applicability of any claimed patent rights in respect
17 | thereof. As of the date of publication of this document, ISO **[had/had not]** received notice of (a) patent(s) which
18 | may be required to implement this document. However, implementers are cautioned that this may not represent the latest
19 | information, which may be obtained from the patent database available at [www.iso.org/patents](www.iso.org/patents). ISO
20 | shall not be held responsible for identifying any or all such patent rights.
21 |
22 | Any trade name used in this document is information given for the convenience of users and does not constitute an
23 | endorsement.
24 | For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions related to
25 | conformity assessment, as well as information about ISO's adherence to the World Trade Organization (WTO) principles in
26 | the Technical Barriers to Trade (TBT), see [www.iso.org/iso/foreword.html](www.iso.org/iso/foreword.html).
27 |
28 | Any feedback or questions on this document should be directed to the user’s national standards body. A complete listing
29 | of these bodies can be found at [www.iso.org/members.html](www.iso.org/members.html).
30 |
--------------------------------------------------------------------------------
/specifications/common/introduction.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | The __Dataspace Protocol__ is used in the context of [=Dataspaces=] as described and defined in the subsequent sections with the purpose to support _interoperability_. In this context, the specification provides fundamental technical interoperability for [=Participants=] in [=Dataspaces=].
4 |
5 | This specification builds on protocols located in the [ISO OSI model (ISO/IEC 7498-1:1994)](https://www.iso.org/standard/20269.html) layers, like HTTPS. The purpose of this specification is to define interactions between systems independent of such protocols, but describing how to implement it in an unambiguous and extensible way. To do so, the [=Messages=] that are exchanged during the process are described in this specification and the states and their transitions are specified as state machines, based on the key terms and concepts of a [=Dataspace=]. On this foundation the bindings to data transfer protocols, like HTTPS, are described.
6 |
7 | _Note: This specification does not cover the data transfer as such. While this is controlled by the [=Transfer Process Protocol=], e.g., the initiation of the transfer channels or their decomissioning, the data transfer itself and especially the handling of technical exceptions is an obligation to the transport protocol._
8 |
9 | The classes and definitions used in this specification are reused from different standards and specifications as much as possible, in particular, DCAT [[?vocab-dcat-3]] and ODRL [[?odrl-model]]. As, however, the external definitions allow different interpretations or provide more attributes than required, this specification is leveraging _profiles_ of the original definitions rather than the complete original expressiveness. A _profile_ in this sense is a restriction or subset of an external definition, enforcing that every occurrence of an externally defined class is always conformant with the original definition. However, not every standard-compliant class might be compliant to the [=Dataspace=] profile. The profiles are not separate artifacts but implicitly contained in the JSON schemas for the [=Message Types=] of this specification.
10 |
11 | This specification is organized into the following documents:
12 |
13 | * [[[#terminology]]] documents define key terms.
14 | * [[[#requirements]]] declares cross-cutting functions as, e.g., the declaration of supported versions of this protocol and common data processing rules.
15 | * [[[#catalog-protocol]]] and [[[#catalog-http]]] define how [=Catalogs=] are published and accessed as HTTPS endpoints respectively.
16 | * [[[#negotiation-protocol]]] and [[[#negotiation-http]]] documents that define how [=Contract Negotiations=] are conducted and requested via HTTPS endpoints.
17 | * [[[#transfer-protocol]]] and [[[#transfer-http]]] documents that define how [=Transfer Processes=] using a given data transfer protocol are governed via HTTPS endpoints.
--------------------------------------------------------------------------------
/specifications/common/normative.references.md:
--------------------------------------------------------------------------------
1 | # Normative references
2 |
3 | The following documents are referred to in the text in such a way that some or all of their content constitutes
4 | requirements of this document. For dated references, only the edition cited applies. For undated references, the latest
5 | edition of the referenced document (including any amendments) applies.
6 |
7 | ISO/IEC 22123-1, Information technology — Cloud computing — Part 1: Vocabulary
8 |
--------------------------------------------------------------------------------
/specifications/common/scope.md:
--------------------------------------------------------------------------------
1 | # Scope
2 |
3 | Sharing data between autonomous entities requires the provision of metadata to facilitate the transfer of [=Datasets=] by making use of a data transfer (or application layer) protocol.
4 |
5 | This document gives guidance of how this metadata is provisioned:
6 |
7 | * This document specifies how [=Datasets=] are advertised via [=Catalogs=] (reusing terminology from [[?vocab-dcat-3]]
8 | * This document specifies how data usage requirements are expressed as [=Policies=] (reusing terminology from [[?odrl-model]] vocabulary).
9 | * This document specifies how [=Agreements=] that govern data usage are syntactically expressed and electronically negotiated during a [=Contract Negotiation=].
10 | * This document specifies how [=Datasets=] are accessed using [=Transfer Process Protocols=].
11 |
12 | This document does not apply to the data transfer protocol.
--------------------------------------------------------------------------------
/specifications/common/style/diagram.styles.puml:
--------------------------------------------------------------------------------
1 |
2 |
3 | !$blue = "#066DFA"
4 | !$gray = "#98A3AB"
5 | !$lightGray = "#F4F5F9"
6 | !$darkGray = "#747C94"
7 | !$green = "#24DCC1"
8 | !$blueFill = "#E4EBFA"
9 | !$greenFill = "#CFFBDE"
10 | !$borderRed = "#F40000"
11 | !$lightRed = "#FDCCCC"
12 |
13 | skinparam sequence {
14 | ArrowColor Black
15 | LifeLineBorderColor 000000
16 | LifeLineBackgroundColor #A9DCDF
17 | }
18 |
19 | skinparam roundCorner 10
20 |
21 | skinparam ArrowColor $darkGray
22 | skinparam ArrowHeadColor $darkGray
23 | skinparam LifeLineBackgroundColor $darkGray
24 |
25 |
26 | skinparam CloudBackgroundColor $lightGray
27 | skinparam CloudBorderColor $gray
28 | skinparam CloudFontColor Black
29 |
30 | skinparam ArtifactBackgroundColor $lightGray
31 | skinparam ArtifactBorderColor $gray
32 |
33 | skinparam ComponentBackgroundColor $blueFill
34 | skinparam ComponentBorderColor $blue
35 | skinparam ComponentFontColor Black
36 |
37 | skinparam DatabaseBackgroundColor $greenFill
38 | skinparam DatabaseBorderColor $green
39 | skinparam DatabaseFontColor Black
40 |
41 | skinparam ParticipantBorderColor $blue
42 | skinparam ParticipantBackgroundColor $blueFill
43 | skinparam SequenceGroupBorderColor #DADADA
44 | skinparam SequenceGroupHeaderFontColor #898A89
45 | skinparam BoxPadding 20
46 | skinparam ParticipantPadding 10
47 |
48 | skinparam AgentBackgroundColor White
49 | skinparam AgentBackgroundColor $blueFill
50 | skinparam AgentBorderColor #066DFA
51 | skinparam noteBorderColor FEF3BF
52 | skinparam SequenceBoxBorderColor F2F2F2
53 | skinparam shadowing false
54 | skinparam AgentBorderThickness 1
55 |
56 | skinparam NoteBackgroundColor FEFFDD
57 |
58 | skinparam FrameBackgroundColor $lightGray
59 | skinparam FrameBorderColor $lightGray
60 | skinparam FrameFontColor $darkGray
61 |
62 | skinparam ActivityBackgroundColor $blueFill
63 |
64 | skinparam StateBackgroundColor $blueFill
65 | skinparam StateBorderColor $blue
66 | skinparam StateStartColor $blue
67 | skinparam StateEndColor $blue
68 | skinparam StateFontSize 12
69 |
70 | skinparam ActivityBackgroundColor $blueFill
71 | skinparam ActivityBorderColor $blue
72 | skinparam ActivityEndColor $blue
73 | skinparam ActivityStartColor $blue
74 | skinparam ActivityDiamondBackgroundColor $lightGray
75 | skinparam ActivityDiamondBorderColor $blue
76 |
77 | skinparam PartitionBackgroundColor $lightGray
78 | skinparam PartitionBorderColor $darkGray
79 | skinparam PartitionFontColor $darkGray
80 |
81 | skinparam ClassAttributeFontColor Black
82 | skinparam ClassBorderColor $blue
83 | skinparam ClassBackgroundColor $blueFill
84 |
--------------------------------------------------------------------------------
/specifications/common/type.definitions.md:
--------------------------------------------------------------------------------
1 | # Lower Level Type Definitions
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/specifications/negotiation/README.md:
--------------------------------------------------------------------------------
1 | Please find the schema files and examples [here](../../artifacts/src/main/resources/negotiation/).
--------------------------------------------------------------------------------
/specifications/negotiation/figures/contract.negotiation.state.machine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/figures/contract.negotiation.state.machine.png
--------------------------------------------------------------------------------
/specifications/negotiation/figures/contract.negotiation.state.machine.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-negotiation-state-machine"
2 | !pragma layout smetana
3 |
4 | !include ../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 | state REQUESTED: ContractRequestMessage
9 | state OFFERED: ContractOfferMessage
10 | state ACCEPTED: ContractNegotiationEventMessage:accepted
11 | state AGREED: ContractAgreementMessage
12 | state VERIFIED: ContractAgreementVerificationMessage
13 | state FINALIZED: ContractNegotiationEventMessage:finalized
14 |
15 | state TERMINATED $lightRed #$borderRed: ContractNegotiationTerminationMessage
16 |
17 | [*] --> REQUESTED: C
18 | REQUESTED --> OFFERED: P
19 | REQUESTED --> AGREED: P
20 | REQUESTED --> TERMINATED: C/P
21 |
22 | [*] --> OFFERED: P
23 | OFFERED --> REQUESTED: C
24 | OFFERED --> ACCEPTED: C
25 | OFFERED --> TERMINATED: C/P
26 |
27 | ACCEPTED --> AGREED: P
28 | ACCEPTED -> TERMINATED: P
29 |
30 | AGREED --> VERIFIED: C
31 | AGREED --> TERMINATED: C
32 |
33 | VERIFIED --> FINALIZED: P
34 | VERIFIED -> TERMINATED: P
35 |
36 | FINALIZED -->[*]
37 | TERMINATED --> [*]
38 |
39 | @enduml
40 |
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-agreement-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-agreement-message.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-agreement-message.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-agreement-message"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractAgreementMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : "dspace:ContractAgreementMessage"
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | dspace:callbackAddress : xsd:anyURI
15 | }
16 |
17 | class odrl:Agreement {
18 | @type : "odrl:Agreement"
19 | @id: String
20 | odrl:target : xsd:anyURI
21 | dspace:timestamp : xsd:dateTime
22 | odrl:assignee : String
23 | odrl:assigner : String
24 | }
25 |
26 | "dspace:ContractAgreementMessage" "1" *-- "1" "odrl:Agreement" : "dspace:agreement"
27 |
28 | @enduml
29 |
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-agreement-verification-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-agreement-verification-message.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-agreement-verification-message.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-agreement-verification-message"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractAgreementVerificationMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : "dspace:ContractAgreementVerificationMessage"
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | }
15 |
16 |
17 | @enduml
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation-error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-negotiation-error.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation-error.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-negotiation-error"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractNegotiationError" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : "dspace:ContractNegotiationError"
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | dspace:code : String
15 | dspace:reason : Array
16 | }
17 |
18 | class "MultilanguageProperty" {
19 | @language : BCP47 Language-Tag
20 | @value: String
21 | }
22 |
23 | "dspace:ContractNegotiationError" "1" *-- "*" "MultilanguageProperty" : "dct:description"
24 |
25 | @enduml
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation-event-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-negotiation-event-message.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation-event-message.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-negotiation-event-message"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractNegotiationEventMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : "dspace:ContractNegotiationEventMessage"
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | }
15 |
16 | enum dspace:NegotiationEvent {
17 | dspace:ACCEPTED
18 | dspace:FINALIZED
19 | }
20 |
21 | "dspace:ContractNegotiationEventMessage" "1" *-- "1" "dspace:NegotiationEvent" : "dspace:eventType"
22 |
23 | @enduml
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation-termination-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-negotiation-termination-message.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation-termination-message.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-negotiation-termination-message"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractNegotiationTerminationMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : "dspace:ContractNegotiationTerminationMessage"
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | dspace:code : String
15 | dspace:reason : Array
16 | }
17 |
18 | @enduml
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-negotiation.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-negotiation.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-negotiation"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractNegotiation" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : "dspace:ContractNegotiation"
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | }
15 |
16 | enum dspace:NegotiationState {
17 | "dspace:REQUESTED"
18 | "dspace:OFFERED"
19 | "dspace:ACCEPTED"
20 | "dspace:AGREED"
21 | "dspace:VERIFIED"
22 | "dspace:FINALIZED"
23 | "dspace:TERMINATED"
24 | "..."
25 | }
26 |
27 | "dspace:ContractNegotiation" "1" *-- "1" "dspace:NegotiationState" : "dspace:state"
28 |
29 | @enduml
30 |
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-offer-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-offer-message.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-offer-message.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-offer-message"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractOfferMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : dspace:ContractOfferMessage
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | dspace:callbackAddress : String
15 | }
16 |
17 | class odrl:Offer {
18 | @type : odrl:Offer,
19 | @id: String
20 | odrl:target : xsd:anyURI
21 | }
22 |
23 | "dspace:ContractOfferMessage" "1" *-- "1" "odrl:Offer" : "dspace:offer"
24 |
25 | @enduml
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-offer-message_initial.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-offer-message_initial.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-offer-message_initial.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-offer-message"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractOfferMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : dspace:ContractOfferMessage
12 | dspace:providerPid : String
13 | dspace:callbackAddress : String
14 | }
15 |
16 | class odrl:Offer {
17 | @type : odrl:Offer,
18 | @id: String
19 | odrl:target : xsd:anyURI
20 | }
21 |
22 | "dspace:ContractOfferMessage" "1" *-- "1" "odrl:Offer" : "dspace:offer"
23 |
24 | @enduml
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-request-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-request-message.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-request-message.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-request-message"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractRequestMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : dspace:ContractRequestMessage
12 | dspace:providerPid : String
13 | dspace:consumerPid : String
14 | dspace:callbackAddress : String
15 | }
16 |
17 | class odrl:Offer {
18 | @type : odrl:Offer,
19 | @id: String
20 | odrl:target : xsd:anyURI
21 | ...
22 | }
23 |
24 | "dspace:ContractRequestMessage" "1" *-- "1" "odrl:Offer" : "dspace:offer"
25 |
26 | @enduml
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-request-message_initial.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/negotiation/message/diagram/contract-request-message_initial.png
--------------------------------------------------------------------------------
/specifications/negotiation/message/diagram/contract-request-message_initial.puml:
--------------------------------------------------------------------------------
1 | @startuml "contract-request-message_initial"
2 | !pragma layout smetana
3 |
4 | !include ../../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 |
9 | class "dspace:ContractRequestMessage" {
10 | @context : "https://w3id.org/dspace/2025/1/context.jsonld"
11 | @type : dspace:ContractRequestMessage
12 | dspace:consumerPid : String
13 | dspace:callbackAddress : String
14 | }
15 |
16 | class odrl:Offer {
17 | @type : odrl:Offer,
18 | @id: String
19 | odrl:target : xsd:anyURI
20 | ...
21 | }
22 |
23 | "dspace:ContractRequestMessage" "1" *-- "*" "odrl:Offer" : "dspace:offer"
24 |
25 | @enduml
26 |
--------------------------------------------------------------------------------
/specifications/transfer/README.md:
--------------------------------------------------------------------------------
1 | Please find the schema files and examples [here](../../artifacts/src/main/resources/transfer/).
--------------------------------------------------------------------------------
/specifications/transfer/figures/pull-transfer-process.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/transfer/figures/pull-transfer-process.png
--------------------------------------------------------------------------------
/specifications/transfer/figures/pull-transfer-process.puml:
--------------------------------------------------------------------------------
1 | @startuml "pull-transfer-process"
2 | !pragma layout smetana
3 |
4 | !include ../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 | skinparam defaultTextAlignment center
9 |
10 | box Consumer
11 | participant DataPlane_C
12 | participant ControlPlane_C
13 | end box
14 |
15 | box Provider
16 | participant ControlPlane_P
17 | participant DataPlane_P
18 | end box
19 |
20 | activate ControlPlane_C
21 | activate ControlPlane_P
22 |
23 | ControlPlane_C -> ControlPlane_P : TransferRequestMessage
24 |
25 | ControlPlane_P -> ControlPlane_C : TransferStartMessage(dataAddress)
26 |
27 | activate DataPlane_C
28 | activate DataPlane_P
29 | DataPlane_C -> DataPlane_P : pull data
30 | deactivate DataPlane_P
31 | deactivate DataPlane_C
32 |
33 | alt "Consumer ends TP"
34 | ControlPlane_C -> ControlPlane_P : TransferCompletionMessage
35 | else "Provider ends TP"
36 | ControlPlane_P -> ControlPlane_C : TransferCompletionMessage
37 | end
38 |
39 | deactivate ControlPlane_C
40 | deactivate ControlPlane_P
41 |
42 | @enduml
43 |
--------------------------------------------------------------------------------
/specifications/transfer/figures/push-transfer-process.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/transfer/figures/push-transfer-process.png
--------------------------------------------------------------------------------
/specifications/transfer/figures/push-transfer-process.puml:
--------------------------------------------------------------------------------
1 | @startuml "push-transfer-process"
2 | !pragma layout smetana
3 |
4 | !include ../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 | skinparam defaultTextAlignment center
9 |
10 | box Consumer
11 | participant DataPlane_C
12 | participant ControlPlane_C
13 | end box
14 |
15 | box Provider
16 | participant ControlPlane_P
17 | participant DataPlane_P
18 | end box
19 |
20 | activate ControlPlane_C
21 | activate ControlPlane_P
22 |
23 | ControlPlane_C -> ControlPlane_P : TransferRequestMessage(dataAddress)
24 |
25 | ControlPlane_P -> ControlPlane_C : TransferStartMessage
26 |
27 | activate DataPlane_C
28 | activate DataPlane_P
29 | DataPlane_P -> DataPlane_C : push data
30 | deactivate DataPlane_P
31 | deactivate DataPlane_C
32 |
33 | ControlPlane_P -> ControlPlane_C : TransferCompletionMessage
34 |
35 | deactivate ControlPlane_C
36 | deactivate ControlPlane_P
37 |
38 | @enduml
--------------------------------------------------------------------------------
/specifications/transfer/figures/transfer-process-state-machine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/63e7ef04261d6910eafe73252d80a7016740f420/specifications/transfer/figures/transfer-process-state-machine.png
--------------------------------------------------------------------------------
/specifications/transfer/figures/transfer-process-state-machine.puml:
--------------------------------------------------------------------------------
1 | @startuml "transfer-process-state-machine"
2 | !pragma layout smetana
3 |
4 | !include ../../common/style/diagram.styles.puml
5 |
6 | hide empty description
7 |
8 | state REQUESTED: TransferRequestMessage
9 | state STARTED: TransferStartMessage
10 | state COMPLETED: TransferCompletionMessage
11 | state SUSPENDED: TransferSuspensionMessage
12 |
13 | state TERMINATED $lightRed #$borderRed : TransferTerminationMessage
14 |
15 | [*] --> REQUESTED: C
16 | REQUESTED --> STARTED: P
17 | REQUESTED --> TERMINATED: C/P
18 |
19 | STARTED --> COMPLETED: P/C
20 | STARTED --> SUSPENDED: P/C
21 | STARTED --> TERMINATED: P/C
22 |
23 | SUSPENDED --> STARTED: P/C
24 | SUSPENDED --> TERMINATED: P/C
25 |
26 | COMPLETED -->[*]
27 | TERMINATED --> [*]
28 |
29 | @enduml
30 |
--------------------------------------------------------------------------------