PublicShow sourcelabel.pl -- Support for showing labels

This module provides HTML components to display labels for resources.

See also
- library(semweb/rdf_label) returns textual labels.
Source turtle_label(+RDFTerm)// is det
HTML rule to emit an RDF term (resource or object) in turtle-like notation with CSS classes.
To be done
- Implement possibility for a summary.
Source rdf_link(+URI)// is det
Source 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 to list_triples_with_object using a Prolog representation of the literal.

This predicate can be hooked using display_link//2.

To be done
- Make it easier to determine the format of the label
- Allow linking to different handlers.
Source 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 parameter r. 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.

Source rdf_link(Arg1, Arg2, Arg3, Arg4)