label.pl -- Support for showing labels
This module provides HTML components to display labels for resources.
- turtle_label(+RDFTerm)// is det
- HTML rule to emit an RDF term (resource or object) in turtle-like notation with CSS classes.
- bnode_label(+Resource, +Options)// is semidet[private]
- Display an HTML label for an RDF blank node. This DCG rules
first calls the hook cliopatria:bnode_label//1. On failure
performs its default task:
- If the bnode has an rdf:value, display the label thereof with [<label>...]
- If the bnode is an RDF collection, display its first 5 members as (<member-1>, <member-2, ...)
- rdf_link(+URI)// is det
- rdf_link(+URI, +Options)// is det
- Make a hyper-link to an arbitrary RDF resource or object using
the label. Options processed:
- resource_format(+Format)
- Determines peference for displaying resources. Values are:
- plain
- Display full resource a plain text
- label
- Try to display a resource using its label
- nslabel
- Try to display a resource as <prefix>:<Label>
- turtle
- Try to display as Turtle <prefix>:<local>
- max_length(+Len)
- Truncate long texts to Len characters, using ellipses to indicate that the text is truncated.
- target(+Target)
- Passed to the HTML <a> element as
target
attribute. - role(+Role)
- Passed to display_link/2 hook as option. Can be used to differentiate display of URI depending on role as subject, predicate, object, bnode, domain, or range.
This predicate creates two types of links. Resources are linked to the handler implementing
list_resource
using r=<resource> and literals that appear multiple times are linked tolist_triples_with_object
using a Prolog representation of the literal.This predicate can be hooked using display_link//2.
- resource_link(+URI, -URL) is det
- Generate a link to display more information about a resource.
The default is to link to the HTTP handler implementing
list_resource
using the parameterr
. See cpa_browse:list_resource/1. This predicate calls the hook resource_link/2, which allows for overruling the default.
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.