Managing Distributions
Distributions constitute the connection the actual data stored in the Data Storage.
Adding a Distribution
Any modified, enriched or updated version of the data should be represented as an additional distribution. You can easily add one via a simple API call. The following is an example of a POST request to do it:
PUT https://develop.pistis-market.eu/srv/repo/datasets/<dataset-id>/distributions
Content-Type: text/turtle
X-API-Key: <api-key>
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
<https://piveau.io/set/new-distribution/>
a dcat:Distribution ;
dcterms:format <http://publications.europa.eu/resource/authority/file-type/CSV> ;
dcterms:title "Name of the Additional Distribution" ;
dcat:accessURL <http://factory-storage/anonymized-data.csv> .
You need to put the link to the Data Storage in dcat:accessURL. The format must be specified with dcterms:format, using the concept URI of the EU File Type Vocabulary. In dcterms:title you should give your file a nice and expressive title. More available properties can be found here: https://semiceu.github.io/DCAT-AP/releases/3.0.0/#Distribution
You get check the result with getting the dataset or by browsing the catalog UI.
GET https://develop.pistis-market.eu/srv/repo/datasets/<dataset-id>
Accept: text/turtle
Processing a Distribution
A distribution may be transformed, encrypted, and/or anonymized as needed. In such cases, it should be updated to include the relevant properties that reflect these changes. The following PUT request example updates a distribution and mark it as anonymized:
PUT https://develop.pistis-market.eu/srv/repo/distributions/<distribution-id>
Content-Type: application/ld+json
X-API-Key: <api-key>
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix pst: <https://www.pistis-project.eu/ns/voc#> .
<https://piveau.io/set/new-distribution/>
a dcat:Distribution ;
dcterms:format <http://publications.europa.eu/resource/authority/file-type/CSV> ;
dcterms:title "Name of the Additional Distribution" ;
dcat:accessURL <http://factory-storage/anonymized-data.csv> ;
pst:isAnonymized true .
Use
pst:isTransformedto indicate that a distribution has been transformedpst:isEncryptedto denote encryptionpst:isAnonymizedto denote anonymization
All properties are boolean and should be set to true or false to reflect the status. If they are omitted, the value is implicitly treated as false.
