---
# System prepended metadata

title: IM4DEC Data Sharing
tags: [im4dec]

---

# IM4DEC: Data Sharing of Chatbot Conversations

### Content
* [Goal](#Goal)
* [Process](#Process)
* [Tasks](#Tasks)
* [D2A for Conversations](#Domain-specific-Data-Agreement-D2A-Example)
* [D3A for Conversations](#Domain-specific-Disclosure-Data-Agreement-D3A-Example)

### Goal
* allow to manually trigger sharing of selected conversations from DEC112 Chatbot
* establish working example for Data Sharing of personal data with Data Agreements
* demonstrate the use of a Data Intermediary

### Overall Flow
1) D3A between DEC112 (Data Source) and OYD (Intermediary)
    Purpose is already pre-specified (and documented in a Template)! You cannot change the purpose later because this would imply a agreement.
2) D3A between OYD (Intermediary) and a Third Party
    Purpose is already pre-specified (and documented in a Template)! You cannot change the purpose later.
    a) third party is known (MoI) -> D3A can be signed (using Template)
    b) third party is unknown (Emergency Response Organisations) -> Template is available
3) Actor (User) performs conversation and explicitly consents to D2A that is documented online https://www.dec112.at/en/chatbot

"exercise your privacy rights": "because data is anonymized there is no withdrawal; you can query information about this service via email to info@dec112.at"

#### Technical documentation
* Signature of the D2A by DEC112 and should include reference to website (duration: empty)
* D3A (DEC112->OYD): Data Source is DEC112
* D3A (OYD->MoI): Data Source is OYD

### Process
* create conversations (examples [available here](https://drive.google.com/drive/u/3/folders/1FlIwKJLpL--peRwAZ1kW-nAKavJ99Tps))
* document Data Sharing ([D2 - Design](https://docs.google.com/document/d/1TKcnwnFebjJnBc6A2AiqpYFdzVD28tIGXQirjrt-ACk/edit#heading=h.6mbnd72pt16j))
* establish Data Sharing Agreement (D2A) between Data Source (DEC112 Association) and Data Intermediary (OwnYourData Assocation)
* send data from DEC112 Chatbot to OwnYourdata Intermediary based on D2A
* establish Data Sharing Agreement (D3A) between Data Intermediary (OwnYourData Association) and Data Usint Service (Ministry of the Interior, MoI)
* send data from OwnYourdata Intermediary to MoI based on D3A

Note / Links:
* Data Agreement HackMD from Babelfish: https://hackmd.io/0JCwA91XS_2Hiy58RqPnpA

### Tasks
**Identities**
- [x] Christoph: establish identity for DEC112 association
    <details><summary>DEC112 DID</summary>
    <ul>
      <li>DID: <code>did:oyd:zQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ</code></li>
      <li>command: <code>echo '' | oydid create --doc-pwd decpwd --rev-pwd decrev -z 1</code></li>
    </ul>
    </details>
- [x] Christoph: establish identity for OwnYourData association
    <details><summary>OwnYourData DID</summary>
    <ul>
      <li>DID: <code>did:oyd:zQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU</code></li>
      <li>command: <code>echo '' | oydid create --doc-pwd oydpwd --rev-pwd oydrev -z 1</code></li>
    </ul>
    </details>
- [x] Christoph: establish identity for Ministry of the Interior
    <details><summary>Ministry of the Interior DID</summary>
    <ul>
      <li>DID: <code>did:oyd:zQmf8mUhkN73Sgwjpn1RaShyQbgVfVbGu8yYDzW7e8WGt2z</code></li>
      <li>command: <code>echo '' | oydid create --doc-pwd moipwd --rev-pwd moirev -z 1</code></li>
    </ul>
    </details>

**Data Agreements**
- [x] Jan: document [human-readable explanation for Data Sharing](https://docs.google.com/document/d/1TKcnwnFebjJnBc6A2AiqpYFdzVD28tIGXQirjrt-ACk/edit#bookmark=id.suf6j5i2p6pq)
- [x] Jan: [review D2A](#Domain-specific-Data-Agreement-D2A-for-Conversations) between DEC112 and OwnYourData
- [x] Jan: [review D3A](#Domain-specific-Disclosure-Data-Agreement-D3A-for-Conversations) between OwnYourData and MoI

**Data Exchange Implementation**
- [ ] Christoph: implement sharing data from dc-chatbot to dc-intermediary
- [ ] Christoph: implement disclosig data form dc-intermediary to dc-service


## Data Agreements

### Domain specific Data Agreement (D2A) for Conversations

SOyA structure: [`D2A_Conversation`](https://soya.ownyourdata.eu/D2A_conversation/yaml)
Playground to edit D2A: [SOyA Form](https://soya-form.ownyourdata.eu/?schemaDri=D2A_conversation)

Complete example of D2A: [SOyA Form Record](https://soya-form.ownyourdata.eu/?schemaDri=D2A_conversation&data=%7B%22purposes%22%3A%5B%7B%22purpose_description%22%3A%22The+conversations+will+be+used+to+improve+training+for+call+takers.+All+personal+information%2C+such+as+address%2C+phone+number%2C+and+email%2C+is+removed+before+permanent+storage.%22%2C%22purpose_type%22%3A%22training%22%2C%22lawful_basis%22%3A%22consent%22%2C%22content%22%3A%5B%7B%22attribute_id%22%3A%22https%3A%2F%2Fsoya.ownyourdata.eu%2FDecChatBotSharing%3AConversation%3Atext%22%2C%22attribute_type%22%3A%22free+text%22%2C%22sensitivity%22%3A%22pii%22%7D%2C%7B%22attribute_id%22%3A%22https%3A%2F%2Fsoya.ownyourdata.eu%2FDecChatBotSharing%3Arating%22%2C%22attribute_type%22%3A%22integer%22%2C%22sensitivity%22%3A%22none%22%2C%22data_optional%22%3Atrue%7D%5D%2C%22processing_method%22%3A%22store%2C+query%2C+analyse%2C+anonymise%22%2C%22retention_period%22%3A%22%22%2C%22storage_location%22%3A%22EEC%22%2C%22geographic_restriction%22%3A%22EEC%22%2C%22recipient_third_party%22%3A%5B%7B%22party_id%22%3A%22did%3Aoyd%3AzQmf8mUhkN73Sgwjpn1RaShyQbgVfVbGu8yYDzW7e8WGt2z%22%2C%22party_name%22%3A%22Ministry+of+the+Interior%22%2C%22party_address%22%3A%22Herrengasse+7%2C+1010+Wien%2C+Austria%22%2C%22party_contact%22%3A%22%2B43+1+53+126-3100+%22%2C%22party_type%22%3A%22Authority%22%2C%22party_role%22%3A%22Third+Party%22%7D%2C%7B%22party_role%22%3A%22Data+Intermediary%22%2C%22party_type%22%3A%22Emergency+Response+Organisations%22%2C%22party_id%22%3A%22did%3Aoyd%3AzQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU%22%2C%22party_name%22%3A%22OwnYourData+-+Verein+zur+F%C3%B6rderung+der+selbstst%C3%A4ndigen+Nutzung+von+Daten%22%2C%22party_address%22%3A%22Michael+Scherz-Stra%C3%9Fe+14%2C+2540+Bad+V%C3%B6slau%2C+Austria%22%7D%5D%2C%22service%22%3A%22Digital+emergency+communication%22%2C%22jurisdiction%22%3A%22Vienna%22%2C%22privacy_policy%22%3A%22https%3A%2F%2Fwww.dec112.at%2Fen%2Fprivacy%2F%22%2C%22withdrawal_method%22%3A%22email+to+office%40ownyourdata.eu%22%2C%22data_controllers%22%3A%5B%7B%22party_id%22%3A%22did%3Aoyd%3AzQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ%22%2C%22party_name%22%3A%22DEC112+-+Verein+zur+Entwicklung+von+standardisierten+und+barrierefreien+Notrufen%22%2C%22party_address%22%3A%22Steingasse+3%2C+4786+Brunnenthal%2C+Austria%22%2C%22party_type%22%3A%22Association%22%2C%22party_role%22%3A%22Data+Source%22%7D%2C%7B%22party_id%22%3A%22did%3Aoyd%3AzQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU%22%2C%22party_name%22%3A%22OwnYourData+-+Verein+zur+F%C3%B6rderung+der+selbstst%C3%A4ndigen+Nutzung+von+Daten%22%2C%22party_address%22%3A%22Michael+Scherz-Stra%C3%9Fe+14%2C+2540+Bad+V%C3%B6slau%2C+Austria%22%2C%22party_type%22%3A%22Association%22%2C%22party_role%22%3A%22Data+Intermediary%22%7D%5D%2C%22event_time%22%3A%222023-10-25T12%3A00%3A00%2B02%3A00%22%2C%22event_type%22%3A%22implicit%22%2C%22event_state%22%3A%22consent%22%2C%22event_entity_id%22%3A%22did%3Aoyd%3AzQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ%22%7D%5D%7D)

```json=
{
  "purposes": [
    {
      "purpose_description": "The conversations will be used to improve training for call takers. All personal information, such as address, phone number, and email, is removed before permanent storage.",
      "purpose_type": "training",
      "lawful_basis": "consent",
      "content": [
        {
          "attribute_id": "https://soya.ownyourdata.eu/DecChatBotSharing:Conversation:text",
          "attribute_type": "free text",
          "sensitivity": "pii"
        },
        {
          "attribute_id": "https://soya.ownyourdata.eu/DecChatBotSharing:rating",
          "attribute_type": "integer",
          "sensitivity": "none",
          "data_optional": true
        }
      ],
      "processing_method": "store, query, analyse, anonymise",
      "retention_period": "",
      "storage_location": "EEC",
      "geographic_restriction": "EEC",
      "recipient_third_party": [
        {
          "party_id": "did:oyd:zQmf8mUhkN73Sgwjpn1RaShyQbgVfVbGu8yYDzW7e8WGt2z",
          "party_name": "Ministry of the Interior",
          "party_address": "Herrengasse 7, 1010 Wien, Austria",
          "party_contact": "+43 1 53 126-3100 ",
          "party_type": "Authority",
          "party_role": "Third Party"
        },
        {
          "party_role": "Data Intermediary",
          "party_type": "Emergency Response Organisations",
          "party_id": "did:oyd:zQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU",
          "party_name": "Verein zur Förderung der selbstständigen Nutzung von Daten",
          "party_address": "Michael Scherz-Straße 14, 2540 Bad Vöslau, Austria"
        }
      ],
      "service": "Digital emergency communication",
      "jurisdiction": "Vienna",
      "privacy_policy": "https://www.dec112.at/en/privacy/",
      "withdrawal_method": "email to office@ownyourdata.eu",
      "data_controllers": [
        {
          "party_id": "did:oyd:zQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ",
          "party_name": "DEC112 - Verein zur Entwicklung von standardisierten und barrierefreien Notrufen",
          "party_address": "Steingasse 3, 4786 Brunnenthal, Austria",
          "party_type": "Association"
        },
        {
          "party_id": "did:oyd:zQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU",
          "party_name": "OwnYourData - Verein zur Förderung der selbstständigen Nutzung von Daten",
          "party_address": "Michael Scherz-Straße 14, 2540 Bad Vöslau, Austria",
          "party_type": "Association"
        }
      ]
    }
  ]
}
```

### Domain specific Disclosure Data Agreement (D3A) for Conversations

SOyA structure: [`D3A_Conversation`](https://soya.ownyourdata.eu/D3A_conversation/yaml)
Playground to edit D3A: [SOyA Form](https://soya-form.ownyourdata.eu/?schemaDri=D3A_conversation)

Complete example of D3A: [SOyA Form Record](https://soya-form.ownyourdata.eu/?schemaDri=D3A_conversation&data=%7B%22purposes%22%3A%5B%7B%22purpose_description%22%3A%22The+conversations+will+be+used+to+improve+training+for+call+takers.+All+personal+information+like+address%2C+phone+number+and+email+is+removed+before+permanently+storing.%22%2C%22purpose%22%3A%22improve+training+for+call+takers%22%2C%22processing%22%3A%5B%22scdv%3AStore%22%2C%22scdv%3AQuery%22%2C%22scdv%3AAnalyse%22%5D%2C%22recipient%22%3A%5B%22scdv%3AAuthority%22%5D%2C%22storage_location%22%3A%5B%22scdv%3AEU%22%5D%2C%22retention_period%22%3A%22permanent%22%2C%22service%22%3A%22Digital+emergency+communication%22%2C%22geographic_restriction%22%3A%22Europe%22%2C%22jurisdiction%22%3A%22Vienna%22%2C%22withdrawal_method%22%3A%22email+to+office%40ownyourdata.eu%22%2C%22pii_information%22%3A%5B%7B%22attribute_id%22%3A%22https%3A%2F%2Fsoya.ownyourdata.eu%2FDecChatBotSharing%3AConversation%3Atext%22%2C%22attribute_type%22%3A%22free+text%22%2C%22sensitivity%22%3A%22pii%22%7D%5D%2C%22data_intermediary%22%3A%5B%7B%22organization_id%22%3A%22did%3Aoyd%3AzQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU%22%2C%22name%22%3A%22OwnYourData+-+Verein+zur+F%C3%B6rderung+der+selbstst%C3%A4ndigen+Nutzung+von+Daten%22%2C%22address%22%3A%22Michael+Scherz-Stra%C3%9Fe+14%2C+2540+Bad+V%C3%B6slau%2C+Austria%22%2C%22party_type%22%3A%22Association%22%7D%5D%2C%22data_user%22%3A%5B%7B%22organization_id%22%3A%22did%3Aoyd%3AzQmf8mUhkN73Sgwjpn1RaShyQbgVfVbGu8yYDzW7e8WGt2z%22%2C%22name%22%3A%22Ministry+of+the+Interior%22%2C%22party_type%22%3A%22Ministry%22%2C%22address%22%3A%22Herrengasse+7%2C+Wien+1010%2C+Austria%22%7D%5D%7D%5D%7D)
```json=
{
  "purposes": [
    {
      "purpose_description": "The conversations will be used to improve training for call takers. All personal information, such as address, phone number, and email, is removed before permanent storage.",
      "purpose_type": "training",
      "lawful_basis": "consent",
      "content": [
        {
          "attribute_id": "https://soya.ownyourdata.eu/DecChatBotSharing:Conversation:text",
          "attribute_type": "free text",
          "sensitivity": "pii"
        },
        {
          "attribute_id": "https://soya.ownyourdata.eu/DecChatBotSharing:rating",
          "attribute_type": "integer",
          "sensitivity": "none",
          "data_optional": true
        }
      ],
      "processing_method": "store, query, analyse, anonymise",
      "retention_period": "",
      "storage_location": "EEC",
      "geographic_restriction": "EEC",
      "recipient_third_party": [
        {
          "party_id": "did:oyd:zQmf8mUhkN73Sgwjpn1RaShyQbgVfVbGu8yYDzW7e8WGt2z",
          "party_name": "Ministry of the Interior",
          "party_address": "Herrengasse 7, 1010 Wien, Austria",
          "party_contact": "+43 1 53 126-3100 ",
          "party_type": "Authority",
          "party_role": "Third Party"
        },
        {
          "party_role": "Data Intermediary",
          "party_type": "Emergency Response Organisations",
          "party_id": "did:oyd:zQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU",
          "party_name": "Verein zur Förderung der selbstständigen Nutzung von Daten",
          "party_address": "Michael Scherz-Straße 14, 2540 Bad Vöslau, Austria"
        }
      ],
      "service": "Digital emergency communication",
      "jurisdiction": "Vienna",
      "privacy_policy": "https://www.dec112.at/en/privacy/",
      "withdrawal_method": "email to office@ownyourdata.eu",
      "data_controllers": [
        {
          "party_id": "did:oyd:zQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ",
          "party_name": "DEC112 - Verein zur Entwicklung von standardisierten und barrierefreien Notrufen",
          "party_address": "Steingasse 3, 4786 Brunnenthal, Austria",
          "party_type": "Association",
          "party_role": "Data Source"
        },
        {
          "party_id": "did:oyd:zQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU",
          "party_name": "OwnYourData - Verein zur Förderung der selbstständigen Nutzung von Daten",
          "party_address": "Michael Scherz-Straße 14, 2540 Bad Vöslau, Austria",
          "party_type": "Association",
          "party_role": "Data Intermediary"
        }
      ],
      "event_time": "2023-10-25T12:00:00+02:00",
      "event_type": "implicit",
      "event_state": "consent",
      "event_entity_id": "did:oyd:zQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ"
    }
  ]
}
```

## Infrastructure

```plantuml
@startuml

component "chatbot.services.dec112.eu\nimage: oydeu/dc-chatbot" <<Chatbot>> as chatbot
component "disp.data-container.eu\nimage: oydeu/dc-intermediary" <<Data Intermediary>> as disp
component "im4dec-moi.data-container.eu\nimage: oydeu/dc-base" <<Data User>> as user

chatbot -> disp
disp -> user

@enduml
```