ᴛʀᴇᴇ

A hypermedia specification for autonomous querying of datasets based on their literal values

ᴛʀᴇᴇ enables you to describe relations between a specific value and all members a page linked from this current page. Using this specific relation, a script or autonomous query client (such as Comunica and Planner.js) can understand whether following the link will be useful or not.

The Vocabulary

Base URI to be used: https://w3id.org/tree#.

Preferred prefix: tree:.

All newly introduced terms are explained in the RDF vocabulary.

Most important concepts:

  • a tree:Node is a page that may contain members of a tree:Collection
  • a node has tree:relation entities with links to other nodes. This relation is typed (e.g., tree:GeospatiallyContainsRelation or a tree:PrefixRelation),
  • the relation has a tree:value and a tree:path. The former is a literal value on which the search term can be compared. The tree:path explains to which property of the members of the collection this relation applies.

Specifications

A couple of formal specifications can be implemented by clients to understand specific hypermedia building blocks using the vocabulary:

  1. Discovery: how to discover a tree:Node
  2. Traversing a tree:Node’s tree:relation for more specific information
  3. Search forms for making certain nodes directly accessible

We are also planning to specify how to describe Provenance and Summaries. Feel free to pull request ideas.

Mind that a server exposing data with ᴛʀᴇᴇ must set the CORS headers to allow any host.

In order to write a full ᴛʀᴇᴇ compliant client, you need to implement all building blocks. Comunica and its hypermedia actors will be our main reference implementation (work in progress).

See the specs folder for more information.

Implementations

Neat examples can be found here:

Also check the examples folder in here, as we’ve taken the effort to illustrate a couple of use cases.

Questions and Answers

Why publish a hypermedia structure?

When a document grows too large for 1 HTTP response, we need to fragment it. The way we fragment it will immediatly decide what queries will be fast and which queries will be slow. Hypermedia can be used to hit the sweet spot between data dumps and querying APIs (such as GraphQL or SPARQL). It is particularly a sweet spot for Open Data publishers that need a cost-efficient way of publishing their data, while allowing third parties to create serverless applications to reuse the data.

dump ᴛʀᴇᴇ fragments query
processing client shared server
server cost low okay high
client cost high okay low
caching low high low
query execution control high high low

Why hypermedia?

When you write a client for one server, you can get away with hard-coding the way the API is built based on the API specification. When building a client for the entire Web, we need to make very general specifications that still allow our client to understand what it can do next. The latter are called the hypermedia controls.

What are triples? JSON-LD? RDF? URIs? Linked Data?

Same idea as hypermedia, only for understanding the elements in the pages itself. See these intro slides, or read this chapter.