Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ODRL Policy Nanopublication Generator

Creates ODRL (Open Digital Rights Language) policy nanopublications from a JSON configuration file.

Each nanopub encodes an access policy for a FAIR2Adapt dataset, specifying:

  • Permissions: what actions are allowed (e.g., use, reproduce) and under what constraints (e.g., academic research only)

  • Prohibitions: what actions are not allowed (e.g., distribute, commercialize)

  • Duties: what obligations must be met (e.g., attribution)

Template: To be created on Nanodash — see instructions below.


How to create the ODRL Policy template on Nanodash

Before using this notebook, create an assertion template on Nanodash:

  1. Go to Nanodash → Publish → Assertion Template

  2. Fill in:

    • Name: ODRL Access Policy

    • Description: Defines an ODRL policy for controlling access to a FAIR dataset. Specifies permissions (with purpose constraints), prohibitions, and attribution duties.

    • Tag: FAIR2Adapt

  3. Define the statements (see the assertion structure in the generated TriG files)

  4. Publish the template and copy its URI

  5. Update ODRL_POLICY_TEMPLATE below with the URI



📝 SECTION 1: INPUT FILE (EDIT THIS)



⚙️ SECTION 2: SETUP


Setup complete

📖 SECTION 3: LOAD & VALIDATE


Loading: config/hamburg_odrl_policy.json
✓ Loaded 3 ODRL policy nanopubs to generate
✓ Author: Anne Fouilloux (0000-0002-1784-2920)

🔨 SECTION 4: BUILD NANOPUBLICATIONS


Function defined
✓ Generated: output/odrl_hamburg_buildings.trig
✓ Generated: output/odrl_hamburg_statistical_units.trig
✓ Generated: output/odrl_hamburg_risk_private.trig

Total generated: 3 nanopublications

📄 SECTION 5: PREVIEW


Preview of output/odrl_hamburg_buildings.trig:

================================================================================
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dpv: <https://w3id.org/dpv#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix np: <http://www.nanopub.org/nschema#> .
@prefix npx: <http://purl.org/nanopub/x/> .
@prefix nt: <https://w3id.org/np/o/ntemplate/> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix orcid: <https://orcid.org/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sub: <http://purl.org/nanopub/temp/np/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

sub:assertion {
    <https://fair2adapt.eu/policy/hamburg-buildings> a odrl:Offer ;
        odrl:duty _:N487cb9e25c5d4e9792732db6738c2980 ;
        odrl:permission _:N4251e18b2eee490b88cbeb0fc5e8ebf6,
            _:Nab5d8bf911a14fd9bbb29fe6eeac5b27 ;
        odrl:prohibition _:N2846452f50d944ad9d5c310c74d13f76,
            _:N4ce54ed1dc114d78a0e49421468aaab7 ;
        odrl:target <https://fair2adapt.eu/data/hamburg-buildings> .

    _:N2846452f50d944ad9d5c310c74d13f76 odrl:action odrl:distribute .

    _:N4251e18b2eee490b88cbeb0fc5e8ebf6 odrl:action odrl:use ;
        odrl:constraint _:Na4f350aedf764ec48ce7962c5223dac3 .

    _:N487cb9e25c5d4e9792732db6738c2980 odrl:action odrl:attribute ;
        odrl:attributedParty <https://fair2adapt-eosc.eu> .

    _:N4ce54ed1dc114d78a0e49421468aaab7 odrl:action odrl:commercialize .

    _:Na4f350aedf764ec48ce7962c5223dac3 odrl:leftOperand odrl:purpose ;
        odrl:operator odrl:eq ;
        odrl:rightOperand dpv:AcademicResearch .

    _:Nab5d8bf911a14fd9bbb29fe6eeac5b27 odrl:action odrl:reproduce ;
        odrl:constraint _:Nc4cb7013ef9641a2ae5664e1a2294bd2 .

    _:Nc4cb7013ef9641a2ae5664e1a2294bd2 odrl:leftOperand odrl:purpose ;
        odrl:operator odrl:eq ;
        odrl:rightOperand dpv:AcademicResearch .
}

sub:provenance {
    sub:assertion prov:wasAttributedTo orcid:0000-0002-1784-2920 .
}

sub:pubinfo {
    sub: rdfs:label "ODRL policy: Hamburg building footprints with demographic indicators" ;
        dct:created "2026-03-29T15:37:44+00:00"^^xsd:dateTime ;
        dct:creator orcid:0000-0002-1784-2920 ;
        dct:license <https://creativecommons.org/licenses/by/4.0/> ;
        npx:hasNanopubType odrl:Policy ;
        npx:introduces <https://fair2adapt.eu/policy/hamburg-buildings> ;
        npx:supersedes <https://w3id.org/np/RAgtBCd3TIGKD1LEQfS5fv_4bXLNz_eMZJejX9KEsYp4M> ;
        npx:wasCreatedAt <https://fair2adapt-eosc.eu> ;
        nt:wasCreatedFromProvenanceTemplate <https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU> ;
        nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RA0J4vUn_dekg-U1kK3AOEt02p9mT2WO03uGxLDec1jLw>,
            <https://w3id.org/np/RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI> ;
        nt:wasCreatedFromTemplate <https://w3id.org/np/RA61D4c7dB5t0B1mLhc78bN2vagqYTXQiJDKY0yImRULI> .

    orcid:0000-0002-1784-2920 foaf:name "Anne Fouilloux" .
}

sub:Head {
    sub: a np:Nanopublication ;
        np:hasAssertion sub:assertion ;
        np:hasProvenance sub:provenance ;
        np:hasPublicationInfo sub:pubinfo .
}



🚀 SECTION 6: SIGN & PUBLISH


Loaded profile: Anne Fouilloux
✓ Signed: output/odrl_hamburg_buildings.signed.trig
✓ Published: https://w3id.org/np/RAJr0en7FUjJUG4Iav-BC_npvxcEn18VVRZfu4fQcc978
✓ Signed: output/odrl_hamburg_statistical_units.signed.trig
✓ Published: https://w3id.org/np/RA7ulL1qGsNX9THXbRlow1is6__jbNHYCrr7_8Glp3GJw
✓ Signed: output/odrl_hamburg_risk_private.signed.trig
✓ Published: https://w3id.org/np/RAX98xyu69t1xBlq8yx4DUmoR44-nYHzCl6ZifKYZQAzM

================================================================================
Update policies/registry.json with these nanopub URIs:
================================================================================
  "hamburg-buildings": {"policy_nanopub": "https://w3id.org/np/RAJr0en7FUjJUG4Iav-BC_npvxcEn18VVRZfu4fQcc978"}
  "hamburg-statistical-units": {"policy_nanopub": "https://w3id.org/np/RA7ulL1qGsNX9THXbRlow1is6__jbNHYCrr7_8Glp3GJw"}
  "hamburg-risk-private": {"policy_nanopub": "https://w3id.org/np/RAX98xyu69t1xBlq8yx4DUmoR44-nYHzCl6ZifKYZQAzM"}

📋 JSON Config Template

{
  "metadata": {
    "creator_orcid": "0000-0002-1784-2920",
    "creator_name": "Your Name",
    "project": {
      "uri": "https://fair2adapt-eosc.eu",
      "label": "FAIR2Adapt"
    }
  },
  "nanopublications": [
    {
      "id": "odrl_my_dataset",
      "policy_uid": "https://fair2adapt.eu/policy/my-dataset",
      "policy_type": "Offer",
      "target": {
        "uri": "https://fair2adapt.eu/data/my-dataset",
        "label": "Description of the dataset"
      },
      "permissions": [
        {
          "actions": ["use", "reproduce"],
          "purpose": "AcademicResearch"
        }
      ],
      "prohibitions": [
        { "actions": ["distribute", "commercialize"] }
      ],
      "duties": [
        {
          "action": "attribute",
          "attributed_party": {
            "uri": "https://fair2adapt-eosc.eu",
            "label": "FAIR2Adapt"
          }
        }
      ]
    }
  ]
}