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.
Sourceturtle_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.
Sourcerdf_link(+URI)// is det
Sourcerdf_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>
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.

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.
Sourceresource_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.
Sourcerdf_link(+URI)// is det
Sourcerdf_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>
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.

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.