├── artifacts ├── settings.gradle.kts ├── README.md ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ └── resources │ │ │ ├── catalog │ │ │ ├── example │ │ │ │ ├── catalog-request-message.json │ │ │ │ ├── dataset-request-message.json │ │ │ │ ├── catalog-error.json │ │ │ │ ├── nested-catalog.json │ │ │ │ ├── dataset.json │ │ │ │ └── catalog.json │ │ │ ├── catalog-request-message-schema.json │ │ │ ├── catalog-error-schema.json │ │ │ ├── dataset-request-message-schema.json │ │ │ ├── catalog-schema.json │ │ │ └── dataset-schema.json │ │ │ ├── common │ │ │ ├── example │ │ │ │ ├── catalogservice-did-service.json │ │ │ │ ├── dataservice-did-service.json │ │ │ │ └── protocol-version.json │ │ │ ├── context-schema.json │ │ │ ├── did-service-schema.json │ │ │ └── protocol-version-schema.json │ │ │ ├── transfer │ │ │ ├── example │ │ │ │ ├── transfer-completion-message.json │ │ │ │ ├── transfer-process.json │ │ │ │ ├── transfer-error.json │ │ │ │ ├── transfer-suspension-message.json │ │ │ │ ├── transfer-termination-message.json │ │ │ │ ├── transfer-start-message.json │ │ │ │ └── transfer-request-message.json │ │ │ ├── transfer-termination-message-schema.json │ │ │ ├── transfer-error-schema.json │ │ │ ├── transfer-completion-message-schema.json │ │ │ ├── transfer-suspension-message-schema.json │ │ │ ├── transfer-schema.json │ │ │ ├── transfer-start-message-schema.json │ │ │ ├── transfer-process-schema.json │ │ │ ├── transfer-request-message-schema.json │ │ │ └── data-address-schema.json │ │ │ ├── negotiation │ │ │ ├── example │ │ │ │ ├── contract-agreement-verification-message.json │ │ │ │ ├── contract-negotiation.json │ │ │ │ ├── contract-negotiation-event-message.json │ │ │ │ ├── contract-negotiation-error.json │ │ │ │ ├── contract-negotiation-termination-message.json │ │ │ │ ├── contract-offer-message_initial.json │ │ │ │ ├── contract-request-message_initial.json │ │ │ │ ├── contract-offer-message.json │ │ │ │ ├── contract-request-message.json │ │ │ │ ├── contract-agreement-message.json │ │ │ │ └── contract-agreement-message-full.json │ │ │ ├── contract-agreement-verification-message-schema.json │ │ │ ├── contract-agreement-message-schema.json │ │ │ ├── contract-negotiation-error-schema.json │ │ │ ├── contract-negotiation-event-message-schema.json │ │ │ ├── contract-negotiation-termination-message-schema.json │ │ │ ├── contract-negotiation-schema.json │ │ │ ├── contract-request-message-schema.json │ │ │ └── contract-offer-message-schema.json │ │ │ └── context │ │ │ └── odrl.jsonld │ └── test │ │ └── java │ │ └── org │ │ └── eclipse │ │ └── dsp │ │ ├── DspConstants.java │ │ ├── schema │ │ ├── catalog │ │ │ ├── DatasetResponseTest.java │ │ │ ├── NestedCatalogSchemaTest.java │ │ │ ├── CatalogRequestMessageSchemaTest.java │ │ │ ├── DatasetRequestMessageSchemaTest.java │ │ │ ├── CatalogSchemaTest.java │ │ │ ├── DatasetSchemaTest.java │ │ │ └── CatalogErrorSchemaTest.java │ │ ├── common │ │ │ ├── VersionSchemaTest.java │ │ │ └── CommonSchemaTest.java │ │ ├── transfer │ │ │ ├── TransferProcessSchemaTest.java │ │ │ ├── TransferCompletionMessageSchemaTest.java │ │ │ ├── TransferErrorSchemaTest.java │ │ │ ├── TransferStartMessageSchemaTest.java │ │ │ ├── TransferSuspensionMessageSchemaTest.java │ │ │ ├── TransferTerminationMessageSchemaTest.java │ │ │ ├── InvalidTransferSchemaTest.java │ │ │ ├── TransferSchemaTest.java │ │ │ ├── InvalidTransferStartMessageSchemaTest.java │ │ │ ├── InvalidTransferSuspensionMessageSchemaTest.java │ │ │ ├── InvalidTransferTerminationMessageSchemaTest.java │ │ │ ├── TransferRequestMessageSchemaTest.java │ │ │ ├── InvalidTransferErrorSchemaTest.java │ │ │ ├── InvalidTransferCompletionMessageSchemaTest.java │ │ │ └── InvalidTransferProcessSchemaTest.java │ │ ├── negotiation │ │ │ ├── ContractNegotiationSchemaTest.java │ │ │ ├── ContractAgreementMessageSchemaTest.java │ │ │ ├── ContractAgreementVerificationMessageSchemaTest.java │ │ │ ├── ContractOfferMessageSchemaTest.java │ │ │ ├── ContractRequestMessageSchemaTest.java │ │ │ ├── ContractNegotiationErrorSchemaTest.java │ │ │ ├── ContractNegotiationTerminationMessageSchemaTest.java │ │ │ ├── ContractNegotiationEventMessageSchemaTest.java │ │ │ ├── InvalidContractOfferMessageSchemaTest.java │ │ │ ├── InvalidContractNegotiationErrorSchemaTest.java │ │ │ ├── InvalidContractAgreementVerificationMessageSchemaTest.java │ │ │ └── InvalidContractNegotiationTerminationMessageSchemaTest.java │ │ └── fixtures │ │ │ └── AbstractSchemaTest.java │ │ └── context │ │ ├── catalog │ │ └── CatalogContextTest.java │ │ ├── transfer │ │ └── TransferContextTest.java │ │ └── negotiation │ │ └── ContractNegotiationContextTest.java ├── .gitignore ├── config │ └── checkstyle │ │ └── suppressions.xml ├── buildSrc │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── eclipse │ │ │ │ └── dsp │ │ │ │ └── generation │ │ │ │ ├── transformer │ │ │ │ └── SchemaTypeTransformer.java │ │ │ │ ├── jsom │ │ │ │ ├── SchemaModel.java │ │ │ │ ├── JsonTypes.java │ │ │ │ ├── JsonSchemaKeywords.java │ │ │ │ ├── ElementDefinition.java │ │ │ │ ├── SchemaPropertyReference.java │ │ │ │ └── JsonTypeMappings.java │ │ │ │ ├── SchemaTableGeneratorPluginExtension.java │ │ │ │ └── SchemaTableGeneratorPlugin.java │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── eclipse │ │ │ └── dsp │ │ │ └── generation │ │ │ ├── jsom │ │ │ ├── JsonTypesTest.java │ │ │ ├── JsomParserTest.java │ │ │ └── SchemaTypeTest.java │ │ │ └── transformer │ │ │ └── HtmlTableTransformerTest.java │ ├── build.gradle.kts │ └── README.md ├── build.gradle.kts └── gradlew.bat ├── specifications ├── catalog │ └── README.md ├── transfer │ ├── README.md │ └── figures │ │ ├── pull-transfer-process.png │ │ ├── push-transfer-process.png │ │ ├── transfer-process-state-machine.png │ │ ├── transfer-process-state-machine.puml │ │ ├── push-transfer-process.puml │ │ └── pull-transfer-process.puml ├── negotiation │ ├── README.md │ └── figures │ │ ├── contract.negotiation.state.machine.png │ │ └── contract.negotiation.state.machine.puml └── common │ ├── scope.md │ ├── type.definitions.md │ ├── style │ └── diagram.styles.puml │ └── introduction.md ├── CODE_OF_CONDUCT.md ├── .gitattributes ├── .gitignore ├── .github ├── actions │ └── setup-java │ │ └── action.yaml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature-request.md │ └── bug-report.md ├── scripts │ ├── index.html │ └── checkout-tags.sh ├── workflows │ ├── pr-check.yml │ └── autopublish.yaml └── PULL_REQUEST_TEMPLATE.md ├── README.md ├── PR_ETIQUETTE.md └── WEBSITE.md /artifacts/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "artifacts" 2 | -------------------------------------------------------------------------------- /artifacts/README.md: -------------------------------------------------------------------------------- 1 | # dsp-schemas 2 | Tools for defining and generating DSP schemas 3 | -------------------------------------------------------------------------------- /specifications/catalog/README.md: -------------------------------------------------------------------------------- 1 | Please find the schema files and examples [here](../../artifacts/src/main/resources/catalog/). -------------------------------------------------------------------------------- /specifications/transfer/README.md: -------------------------------------------------------------------------------- 1 | Please find the schema files and examples [here](../../artifacts/src/main/resources/transfer/). -------------------------------------------------------------------------------- /specifications/negotiation/README.md: -------------------------------------------------------------------------------- 1 | Please find the schema files and examples [here](../../artifacts/src/main/resources/negotiation/). -------------------------------------------------------------------------------- /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). -------------------------------------------------------------------------------- /artifacts/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/HEAD/artifacts/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /specifications/transfer/figures/pull-transfer-process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/HEAD/specifications/transfer/figures/pull-transfer-process.png -------------------------------------------------------------------------------- /specifications/transfer/figures/push-transfer-process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/HEAD/specifications/transfer/figures/push-transfer-process.png -------------------------------------------------------------------------------- /specifications/transfer/figures/transfer-process-state-machine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/HEAD/specifications/transfer/figures/transfer-process-state-machine.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /specifications/negotiation/figures/contract.negotiation.state.machine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-dataspace-protocol-base/DataspaceProtocol/HEAD/specifications/negotiation/figures/contract.negotiation.state.machine.png -------------------------------------------------------------------------------- /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/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 | } -------------------------------------------------------------------------------- /.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 -------------------------------------------------------------------------------- /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/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 | } -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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/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-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/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.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-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/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-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/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-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 | -------------------------------------------------------------------------------- /.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/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/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 -------------------------------------------------------------------------------- /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 | "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/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 | -------------------------------------------------------------------------------- /.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)._ -------------------------------------------------------------------------------- /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/.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/config/checkstyle/suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /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/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 | } 26 | -------------------------------------------------------------------------------- /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 | } 26 | -------------------------------------------------------------------------------- /.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/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._ -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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=]. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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/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/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/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 | } 29 | -------------------------------------------------------------------------------- /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/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 | "permission": [ 12 | { 13 | "action": "use", 14 | "constraint": [ 15 | { 16 | "leftOperand": "spatial", 17 | "rightOperand": "_:EU", 18 | "operator": "eq" 19 | } 20 | ] 21 | } 22 | ] 23 | } 24 | ], 25 | "distribution": [ 26 | { 27 | "@type": "Distribution", 28 | "format": "HttpData-PULL", 29 | "accessService": { 30 | "@id": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77", 31 | "@type": "DataService", 32 | "endpointURL": "https://provider-a.com/connector" 33 | } 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/common/example/protocol-version.json: -------------------------------------------------------------------------------- 1 | { 2 | "protocolVersions": [ 3 | { 4 | "version": "2025-1", 5 | "path": "/some/path/2025-1", 6 | "binding": "HTTPS", 7 | "serviceId": "service-asdf", 8 | "identifierType": "did:web" 9 | }, 10 | { 11 | "version": "2024-1", 12 | "path": "/some/path/2024-1", 13 | "binding": "HTTPS", 14 | "auth": { 15 | "protocol": "OAuth", 16 | "version": "2", 17 | "profile": [ 18 | "authorization_code", 19 | "refresh_token" 20 | ] 21 | }, 22 | "serviceId": "service-asdf", 23 | "identifierType": "D-U-N-S" 24 | 25 | }, 26 | { 27 | "version": "2025-1", 28 | "path": "/different/path/2025-1", 29 | "binding": "HTTPS", 30 | "auth": { 31 | "protocol": "DCP", 32 | "version": "1.0", 33 | "profile": [ 34 | "vc11-sl2021/jwt" 35 | ] 36 | }, 37 | "serviceId": "service-qwerty" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /.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 -------------------------------------------------------------------------------- /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-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/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/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 | } -------------------------------------------------------------------------------- /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 Transfer Process" 34 | ControlPlane_C -> ControlPlane_P : TransferCompletionMessage 35 | else "Provider ends Transfer Process" 36 | ControlPlane_P -> ControlPlane_C : TransferCompletionMessage 37 | end 38 | 39 | deactivate ControlPlane_C 40 | deactivate ControlPlane_P 41 | 42 | @enduml 43 | -------------------------------------------------------------------------------- /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/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 NOT = "not"; 30 | String ONE_OF = "oneOf"; 31 | String PROPERTIES = "properties"; 32 | String REQUIRED = "required"; 33 | String TYPE = "type"; 34 | String ENUM = "enum"; 35 | } 36 | -------------------------------------------------------------------------------- /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/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/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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | }, 32 | "required": [ 33 | "@context", 34 | "@type", 35 | "providerPid", 36 | "consumerPid", 37 | "agreement" 38 | ] 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/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/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/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 | -------------------------------------------------------------------------------- /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 |

44 | -------------------------------------------------------------------------------- /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/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/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 | } 34 | ] 35 | } 36 | ], 37 | "distribution": [ 38 | { 39 | "@type": "Distribution", 40 | "format": "HttpData-PULL", 41 | "accessService": "urn:uuid:4aa2dcc8-4d2d-569e-d634-8394a8834d77" 42 | } 43 | ] 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /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/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 | ] 37 | }, 38 | "EndpointProperty": { 39 | "type": "object", 40 | "properties": { 41 | "@type": { 42 | "type": "string", 43 | "const": "EndpointProperty" 44 | }, 45 | "name": { 46 | "type": "string" 47 | }, 48 | "value": { 49 | "type": "string" 50 | } 51 | }, 52 | "required": [ 53 | "@type", 54 | "name", 55 | "value" 56 | ] 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.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 -------------------------------------------------------------------------------- /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 org.assertj.core.api.Assertions.assertThat; 24 | 25 | public class ContractRequestMessageSchemaTest extends AbstractSchemaTest { 26 | 27 | @Test 28 | void verifyRequestSchema() throws IOException { 29 | var node = mapper.readTree(getClass().getResourceAsStream("/negotiation/example/contract-request-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-request-message_initial.json")); 36 | assertThat(schema.validate(node)).isEmpty(); 37 | } 38 | 39 | @BeforeEach 40 | void setUp() { 41 | setUp("/negotiation/contract-request-message-schema.json"); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /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/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 | "$ref": "https://w3id.org/dspace/2025/1/negotiation/contract-schema.json#/definitions/MessageOffer" 30 | }, 31 | "callbackAddress": { 32 | "type": "string", 33 | "$comment": "A URL indicating where messages to the consumer should be sent" 34 | } 35 | }, 36 | "oneOf": [ 37 | { 38 | "required": [ 39 | "callbackAddress" 40 | ] 41 | }, 42 | { 43 | "required": [ 44 | "providerPid" 45 | ] 46 | } 47 | ], 48 | "required": [ 49 | "@context", 50 | "@type", 51 | "consumerPid", 52 | "offer" 53 | ] 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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 | -------------------------------------------------------------------------------- /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 | "oneOf": [ 54 | { 55 | "required": [ 56 | "callbackAddress" 57 | ] 58 | }, 59 | { 60 | "required": [ 61 | "consumerPid" 62 | ] 63 | } 64 | ], 65 | "required": [ 66 | "@context", 67 | "@type", 68 | "providerPid", 69 | "offer" 70 | ] 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /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/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/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/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 | "anyOf": [ 32 | { 33 | "type": "string" 34 | }, 35 | { 36 | "type": "string", 37 | "enum": [ 38 | "0.8", 39 | "2024-1", 40 | "2025-1" 41 | ] 42 | } 43 | ] 44 | }, 45 | "path": { 46 | "type": "string" 47 | }, 48 | "binding": { 49 | "type": "string", 50 | "enum": [ 51 | "HTTPS" 52 | ] 53 | }, 54 | "identifierType": { 55 | "type": "string" 56 | }, 57 | "serviceId": { 58 | "type": "string" 59 | }, 60 | "auth": { 61 | "$ref": "#/definitions/Auth" 62 | } 63 | }, 64 | "required": [ 65 | "version", 66 | "path", 67 | "binding" 68 | ] 69 | }, 70 | "Auth": { 71 | "type": "object", 72 | "properties": { 73 | "protocol": { 74 | "type": "string" 75 | }, 76 | "version": { 77 | "type": "string" 78 | }, 79 | "profile": { 80 | "type": "array", 81 | "items": { 82 | "type": "string" 83 | } 84 | } 85 | }, 86 | "required": [ 87 | "protocol", 88 | "version" 89 | ] 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dataspace Protocol 2 | 3 | The __Dataspace Protocol__ is a specification designed to facilitate interoperable data sharing between entities governed by usage control and based on Web technologies. This specification defines 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | "@container": "@set" 60 | }, 61 | "Constraint": "odrl:Constraint", 62 | "constraint": { 63 | "@type": "@id", 64 | "@id": "odrl:constraint", 65 | "@container": "@set" 66 | }, 67 | "Operator": "odrl:Operator", 68 | "operator": { 69 | "@type": "@vocab", 70 | "@id": "odrl:operator" 71 | }, 72 | "RightOperand": "odrl:RightOperand", 73 | "rightOperand": "odrl:rightOperand", 74 | "LeftOperand": "odrl:LeftOperand", 75 | "leftOperand": { 76 | "@type": "@vocab", 77 | "@id": "odrl:leftOperand" 78 | }, 79 | "eq": "odrl:eq", 80 | "gt": "odrl:gt", 81 | "gteq": "odrl:gteq", 82 | "lt": "odrl:lt", 83 | "lteq": "odrl:lteq", 84 | "neq": "odrl:neq", 85 | "isA": "odrl:isA", 86 | "hasPart": "odrl:hasPart", 87 | "isPartOf": "odrl:isPartOf", 88 | "isAllOf": "odrl:isAllOf", 89 | "isAnyOf": "odrl:isAnyOf", 90 | "isNoneOf": "odrl:isNoneOf", 91 | "or": "odrl:or", 92 | "xone": "odrl:xone", 93 | "and": "odrl:and", 94 | "andSequence": "odrl:andSequence" 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /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/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 | 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 | 44 | 45 |
MessageOffer
Required properties
@idstring
@typestringValue must be Offer
Optional properties
obligationarray
rulearray
profileany
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 | -------------------------------------------------------------------------------- /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 the Hypertext Transfer Protocol (HTTP). 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 Hypertext Transfer Protocol Secure (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, Data Catalog Vocabulary (DCAT) [[?vocab-dcat-3]] and Open Digital Rights Language (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. However, not every standard-compliant class might be compliant to the [=Dataspace=] [=Profile=]. They are not separate artifacts but implicitly contained in the JavaScript Object Notation (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. -------------------------------------------------------------------------------- /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 | assertThat(schema.validate(NO_DA_ENDPOINT, JSON)).isEmpty(); 38 | } 39 | 40 | @BeforeEach 41 | void setUp() { 42 | setUp("/transfer/transfer-request-message-schema.json"); 43 | } 44 | 45 | private static final String MINIMAL_REQUEST = """ 46 | { 47 | "@context": [ 48 | "https://w3id.org/dspace/2025/1/context.jsonld" 49 | ], 50 | "@type": "TransferRequestMessage", 51 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833", 52 | "agreementId": "urn:uuid:e8dc8655-44c2-46ef-b701-4cffdc2faa44", 53 | "format": "example:HTTP_PUSH", 54 | "callbackAddress": "https://example.com/callback" 55 | } 56 | """; 57 | 58 | private static final String NO_DA_ENDPOINT = """ 59 | { 60 | "@context": [ 61 | "https://w3id.org/dspace/2025/1/context.jsonld" 62 | ], 63 | "@type": "TransferRequestMessage", 64 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833", 65 | "agreementId": "urn:uuid:e8dc8655-44c2-46ef-b701-4cffdc2faa44", 66 | "format": "example:HTTP_PUSH", 67 | "dataAddress": { 68 | "@type": "DataAddress", 69 | "endpointType": "https://w3id.org/idsa/v4.1/HTTP" 70 | }, 71 | "callbackAddress": "https://example.com/callback" 72 | } 73 | """; 74 | } 75 | -------------------------------------------------------------------------------- /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/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/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/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 | * SAP SE - fixes 13 | * 14 | */ 15 | 16 | package org.eclipse.dsp.schema.fixtures; 17 | 18 | import com.fasterxml.jackson.databind.JsonNode; 19 | import com.fasterxml.jackson.databind.ObjectMapper; 20 | import com.networknt.schema.JsonSchema; 21 | import com.networknt.schema.JsonSchemaFactory; 22 | import com.networknt.schema.SchemaLocation; 23 | import com.networknt.schema.SpecVersion; 24 | import com.networknt.schema.ValidationMessage; 25 | 26 | import java.io.File; 27 | import java.io.IOException; 28 | 29 | import static com.networknt.schema.SchemaId.V201909; 30 | import static org.assertj.core.api.Assertions.assertThat; 31 | import static org.eclipse.dsp.DspConstants.DSP_PREFIX; 32 | 33 | /** 34 | * Base test class. 35 | */ 36 | public abstract class AbstractSchemaTest { 37 | protected static final String MIN_CONTAINS = "minContains"; 38 | protected static final String MIN_ITEMS = "minItems"; 39 | protected static final String REQUIRED = "required"; 40 | protected static final String ONE_OF = "oneOf"; 41 | protected static final String TYPE = "type"; 42 | protected static final String ENUM = "enum"; 43 | 44 | private static final String CLASSPATH_SCHEMA = "classpath:/"; 45 | private static final String MAIN_RESOURCES = "src/main/resources"; 46 | 47 | 48 | protected ObjectMapper mapper = new ObjectMapper(); 49 | protected JsonSchema schema; 50 | protected JsonSchema metaSchema; 51 | 52 | protected void setUp(String schemaFile) { 53 | var schemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V201909, builder -> 54 | builder.schemaMappers(schemaMappers -> schemaMappers.mapPrefix(DSP_PREFIX, CLASSPATH_SCHEMA)) 55 | ); 56 | 57 | metaSchema = schemaFactory.getSchema(SchemaLocation.of(V201909)); 58 | 59 | JsonNode schemaAsNode; 60 | try { 61 | schemaAsNode = mapper.readTree(new File(MAIN_RESOURCES + schemaFile)); 62 | } catch (IOException e) { 63 | throw new RuntimeException(); 64 | } 65 | 66 | assertThat(metaSchema.validate(schemaAsNode)).isEmpty(); 67 | 68 | schema = schemaFactory.getSchema(SchemaLocation.of(DSP_PREFIX + schemaFile)); 69 | } 70 | 71 | protected SchemaError errorExtractor(ValidationMessage validationMessage) { 72 | return new SchemaError(validationMessage.getProperty(), validationMessage.getType()); 73 | } 74 | 75 | protected SchemaError error(String property, String type) { 76 | return new SchemaError(property, type); 77 | } 78 | 79 | public record SchemaError(String property, String type) { 80 | 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /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_NO_CONSUMER_PID, JSON)) 30 | .hasSize(3) 31 | .extracting(this::errorExtractor) 32 | .contains(error("callbackAddress", REQUIRED), error("consumerPid", REQUIRED)); 33 | } 34 | 35 | @BeforeEach 36 | void setUp() { 37 | setUp("/negotiation/contract-offer-message-schema.json"); 38 | } 39 | 40 | private static final String INVALID_MESSAGE_NO_TARGET = """ 41 | { 42 | "@context": [ 43 | "https://w3id.org/dspace/2025/1/context.jsonld" 44 | ], 45 | "@type": "ContractOfferMessage", 46 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", 47 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833", 48 | "offer": { 49 | "@type": "Offer", 50 | "@id": "urn:uuid:6bcea82e-c509-443d-ba8c-8eef25984c07", 51 | "permission": [ 52 | { 53 | "action": "use" 54 | } 55 | ] 56 | }, 57 | "callbackAddress": "https://example.com/callback" 58 | } 59 | """; 60 | 61 | private static final String INVALID_MESSAGE_NO_CALLBACK_NO_CONSUMER_PID = """ 62 | { 63 | "@context": [ 64 | "https://w3id.org/dspace/2025/1/context.jsonld" 65 | ], 66 | "@type": "ContractOfferMessage", 67 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", 68 | "offer": { 69 | "@type": "Offer", 70 | "@id": "urn:uuid:6bcea82e-c509-443d-ba8c-8eef25984c07", 71 | "target": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88", 72 | "permission": [ 73 | { 74 | "action": "use" 75 | } 76 | ] 77 | } 78 | } 79 | """; 80 | } 81 | -------------------------------------------------------------------------------- /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/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/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/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/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/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 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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/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/main/resources/catalog/dataset-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2019-09/schema", 3 | "title": "DatasetSchema", 4 | "type": "object", 5 | "allOf": [ 6 | { 7 | "$ref": "#/definitions/RootDataset" 8 | } 9 | ], 10 | "$id": "https://w3id.org/dspace/2025/1/catalog/dataset-schema.json", 11 | "definitions": { 12 | "AbstractDataset": { 13 | "type": "object", 14 | "allOf": [ 15 | { 16 | "$ref": "#/definitions/Resource" 17 | }, 18 | { 19 | "properties": { 20 | "distribution": { 21 | "type": "array", 22 | "items": { 23 | "$ref": "#/definitions/Distribution" 24 | }, 25 | "minItems": 1 26 | } 27 | } 28 | } 29 | ] 30 | }, 31 | "Dataset": { 32 | "type": "object", 33 | "allOf": [ 34 | { 35 | "$ref": "#/definitions/AbstractDataset" 36 | } 37 | ], 38 | "properties": { 39 | "hasPolicy": { 40 | "type": "array", 41 | "items": { 42 | "$ref": "https://w3id.org/dspace/2025/1/negotiation/contract-schema.json#/definitions/Offer" 43 | }, 44 | "minItems": 1 45 | } 46 | }, 47 | "required": [ 48 | "hasPolicy", 49 | "distribution" 50 | ] 51 | }, 52 | "RootDataset": { 53 | "type": "object", 54 | "allOf": [ 55 | { 56 | "$ref": "#/definitions/Dataset" 57 | } 58 | ], 59 | "properties": { 60 | "@context": { 61 | "$ref": "https://w3id.org/dspace/2025/1/common/context-schema.json" 62 | } 63 | }, 64 | "required": [ 65 | "@context" 66 | ] 67 | }, 68 | "Resource": { 69 | "type": "object", 70 | "properties": { 71 | "@id": { 72 | "type": "string" 73 | } 74 | }, 75 | "required": [ 76 | "@id" 77 | ] 78 | }, 79 | "Distribution": { 80 | "type": "object", 81 | "properties": { 82 | "hasPolicy": { 83 | "type": "array", 84 | "items": { 85 | "$ref": "https://w3id.org/dspace/2025/1/negotiation/contract-schema.json#/definitions/Offer" 86 | }, 87 | "minItems": 1 88 | }, 89 | "accessService": { 90 | "oneOf": [ 91 | { 92 | "type": "string" 93 | }, 94 | { 95 | "$ref": "#/definitions/DataService" 96 | } 97 | ] 98 | }, 99 | "format": { 100 | "type": "string" 101 | } 102 | }, 103 | "required": [ 104 | "accessService", 105 | "format" 106 | ] 107 | }, 108 | "DataService": { 109 | "type": "object", 110 | "allOf": [ 111 | { 112 | "$ref": "#/definitions/Resource" 113 | }, 114 | { 115 | "properties": { 116 | "@type": { 117 | "type": "string", 118 | "const": "DataService" 119 | }, 120 | "endpointURL": { 121 | "type": "string" 122 | }, 123 | "servesDataset": { 124 | "type": "array", 125 | "items": { 126 | "$ref": "#/definitions/Dataset" 127 | }, 128 | "minItems": 1 129 | } 130 | }, 131 | "required": [ 132 | "@type", 133 | "endpointURL" 134 | ] 135 | } 136 | ] 137 | }, 138 | "Reference": { 139 | "type": "object", 140 | "properties": { 141 | "@id": { 142 | "type": "string" 143 | } 144 | }, 145 | "required": [ 146 | "@id" 147 | ] 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /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. 31 | 32 | ### Publishing versions 33 | 34 | When wanting to pin and publish a snapshot in time via a separate url-path, follow the appropriate steps listed below. 35 | 36 | #### Prep commits 37 | 38 | When the content is finished, a release requires a first commit with 39 | 40 | 1. a tag with the exact version string (like `2025-1-RC1`) on the release commit 41 | 2. to change the redirect in `.github/scripts/index.html` to point to latest release candidate 42 | 3. set the `respecConfig.publishDate` in `index.html` to a string like `"2025-02-27"`,` 43 | 4. set the `respecConfig.specStatus` in `index.html` to `base` 44 | 45 | In case of versions with a new namespace, additionally: 46 | 47 | 5. adjust the textual description of the context URI in the base spec 48 | 6. appended w3id referrals 49 | 50 | and then (independently of major/minor) a second commit 51 | 52 | 1. setting the specStatus config option to `unofficial` and 53 | 2. increase the spec version in the title of `index.html` 54 | 3. remove the release date 55 | 56 | #### Push and build 57 | 58 | - Open a PR with both commits. Wait for it to be merged. 59 | - Push the tag to origin/main on Github. 60 | - Rerun the actions. 61 | 62 | You should now see an additional endpoint at `https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/my-version-tag/`. 63 | 64 | #### Github Release 65 | 66 | Create a Github Release by adding a bit of context, autogenerating the releasenotes. For RCs, it's customary to include 67 | a permalink to the rendered respec webpage. -------------------------------------------------------------------------------- /artifacts/buildSrc/src/main/java/org/eclipse/dsp/generation/SchemaTableGeneratorPlugin.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 | import org.eclipse.dsp.generation.jsom.JsomParser; 19 | import org.eclipse.dsp.generation.transformer.HtmlTableTransformer; 20 | import org.eclipse.dsp.generation.transformer.SchemaTypeTransformer; 21 | import org.gradle.api.Plugin; 22 | import org.gradle.api.Project; 23 | import org.gradle.api.plugins.JavaPluginExtension; 24 | import org.gradle.api.tasks.SourceSet; 25 | import org.jetbrains.annotations.NotNull; 26 | 27 | import java.io.File; 28 | import java.io.FileWriter; 29 | import java.io.IOException; 30 | 31 | import static java.util.Objects.requireNonNull; 32 | 33 | /** 34 | * Generates a table of schema properties to be included in the specification text. 35 | */ 36 | public class SchemaTableGeneratorPlugin implements Plugin { 37 | private static final String TASK_NAME = "generateTablesFromSchemas"; 38 | private static final String CONFIG_NAME = "schemaTableGenerator"; 39 | private static final String GENERATED = "generated"; 40 | private static final String TABLES = "tables"; 41 | 42 | private final SchemaTypeTransformer htmlTransformer = new HtmlTableTransformer(); 43 | 44 | @Override 45 | public void apply(@NotNull Project project) { 46 | var extension = project.getExtensions().create(CONFIG_NAME, SchemaTableGeneratorPluginExtension.class); 47 | 48 | project.task(TASK_NAME).doLast(task -> { 49 | var tablesDir = task.getProject().getLayout().getBuildDirectory().dir(GENERATED).get().dir(TABLES).getAsFile(); 50 | //noinspection ResultOfMethodCallIgnored 51 | tablesDir.mkdirs(); 52 | var sourceSet = requireNonNull(project.getExtensions() 53 | .findByType(JavaPluginExtension.class)).getSourceSets().getByName("main"); 54 | 55 | var prefix = extension.getSchemaPrefix(); 56 | String resolvePath = getResolutionPath(sourceSet); 57 | 58 | // parse the schema object model 59 | var parser = new JsomParser(prefix, resolvePath); 60 | var stream = sourceSet.getResources().getFiles().stream() 61 | .filter(f -> f.getName().endsWith(extension.getSchemaFileSuffix())); 62 | var schemaModel = parser.parseFiles(stream); 63 | 64 | schemaModel.getSchemaTypes().stream() 65 | .filter(type -> !type.isRootDefinition() && !type.isJsonBaseType()) // do not process built-in Json types and root schema types 66 | .forEach(type -> { 67 | var content = htmlTransformer.transform(type); 68 | var destination = new File(tablesDir, type.getName().toLowerCase() + ".html"); 69 | try (var writer = new FileWriter(destination)) { 70 | writer.write(content); 71 | } catch (IOException e) { 72 | throw new RuntimeException(e); 73 | } 74 | }); 75 | task.getLogger().info("Completed generation"); 76 | }); 77 | 78 | } 79 | 80 | private String getResolutionPath(SourceSet sourceSet) { 81 | var files = sourceSet.getResources().getSourceDirectories().getFiles(); 82 | if (files.isEmpty()) { 83 | throw new IllegalStateException("No schema resource directories found"); 84 | } 85 | var path = files.iterator().next(); 86 | return path.getAbsolutePath().endsWith("/") ? path.getAbsolutePath() : path.getAbsolutePath() + "/"; 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /artifacts/src/main/resources/negotiation/example/contract-agreement-message-full.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 | "profile": "https://test.com/profile", 13 | "timestamp": "2023-01-01T01:00:00Z", 14 | "assigner": "http://example.com/Provider", 15 | "assignee": "http://example.com/Consumer", 16 | "permission": [ 17 | { 18 | "action": "use", 19 | "constraint": [ 20 | { 21 | "leftOperand": "dateTime", 22 | "operator": "lteq", 23 | "rightOperand": "2023-12-31T06:00Z" 24 | } 25 | ] 26 | }, 27 | { 28 | "action": "use", 29 | "constraint": [ 30 | { 31 | "and": [ 32 | { 33 | "leftOperand": "partner", 34 | "operator": "eq", 35 | "rightOperand": "gold" 36 | }, 37 | { 38 | "leftOperand": "partner", 39 | "operator": "eq", 40 | "rightOperand": "silver" 41 | } 42 | ] 43 | } 44 | ] 45 | }, 46 | { 47 | "action": "use", 48 | "constraint": [ 49 | { 50 | "or": [ 51 | { 52 | "leftOperand": "partner", 53 | "operator": "eq", 54 | "rightOperand": "gold" 55 | }, 56 | { 57 | "leftOperand": "partner", 58 | "operator": "eq", 59 | "rightOperand": "silver" 60 | } 61 | ] 62 | } 63 | ] 64 | }, 65 | { 66 | "action": "use", 67 | "constraint": [ 68 | { 69 | "leftOperand": "partner", 70 | "operator": "eq", 71 | "rightOperand": "gold" 72 | } 73 | ] 74 | }, 75 | { 76 | "action": "use", 77 | "constraint": [ 78 | { 79 | "andSequence": [ 80 | { 81 | "leftOperand": "partner", 82 | "operator": "eq", 83 | "rightOperand": "gold" 84 | }, 85 | { 86 | "leftOperand": "partner", 87 | "operator": "eq", 88 | "rightOperand": "silver" 89 | } 90 | ] 91 | } 92 | ] 93 | }, 94 | { 95 | "action": "use", 96 | "constraint": [ 97 | { 98 | "xone": [ 99 | { 100 | "leftOperand": "partner", 101 | "operator": "eq", 102 | "rightOperand": "gold" 103 | }, 104 | { 105 | "leftOperand": "partner", 106 | "operator": "eq", 107 | "rightOperand": "silver" 108 | } 109 | ] 110 | } 111 | ] 112 | }, 113 | { 114 | "action": "use", 115 | "constraint": [ 116 | { 117 | "or": [ 118 | { 119 | "and": [ 120 | { 121 | "leftOperand": "constraint1", 122 | "operator": "eq", 123 | "rightOperand": "value1" 124 | }, 125 | { 126 | "leftOperand": "constraint2", 127 | "operator": "eq", 128 | "rightOperand": "value2" 129 | } 130 | ] 131 | }, 132 | { 133 | "leftOperand": "partner", 134 | "operator": "eq", 135 | "rightOperand": "silver" 136 | } 137 | ] 138 | } 139 | ] 140 | } 141 | ] 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /artifacts/src/test/java/org/eclipse/dsp/schema/transfer/InvalidTransferProcessSchemaTest.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 InvalidTransferProcessSchemaTest 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 | assertThat(schema.validate(INVALID_MESSAGE_NO_STATE, JSON).iterator().next().getType()).isEqualTo(REQUIRED); 33 | assertThat(schema.validate(INVALID_MESSAGE_STATE, JSON).iterator().next().getType()).isEqualTo(ENUM); 34 | } 35 | 36 | @BeforeEach 37 | void setUp() { 38 | setUp("/transfer/transfer-process-schema.json"); 39 | } 40 | 41 | private static final String INVALID_MESSAGE_NO_CONTEXT = """ 42 | { 43 | "@type": "TransferProcess", 44 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", 45 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833", 46 | "state": "REQUESTED" 47 | } 48 | """; 49 | 50 | private static final String INVALID_MESSAGE_NO_TYPE = """ 51 | { 52 | "@context": [ 53 | "https://w3id.org/dspace/2025/1/context.jsonld" 54 | ], 55 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", 56 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833", 57 | "state": "REQUESTED" 58 | } 59 | """; 60 | 61 | private static final String INVALID_MESSAGE_NO_PROVIDER_ID = """ 62 | { 63 | "@context": [ 64 | "https://w3id.org/dspace/2025/1/context.jsonld" 65 | ], 66 | "@type": "TransferProcess", 67 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833", 68 | "state": "REQUESTED" 69 | } 70 | """; 71 | 72 | private static final String INVALID_MESSAGE_NO_CONSUMER_ID = """ 73 | { 74 | "@context": [ 75 | "https://w3id.org/dspace/2025/1/context.jsonld" 76 | ], 77 | "@type": "TransferProcess", 78 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", 79 | "state": "REQUESTED" 80 | } 81 | """; 82 | 83 | private static final String INVALID_MESSAGE_NO_STATE = """ 84 | { 85 | "@context": [ 86 | "https://w3id.org/dspace/2025/1/context.jsonld" 87 | ], 88 | "@type": "TransferProcess", 89 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", 90 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833" 91 | } 92 | """; 93 | 94 | private static final String INVALID_MESSAGE_STATE = """ 95 | { 96 | "@context": [ 97 | "https://w3id.org/dspace/2025/1/context.jsonld" 98 | ], 99 | "@type": "TransferProcess", 100 | "providerPid": "urn:uuid:a343fcbf-99fc-4ce8-8e9b-148c97605aab", 101 | "consumerPid": "urn:uuid:32541fe6-c580-409e-85a8-8a9a32fbe833", 102 | "state": "INVALID" 103 | } 104 | """; 105 | 106 | } 107 | --------------------------------------------------------------------------------