Ring Application

Version 9.1 by slauriere on 2019/12/12 09:01

cogCreates and display a network of pages connected by relations. Not to be installed directly with the Extension Manager, please refer to the installation notes.
Developed by

Clément Aubin, Anca Luca, slauriere

1 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager


The Ring application ("Ring of knowledge") allows to draw relations between wiki pages. For instance, the relation has author can be created to state that page The Jungle Book has relation has author with page Rudyard Kipling. Relations are stored in the wiki as any other page, with the only specificity that they have relation is a with the page Relation. Each page connections can be browsed using a widget showing up under their title, allowing also to add new connections.

The application allows to:

  • Create types and relations as wiki pages
  • Use these relations to interlink pages with one another, hence creating "rings": a ring joins a page, a relation and another page. In addition, a ring can have internal properties (work in progress).
  • Explore pages via their relations, using facets.
  • Define relations constraints and properties.

A ring is an ordered set consisting of:

  • An origin page
  • A relation
  • A destination page or a scalar value (string, date, number, etc.)
  • A set of properties

For example, The Jungle Book has author Rudyard Kipling or The Jungle Book has publication date 1894 are rings.

Relations can have specific constraints, such as a constraint about the pages they can bind to one another. For instance, the relation has author will typically accept as destination pages only those of type person or organization. A page type is defined by linking it to the built-in Type page via relation is a, built-in as well. For example: Book is a Type.


Representation of a graph. Source: Textgraphs.org

User interface

Once installed, the application adds a block to each page header which displays the list of pages that are linked with the current one. This list can be ordered by page title or by last modification date.

This additional block also includes crosses for removing existing connections, and a button for adding new ones. When hitting this button, a form shows up, displaying the list of relations that the current page can use, and a search input field for selecting a destination page. For instance, on page The Jungle Book, once declared as a book, the form will typically propose the relations has author, has publication date, has publisher, etc. When selecting the relation has author, the search input field will suggest all the wiki pages of type person that match the entered input. The form supports only the addition of edges linking two pages together, not yet a page and a scalar value.

The user interface also includes a Filter buton which makes it possible to restrict the list of related pages by their own types or relations. All relations available in the wiki are automatically added to the faceting system for easy navigation across the graph of pages.

In order to draw a relation between two pages, the user needs to have at least edit right on the origin page. On a given page, a user will see all the related pages even whatever his access rights on them: in case he has no view access on a given connected page, he will get a denied access only when trying the view the content of that page.


Page "The Jungle Book" and its related pages


Form for connecting pages

Example: Nobel Prize laureates

The application includes a Wikidata data importer which creates a set of relations and types corresponding to Nobel Prizes Laureates data – in particular the relations has award, has country, and the types person and organization – and import data into the wiki.

Wikidata is a project that stores data using a graph structure as well, and provides interfaces for browsing the graph visually and for entering new statements.

Once imported into the wiki, the Nobel Prize laureate pages can be browsed using facets. For instance, all organizations and persons who received the Nobel Peace Prize can be browsed by country.


Facet filtering on page "Person"

Data model

TermA Term simply wraps a wiki page. It can have inward and outward rings.
RingA a ring typically links together two vertices – an origin and a destination – and a relation. The Jungle Book has author Rudyard Kipling is an ring that has referent page The Jungle Book, related page Rudyard Kipling, and relation has author. A ring can be a vertex, so that it's also possible to create rings involving rings, such as: Anna says that "The Jungle Book has author Rudyard Kipling", where says is a relation used by the edge having origin Anna and destination The Jungle Book has author Rudyard Kipling.
RelationA relation has a domain and an image. Its domain is the set of terms on which it can be applied to, and its domain is the set of terms it can accept as values. For instance, has award is a relation. Its domain is the set of pages representing a person or an organization. Its image is the set of pages that represent an award.
RingSetA RingSet is a set of terms, rings and relations.


Ring application class diagram

Built-in relations

The application includes a set of predefined relations described below, and one type.

Relation or TypeDescriptionExample
Is connected toCan be used to express that two pages are related to one another.The Jungle Book is connected to Rikki-Tikki-Tavi.
Is aCan be used to declare that a page has a specific type.Rudyard Kipling is a journalist.
Is transitiveCan be used to specify whether a relation is transitive or not.Relation is a is transitive: if Rudyard Kipling is a journalist, and journalist is a person, then Rudyard Kipling is a person. This property is not used by the application at the moment.
Has domainCan be used to specify the set of pages a relation can take as first parameter. It is similar to the RDF schema domain property, except that rdfs:domain only accept class names, while the has domain relation can accept any set definition. Relation has head office has domain organization.
Has imageCan be used to specify the set of pages a relation can have as destination. It is similar to the RDF schema range property. The terms domain and image come from the mathematical definition of a relation.Relation has author has image person.
TypeRepresents a type.The page Type has relation is a with itself: a type is a type. Book is a type.


Visual representation of an example set of terms, relations and rings. Rings are circles connecting an origin, a relation and a destination.

Script service

The application includes a script service that can be accessed via $services.graph and which exposes the functions below.

  • void addRing(DocumentReference origin, DocumentReference relation, DocumentReference destination)
  • List<XWikiRelation> getRelations(DocumentReference vertex)
  • List<DocumentReference> getDirectPredecessors(DocumentReference vertex, DocumentReference relation)
  • String getDomain(DocumentReference relation)
  • String getImage(DocumentReference relation)
  • List<XWikiRelation> getRelations()
  • removeRing(DocumentReference origin, DocumentReference relation, DocumentReference destination)
  • List<DocumentReference> search(String text)
  • List<DocumentReference> search(String text, DocumentReference relation)


The application hinges on the XWiki classes below.

XWiki classProperties
  • relation: page
  • relatum: page
  • properties: large string
  • relation: page
  • value: large string
  • properties: large string
  • relation: page
  • value: date
  • properties: large string
  • relation: page
  • value: boolean
  • properties: large string

An additional index field is added automatically by Solr when indexing Ring objects, via a SolrMetadataExtractor component having a higher priority than the default one provided by xwiki-platform. For instance, "The Jungle Book has author Rudyard Kipling" is indexed as follows in Solr:

property.ring.Graph.HasAuthor_string:[Ring.Rudyard Kipling].

In addition, all converse rings are indexed, but only partially at this stage, using the generic relation is connected to, because inverse relations are not handled at this stage, so that we have, for page wiki.Rudyard Kipling the following index entry:

property.ring.Ring.IsConnectedTo_string:[Ring.The Jungle Book].

The implementation consists in particular of the following components:

  • XWikiRing: allows to create terms, relations and rings
  • SolrRingIndexer: manages the index of rings
  • SolrRingTraverser: runs queries across terms, rings and relations


Next steps

  • Ability to add ring scalar values via a form.
  • See if the default EmbeddedSolrInstance can expose a method for accessing an indexed SolrDocument by its id.
  • Support relation transitivity.
  • Associate types with XWiki sheets.
  • Store the graph in a graph database.
  • Create rings using wiki syntax or macros: {{ring relation="wiki.HasAuthor" destination="wiki.Rudyard Kipling"}}The author of this book is Rudyard Kipling.{{/ring}}
  • Handle inverse relations. For example the inverse of relation "has author" is relation "has authored".
  • Display pages in livetables with ability to filter them by their rings.

Application name and related concepts

The application uses concepts which are at the crossroads of linguistics (sentences connecting words), logic (predicates) and mathematics (graphs). The main structure on which it builds on consists of a triple (a,R,b) comprising three terms:

  • a referent: "in logic, the word referent is sometimes used to denote one of the two objects participating in a relation, the other being called the relatum.".
  • a binary relation: "a binary relation over two sets A and B is a set of ordered pairs (a, b) consisting of elements a of A and elements b of B".
  • a relatum.

A tuple (a,R,b) – more commonly noted R(a,b) – has different namings depending on the theoretical or usage context:

  • Atomic formula in logic: "an atomic formula or atom is simply a predicate applied to a tuple of terms; that is, an atomic formula is a formula of the form P (t1 ,…, tn) for P a predicate, and the tn terms.".
  • Statement in the semantic web community: an RDF statement is a triple of resources subject / predicate / object, where the predicate is a binary relation.
  • Hyperedge in graph theory: an hyperedge is an n-uple connecting several vertices together. The terms a, R, b mentioned above can be seen as vertices, and (a,R,b) as an hyperedge, with the specificy that "R" is a relation.

The structure currently used by the application actually involves a fourth term, named "properties", in order to describe the triple (a,R,b) itself: properties are a handy shortcut for adding metadata about a triple, just like what property graphs propose. Properties could actually rather be represented as individual atomic formula (rings) on their own, but this introduces some implementation complexity which might not be necessary at this stage.

So far, the word ring has been chosen to represent the core structure and for naming the application itself, mostly because it has a simple visual representation (however visually the circle should not be closed, since the ring can be navigated only in a given direction), it catches well the semantics of tying several terms together, and it it's easy to imagine a ring connecting several rings. Formally, a ring is just an atomic formula involving 3 terms (a relation and a pair of terms), with some properties. It's probably not a great idea to have chosen a new term but "atomic formula" might sound a bit scary to non logicians and is lacking a visual hint.


Hypergraph and hyperedges - Source: Wikipedia:Hypergraph

The higher-level structure consisting of a set of rings corresponds to an hypergraph, since each edge ties together several terms. It's currently a uniform 4-hypergraph since all edges have four vertices (referent, relation, relatum, properties), even though some are allowed to be empty (e.g. properties). The relatum term can either have an identifier or be a scalar (e.g. a given date or number). Each edge is also a vertex, so that edges can be involved in other edges.

Live examples

  • RueSacalie.paris is a wiki about Paris history. On this site, the relation "is-named-after" allows to refer a street to a person or event it was named after. Exploring the page representing that relation allows to explore for instance the main fields of each person a street was named after: music, philosophy, politics, etc.

Related projects


Design aspects

Graphs and hypergraphs

The data structure of the application is an hypergraph.


Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki


Dependencies for this extension (org.xwiki.contrib:xwiki-ring-pages 1.0):

  • org.xwiki.contrib:xwiki-ring-lib 1.0

Get Connected