Adding Custom Access Policies

By default, the PISTIS Marketplace allows all users to view and purchase an offer. Data Providers can override this behaviour by adding custom policies that restrict access for specific organisations. These policies must be defined in the offer's metadata. The example below shows an offer that applies two such restrictions.

The Access Policy is expressed using ODRL. You can learn more about it here: https://www.w3.org/TR/odrl-model/
Turtle
POST https://pistis-market.eu/srv/repo/catalogues/<catalog-id>/datasets
Content-Type: text/turtle
X-API-Key: <api-key>

<your-existing-prefixes> .
@prefix odrl:    <http://www.w3.org/ns/odrl/2/> .

<your-dcat:Distribution>

<your-pst:MonetizationMethod>

<your-pst:PurchaseOffer>

<your-pst:InvestmentOffer>

<https://pistis-market.eu/set/data/test-dataset>
    a                   dcat:Dataset ;
    <your-existing-dcat:Dataset-properties> ;
    odrl:hasPolicy      <https://piveau.io/set/policy/policy-id> .

<https://piveau.io/set/policy/policy-id>
    a              odrl:Policy ;
    odrl:permission    <https://piveau.io/set/policy/permission/permission-id-2>, <https://piveau.io/set/policy/permission/permission-id-3> .

<https://piveau.io/set/policy/permission/permission-id-2>
    a odrl:Permission ;
        dct:identifier  "2";
        odrl:action "READ" ;
        odrl:constraint [
            odrl:leftOperand "groups" ;
            odrl:operator "isNoneOf" ;
            odrl:rightOperand   "PDT", "CARUSO" ;
        ] ;
        odrl:constraint [
            odrl:leftOperand "domains" ;
            odrl:operator "isNoneOf" ;
            odrl:rightOperand "OIL_AND_GAS" ;
        ] ;
        odrl:constraint [
            odrl:leftOperand "countries" ;
            odrl:operator "isNoneOf" ;
            odrl:rightOperand "UK" ;
        ] ;
        odrl:constraint [
            odrl:leftOperand "sizes" ;
            odrl:operator "isNoneOf" ;
            odrl:rightOperand "LARGE" ;
        ] ;
        odrl:constraint [
            odrl:leftOperand "types" ;
            odrl:operator "isNoneOf" ;
            odrl:rightOperand "PSFP", "IGO" ;
        ].

<https://piveau.io/set/policy/permission/permission-id-3>
    a odrl:Permission ;
        dct:identifier  "3";
        odrl:action "READ", "TRADE" ;
        odrl:constraint [
            odrl:leftOperand "groups" ;
            odrl:operator "isNoneOf" ;
            odrl:rightOperand   "ACME" ;
        ] ;
        odrl:constraint [
            odrl:leftOperand "countries" ;
            odrl:operator "isNoneOf" ;
            odrl:rightOperand "GR" ;
        ] .
JSON-LD
to-be-defined

See the full example here.