Dorian Taylor
January 14, 2020
August 11, 2020
Namespace URI
Preferred Namespace Prefix

This document specifies a candidate successor to the Fresnel vocabulary, that takes into account developments in RDFa, JSON-LD, SPARQL 1.1 and SHACL. In keeping with the theme of French names involving lenses, this candidate is called Loupe, which is a kind of (and indeed the generic French word for) magnifiying glass.

History & Rationale

In 2004, a group of researchers devised the Fresnel display vocabulary. It remained largely in academic circles and was not widely implemented. In the intervening decade and a half, moreover, there have been multiple advancements in the display (RDFa, JSON-LD) and selection (SPARQL 1.1, SHACL) of RDF graphs. This vocabulary is an attempt to revisit the problem while taking these developments into account.

The fundamental problem of displaying RDF is that a document, at least for our purposes, is an ordered tree of content, whereas RDF has no orientation to speak of, leaving many questions about how to display it unanswered. In order to render an RDF subject as a document, we need a number of instructions for computing a definite sequence of properties and their values, which properties and values to show and which to hide, and recursively descending (along with directives on when to hit the brakes), and at least roughly, how everything ought to be formatted.

The goal of Loupe, like Fresnel, is to define a language for specifying the parameters of a node-centric display of an RDF graph, and generating an abstract document tree which can be made more concrete in formats like (X)HTML+RDFa or JSON-LD. One requirement of Loupe is that the abstract document tree preserves the embedded graph structure, enabling said structure to be transmitted to final concrete data format intact. Loupe carries forward the lens/format design of Fresnel, and reuses as much of SHACL as is reasonable to do.

Matching Nodes & Enumerating Properties

Both Fresnel and Loupe begin with the assumption that what you have is a set of RDF statements radiating off a given subject, and what you want are clear, consistent, and unambiguous instructions for how to render those statements as a document.

Fresnel has entities called Lenses that get selected through their binding to an RDF class or instance URI. Lenses say which properties to show and in what order. Fresnel also has property descriptions that attach additional behaviour to property selections. This functionality can be readily handled by SHACL node and property shapes, with only minor extensions.

@prefix rdf:   <> .
@prefix rdfs:  <> .
@prefix owl:   <> .
@prefix xsd:   <> .
@prefix sh:    <> .

@prefix loupe: <> .
@prefix foaf:  <> .

ex:person a loupe:Lens;
  sh:targetClass foaf:Person ;
  loupe:show ( ex:name ex:avatar ex:email ) ;
  sh:property ex:name, ex:avatar, ex:email .

ex:given-name a sh:PropertyShape ;
  sh:path [ sh:alternativePath (
    foaf:givenName foaf:firstName foaf:givenname ) ] .

ex:family-name a sh:PropertyShape ;
  sh:path [ sh:alternativePath (
    foaf:familyName foaf:lastName foaf:family_name foaf:surname ) ] .

ex:name a loupe:IDUNNO ;
  sh:path [ sh:alternativePath (
    foaf:name [ loupe:merge ( ex:given-name ex:family-name ) ] ) ] .


The basic element of Loupe, a specific kind of SHACL node shape.

Subclass of:

Back to Top

Sorting Properties & Values

in the absence of a specific enumeration,

Label & Description Shapes

When a node is the subject of the resulting document or section thereof, or the target of a link, it will almost always need a label. Exactly one label needs to be definitively and consistently chosen from a set of literal values associated with a set of properties (or rather, property paths).