Links in Hypernotation

In one of the previous posts I discussed the idea of two types of links on the Web: tree links and graph links. The Web can be seen as a collection of trees with hyperlinks connecting random nodes of these trees. These hyperlinks are what cause the trees to become graphs, thus the name “graph” links, while links between the nodes in hierarchy are called “tree links”.

Interesting thing about tree links, compared to hyperlinks, is their ability to encode information. This is possible due to the hierarchical paths that dictate the names of resources (nodes). This information is encoded in the paths (i.e. pathnames) and is based on the difference between the paths of two adjacent nodes, denoting a relation between those nodes.

Typically, they are just human-readable strings denoting relations in a hierarchy. However, in Hypernotation, these strings can also become CURIEs, i.e. shortened URIs that identify any type of relation.

The classification of links in Hypernotation looks as follows:

In the Hypernotation context, an RDF graph is projected onto the Web. In this RDF graph all links (properties or relations) have defined meaning. In Hypernotation, only typed links have the ability to “mean” different things, while hyperlinks and key segments always hold the same meaning.

Hyperlinks, or graph links, are not able to encode any information other than a (implied) direction. Therefore, their meaning is always the same. In the Web of documents, this meaning is vague – a hyperlink to another webpage can be interpreted such that the webpage “points to”, “mentions”, or “finds valuable” another webpage.

In the Hypernotation context, an act of hyperlinking can be also interpreted as “adding the value to the target”, but its meaning is different. Here, a hyperlink has the meaning “is same as”. In Hypernotation, a hyperlink always comes from a special type of a hypernode called hyperreference.

A hyperreference defines the same concept in a new context. In the “Chuck Norris” example used on this blog so far, Bruce Lee (http://brucelee.com/data_/bruce) becomes a person Chuck Norris knows (http://chucknorris.com/data_/chuck/foaf_knows/bruce). This new context requires a new web resource (hypernode), together with a connection (hyperlink) from that hypernode to the original one. This hyperlink would be written as follows:

<a href="http://brucelee.com/data_/bruce">Bruce Lee</a>

The new hypernode is identified by a URI which pathname contains the information about the new context of the concept. http://chucknorris.com/data_/chuck/foaf_knows/bruce defines Bruce as an acquaintance of Chuck. This path can be decomposed into the following triples:

<http://chucknorris.com>
    data: <http://chucknorris.com/data_/chuck> .

          <http://chucknorris.com/data_/chuck>
              foaf:knows <http://chucknorris.com/data_/chuck/foaf_knows/bruce> .

                         <http://chucknorris.com/data_/chuck/foaf_knows/bruce>
                             owl:sameAs <http://brucelee.com/data_/bruce> .

In Hypernotation there are two subtypes of tree links: typed links and key segments.

A typed link is a link that, in addition to having a direction, represents a particular relation between two resources. In Hypernotation, the subject and object of a triple are nodes in a tree identified by URIs. These URIs have the form of paths. The object (child) URI is created by adding a new path segment to the subject (parent) URI. The path segment, i.e. the difference between the two paths, encodes the type of the link.

subjectURI + segment = subjectURI/segment = objectURI

Here, the segment encodes the CURIE/shortened form of the URI identifying the relation. The CURIE is the segment of the another URI, meaning that multiple URIs can be combined in a new, “compound”, URI. This ability to use multiple URIs in a single “main” URI is one of the key features Hypernotation brings to the table.

Typed links are those “inner” URIs, encoded as CURIEs (prefix:name), whose prefix is defined on website.com/prefix_. For instance, the subject node http://chucknorris.com/data_/chuck is described with a triple where the predicate is foaf:name and the object is http://chucknorris.com/data_/chuck/foaf_name.

<http://chucknorris.com/data_/chuck>
    foaf:name <http://chucknorris.com/data_/chuck/foaf_name> .

The difference between the subject and object URI is the segment in bold foaf_name. It’s the CURIE (foaf:name) that has its prefix defined on the http://chucknorris.com/prefix_/foaf hyperreference. http://chucknorris.com/prefix_/foaf returns the hyperlink pointing to the http://xmlns.com/foaf/0.1/ namespace, enabling that the property URI can be obtained by a HTTP GET request.

A typed link is realized with <a> element on the subject hypernode. Therefore, when HTTP request is sent to http://chucknorris.com/data_/chuck, this typed link will be one of the typed links returned in the list.

<ul>
    <li><a href="foaf_name">name</a></li>
    ....
</ul>

The typed link contains not only information about the direction to a resource, but also information about the type of the relation, identified by URI. However, the value and the name of a typed link need not to be the same. For example, take this triple:

<http://chucknorris.com/data_/chuck>
        foaf:knows <http://chucknorris.com/data_/chuck/foaf_knows/steven> .

The difference between the subject and the object written as a relative path looks as follows:

<a href = "foaf_knows/steven">

In this case, we have two segments: the typed link “foaf_knows” and the key segment “steven”. Here, the type of the link “foaf_knows” is obtained after removing the key segment “steven” and differs from the value of the link, i.e. the relative link “foaf_knows/steven”.

Relative path has been used to help understand the idea of typed links. Of course, the path can also be absolute:

<a href="http://chucknorris.com/data_/chuck/foaf_knows/steven">

… instead of relative

<a href="foaf_knows/steven">

In this case, the value of the “href” attribute is no different from the URI of the object in the RDF triple. What’s important is the difference between the two URIs. Thus, a typed link can never be an external one, i.e. directed to a Web resource in a different domain (web site).

A typed link is defined by several constraints:

  • A typed link connects two hypernodes on the same web site, where the first node is the subject, and the second is the object of an RDF triple.
  • The URI of the subject is contained in the URI of the object. The type of a typed link equals the difference of the two hypernodes it connects, minus the optional key segment.
  • Its type is in the form of CURIE – an shortened URI using the “_” as delimiter (prefix_name).
  • A namespace to which “prefix1″ points in “prefix1_name” must be defined on the path “website.com/prefix_/prefix1″.

Thanks to typed links, the URI of a hypernode contains not just a random identifier, but adds a whole another dimension. A hypernode’s URI path tells us what the hypernode means, in terms of its relations to another hypernodes.

Key segments

In the previous example, we touched on the idea of key segments. Key segments are also tree links, but they doesn’t encode the type of a relation. A key segment does not encode a CURIE, but a local ID, or the key in the context (namespace) defined by a typed link.

Key segments are used with the multi-valued properties. For instance, foaf:knows can have many values – people that a person knows. http://chucknorris.com/data_/chuck/foaf_knows is a type of hypernode called hyperarray that cointins items that must be differentiated by indexes, or keys (a number or a string).

A hyperarray represents a class, which is a subclass of the property’s range, while the relation (key segment) between a hyperarray and its items, hypernodes which URIs end with key segments, like hyperlinks, always have the same meaning – “has an instance”. http://chucknorris.com/data_/chuck/foaf_knows is, therefore, a class representing “a person Chuck Norris knows” and it is a subclass of foaf:Person, which is the range of the property foaf:knows.

http://chucknorris.com/data_/chuck/foaf_knows/bruce and http://chucknorris.com/data_/chuck/foaf_knows/steven are the instances of this class, representing concrete people.

"bruce and steven are foaf:Person chuck foaf:knows".

Here the key segments are in bold. The elements of a hyperarray can be hyperreferences or hyperobjects. In this case, bruce and
steven are hyperreferences, while chuck is a hyperobject and an item of the http://chucknorris.com/data_ hyperarray.

Every path can be expressed using just typed links and key segments. You can think of them as of verbs and nouns. They can be combined in different ways to form “sentences”. In a human language, a sentence can usually be decomposed into a number of smaller, simpler sentences. The same holds true in Hypernotation–the URI of a hypernode is a “sentence” that can be broken into a number of smaller sentences–triples, that cannot be decomposed further.

The rules of decomposing URIs are simple–the number of triples in a URI equals the number of typed links (CURIE segments). If a key segment comes after the CURIE segment, the URI of the object is the URI of the subject + “CURIE/key”. If two CURIE segments are concatenated, the object doesn’t contain the key segment, and a CURIE segment is just added to the subject’s URI.


  • http://milicicvuk.com/blog/2011/12/22/turning-the-web-into-a-programming-language-with-hypernotation/ Turning the Web into a programming language with Hypernotation

    [...] These keys (segments) represent different types of tree links–typed links and key links. In the previous post I described this in more [...]

  • http://milicicvuk.com/blog/2012/01/14/hypernotation-classification-of-hypernodes/ Hypernotation: Classification of hyperNodes

    [...] hyperArray returns a list of key segments, tree links to the child hyperNodes realized using HTML <ul> and <a> tags. While a [...]

  • http://milicicvuk.com/blog/2012/01/23/an-example-of-hypernotation/ An example of Hypernotation

    [...] links directed from both hyperObjects and hyperArrays are called tree links, meaning that they always connect parent nodes with their direct children in a hierarchy. However, [...]