Open Transclusion and Linking Standard (OTLS)

Table of Contents

(Early draft 2025.9.19. subject to change.)

The Open Transclusion and Linking Standard (OTLS) is a proposed interoperability protocol designed for online wikis and collaborative knowledge systems. Its purpose is to provide a unified framework for indexing, querying, and sharing knowledge across multiple independent wikis, thereby enabling them to function as a distributed knowledge network.

Instead of each wiki operating in isolation, OTLS allows them to connect in a way similar to the Fediverse, where content remains locally hosted but can be referenced, transcluded, and queried across instances. Just as the Fediverse connects independent social platforms through shared protocols (e.g., ActivityPub), OTLS connects independent wikis into a federated web of knowledge. Each wiki becomes both a contributor to and a beneficiary of the larger ecosystem, while retaining sovereignty over its own data.

OTLS supports the modelling of three major operations: linking, transclusion and delegation.

1. Technical definition draft

To lessen the cost of adaptation, currently all OTLS protocols are defined upon normal HTTP and HTML.

1.1. Root

All pages of an OTLS-conforming wiki must contain the following in their <head> tag:

<link rel="canonical" href="{{canonical url}}" />

The {{canonical url}} is used for peer discovery (see related section below).

If the wiki choose to provide a search function, the following must be included in the <head> tag of the document provided by visiting the canonical URL:

<link rel="search" href="{{query endpoint}}" />

All query to the wiki would be done in the form of a GET request to the URL of the following form:

{{query endpoint}}?query={{query text}}

1.2. Linking

<a otls:method="link" href="{{url}}">{{link text}}</a>

Linking does not need anything special to be working, but otls:action should be used anyway to allow browser extensions to perform their extra functionalities (if any).

1.3. Transclusion

<a otls:method="transclusion" href="{{url}}?start={{start}}&len={{len}}">{{link text}}</a>

Transclusion requires fetching the most recent version of the document specified by href.

  • For non-JS static file only site, dynamic fetching is impossible to initialize from the site itself. One is strongly recommended to have the {{link text}} part; without which the site will show nothing but an empty link.
  • For static file only site w/ JS, the JS script should fetch and insert into the corresponding element after page load.
  • For sites with a backend, the transclusion should be performed by the server and inserted while generating the HTML response.
  • Clients with OTLS browser extension should perform the fetching and extension at the request of the user.

1.4. Delegation

1.4.1. Peer discovery

Before talking about delegation we must talk about peer discovery. Under OTLS, a wiki can configure any amount (including none at all) of "peers" who are expected to support the same protocols. To truly enable the decentralized nature of OTLS, this list of peers must be available for being used to discover more wikis by the client. Such list must be at the location defined by the following two rules:

1.4.2. Peer list format

The URL of the peer list should refer to a plain-text file containing a list of query endpoints that uses the OTLS standard. Each line should contain one description of endpoint. Each description of endpoint can contain a name (optional), but must contain an URL. If choose to contain a name, the textual format would be the name, followed by a comma ,, followed by the URL. If choose not to provide a name, the host part of the URL is considered to be the name of that endpoint. For example, assume the file referred by a form's otls:peer link contains the following text:

https://wiki.sebastian.graphics/otls-query
  Minecraft   ,  https://minecraft.wiki/q
 AestheticsFandom,https://aesthetics.fandom.com/wiki/Special:Search

It would be considered as containing 3 peers:

  • The first one only contains an URL, which means that its host part, i.e. wiki.sebastian.graphics, would be considered as the name of this peer.
  • The second one contains the name Minecraft and the URL https://minecraft.wiki/q.
  • The third one contains the name AestheticsFandom and the URL https://aesthetics.fandom.com/wiki/Special:Search.

1.4.3. Querying an OTLS wiki and its peers

All query endpoint should be designed to take its query string w/ the GET method and from the parameter named query. For example, to query the 3 peers listed in the example above, you need to send GET requests to the following URLs:

https://wiki.sebastian.graphics/otls-query?query={{text}}
https://minecraft.wiki/q?query={{text}}
https://aesthetics.fandom.com/wiki/Special:Search?query={{text}}

1.4.4. Usage

Wiki pages can provide a form like this:

<form otls:method="delegation"
      method="GET" action="{{action link}}">
  <!-- ... -->
  <input otls:action="query" type="submit" />
</form>
  • Non-JS static file only site normally don't have the power to handle a form like this. One is still strongly recommended to include such a form and use otls:method and otls:action for browser extensions to pick up and handle the query. The action in this case can be left blank.
  • Static file only site w/ JS should be able to hook onto the submit button and call the searching HTTP API there. The action in this case can be left blank.
  • Sites with a backend should obviously be able to handle search queries…

Any form can use an additional or a separate peer list by using the otls:peer attribute:

<form otls:method="delegation" otls:peer="{{peerlist-url}}"
      method="GET" action="{{action link}}">
  <!-- ... -->
  <input otls:action="query" type="submit" />
</form>

The value of otls:peer should be one of the following:

  • replace;{{url}}: replace the "canonical" peer list with {{url}}.
  • add;{{url}}: append the "canonical" peer list with the content of {{url}}.
  • {{url}}: same as add;{{url}}.

2. Discussion

We are hosting any related discussion at our Discord server: https://discord.gg/CTj5wG4d. At current stage, we welcome any opinions, suggestions and recommendations.

Created: 2025-09-19 五 21:21

Validate