TDMRep (Text and Data Mining Reservation Protocol)
The tdmrep module serves a site's text and data mining (TDM) reservation declaration and its machine-readable policy through Drupal routes. The initial declaration reserves TDM rights for the whole site, and the default policy requires consent before TDM mining.
Requirements
Drupal 11. The module has no dependency on any other contributed module.
Installation
composer require drupal/tdmrep drush pm:install tdmrep
The module serves both tdmrep.json and tdm-policy.json documents dynamically. It does not need document-root files, a .well-known directory, or a Composer scaffold mapping.
Public endpoints
Both routes are public, accept GET requests, and are unprefixed by Drupal's language negotiation. Their URLs are:
Route Response media type Document/.well-known/tdmrep.json
application/json
A one-rule JSON array for /, with tdm-reservation set to 1, and an absolute link to /tdm-policy.json.
/tdm-policy.json
application/ld+json
The configured policy JSON object. The installed default is an ODRL Offer using the TDMRep profile and requiring consent for tdm:mine.
The initial root reservation value is fixed at 1. The settings form rejects a rules document unless it is a JSON array containing exactly one rule for / with the integer reservation value 1. The installed policy is a consent-based ODRL Offer using the TDMRep profile, but this is a default rather than a fixed constraint: administrators can customize the policy's contexts, type, profile, permissions, duties, and other JSON object members.
Administration
Visit Configuration > Web services > TDMRep settings at /admin/config/services/tdmrep. Access requires the administer tdmrep permission.
The form stores its values in tdmrep.settings:
rules_json: must decode as a JSON array with exactly one/rule andtdm-reservationequal to the integer1.policy_json: must be a valid JSON object. Its contents are served as configured; the form does not enforce a particular ODRL/TDMRep profile or permission structure.contact_email_override: optional. A non-empty value must be a valid email address. Leave it blank to use the site's configured contact address.
Malformed or non-object policy JSON, invalid rules, or an invalid email prevent the settings from being saved. Values explicitly set in policy_json, including policy and assigner properties, take precedence and are preserved in the response. A missing policy UID and missing properties on an assigner object are filled with absolute URLs from Drupal's trusted route URL generator, system.site:name, and the effective contact email. The contact email uses the non-empty contact_email_override first, then system.site:mail. Administrators are responsible for ensuring that customized policy content has the semantics they intend.
Caching and failures
Successful endpoint responses are public and have a maximum age of one hour (3,600 seconds). Their cache metadata depends on tdmrep.settings and system.site, so configuration changes invalidate cached documents.
If stored configuration cannot produce a valid document, the affected route returns an empty 503 Service Unavailable response with Cache-Control: no-store rather than serving malformed JSON.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.x-dev | Dev | 11 | Serves TDMRep documents (/.well-known/tdmrep.json and /tdm-policy.json) from Drupal configuration. | Sep 29, 2026 |