Callimachus expressions can be placed in attributes or between elements (i.e. text nodes). Expression types may be variable, property paths 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>

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:


could become:


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!


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

to avoid the creation of an empty tag.

Property Path Expressions

A CURIE SPARQL property path wrapped in curly brackets will be replaced with the property path object 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|foaf:name}.

  <title resource="?this">{rdfs:label|foaf:name}</title>

More information about the property path syntax can be found in the SPARQL 1.1 Query Language Recommendation.

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>