Callimachus expressions can be placed in attributes or between elements (i.e. text nodes). Expression types may be variable, property or literal, as described below.

Variable Expressions

A variable wrapped in curly brackets will either be replaced with the bound variable value or removed. In the example below, the bound value to the variable ?this is substituted for {?this}.

Properties that are not present in the RDF store will result in an empty string in the resulting HTML page.  Thus, use of the curly bracket syntax may result in empty tags or attributes.  For example, this is always expected to succeed since the ?this variable should always exist:

<body resource="?this">
  <p>The URI of this resource is {?this}.</p>
</body>

However, the use of a property in tag contents or some tag attributes (such @src) might result in an empty tag when the property is not present in the RDF store.  So:


<h1>{rdfs:label}</h1>

could become:


<h1></h1>

in the generated HTML if the property rdfs:label does not exist in the RDF store.  The possibility of empty tags could become significant, as with image tags when a property is used in the src attribute because some browsers (e.g. Firefox version 29) will display an empty image tag as a broken image.  Therefore, one might prefer to replace the use of curly brackets:


<img src="{foaf:depiction}" />  # An anti-pattern.  Do not use!

with:


<img rel="foaf:depiction" src="?depiction" />

to avoid the creation of an empty tag.

Property Expressions

A CURIE wrapped in curly brackets will be replaced with the property value from the RDF store for the current subject. In the example below the expression has the subject of ?this and a predicate of rdfs:label. The object of matching triples from the RDF store will be substituted for the expression {rdfs:label}.

<head>
  <title resource="?this">{rdfs:label}</title>
</head>

Literal Expressions

Quoted strings wrapped in curly brackets will be replaced with the literal string within.

This code:

<p>The expression {'{rdfs:label}'} is often used to refer to resources.</p>

Would produce:

<p>The expression {rdfs:label} is often used to refer to resources.</p>