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 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 we deal with structured (semantic) data. In such context, these relations are made explicit and “meaningful” by using URIs instead of random strings.
The difference between the Web of data and the Web of documents is that in the Web of data there are no more “blank” links, every link (relation) has a meaning, i.e. a type. Hypernotation builds on this idea of two types of links on the Web, and develops it further. It adds a meaning to these links and divides tree links into two subcategories: typed links and key segments.
The classification of links in Hypernotation looks as follows:
In the Hypernotation context, an RDF graph is projected on the Web, so you can think of the Web of data as a graph “living” on the Web. In the RDF graph all links (properties or relations) are typed, and in Hypernotation all links are typed as well. However, out of three types of links (hyperlinks, typed links and key segments), only typed links have the ability to encode different types, i.e., to mean different things. Hyperlinks and key segments always hold the same meaning.
Hyperlinks
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 is always the “value” of a special type of a hypernode called hyperreference. It is its only value, because a hyperreference is, well, a reference to exactly one hypernode. A hyperreference represents the same concept as the hypernode it refers to.
A hyperreference is a new hypernode representing 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 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 representing the same concept in the new context is identified by a URI – a path that contains the information about that context. http://chucknorris.com/data_/chuck/foaf_knows/bruce says all the story: there is a chuck defined on chucknorris.com that knows bruce that is actually bruce defined on another domain brucelee.com. Or, as decomposed to 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> .
<http://brucelee.com>
data: <http://brucelee.com/data_/bruce> .
Tree links
As discussed above, in Hypernotation there are two subtypes of tree links: typed links and key segments.
Typed links
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, so the type of a link is encoded as the difference between these paths.
subjectURI + segment = subjectURI/segment = objectURI
In other words, if there is a link pointed from the subject resource to the object resource, the relative path of the link is the difference between the source and target URIs. In Hypernotation this difference is also identified by a URI, written in the CURIE form. Because this URI is a segment of the other URI, this means that multiple URIs can be combined in a new, “complex”, URI.
One of the key features Hypernotation brings to the table is ability to use multiple URIs in a single “main” URI. Typed links are those “inner” URIs. They are encoded as CURIEs (prefix:name), whose prefix is defined on the standard hypernode proposed by Hypernotation 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 bold segment 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, so the property URI can be obtained by a simple HTTP GET.
A typed link is a segment which is obtained as the difference between these two URIs and is encoded 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 resource it is directed to (direction), but also information about its type, 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 the information about the unique name, but 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 is not a URI, but a string. It provides a local ID, or a 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. Like every array, it contains elements, and these elements must be differentiated by indexes, or keys. In Hypernotation both numbers and strings can be used, depending on the situation.
A hyperarray represents a class, which is a subclass of the property’s range, while the relation (key segment) between a hyperarray and its elements, 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 concrete people, i.e. instances of this class.
"bruce and steven are foaf:Person chuck foaf:knows".
Here the key segments are bold. Elements of hyperarray can be hyperreferences or hyperobjects. In this case, bruce and
steven are hyperreferences, while chuck is a hyperobject and an element of http://chucknorris.com/data_ hyperarray. Again, the hyperarray is a class with meaning “something defined on chucknorris.com domain”, while http://chucknorris.com/data_/chuck is an instance.
Typed links (CURIE segments) and key segments are the only two types of links (segments) needed to build a path. It’s a universal principle–every path can be expressed using just these two building elements. 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 complex sentence can be decomposed into a number of smaller, simpler sentences. The same holds true in Hypernotation–the URI of a hypernode is a “complex sentence” that can be broken into a number of smaller sentences–triples, that cannot be decomposed further.
The rules of decomposing URIs are quite simple–the number of triples in a URI equals the number of 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.
- next post: Bringing together the RDF and OO models in the Semantic Web »
- « previous post: Introducing Hypernotation, an alternative to Linked Data
