PublicShow sourcerdf_label.pl -- Generate labels for RDF objects

This library deals with a common problem in RDF applications: show labels for resources and display literals. There is no clear-cut answer to this problem because there are too many options. Think of e.g., language preferences, producing summaries, desired rdfs/owl/... reasoning. Therefore, this library provides the required APIs a default implementation and hooks that allow for dealing with the above mentioned issues.

Source label_property(?Property) is nondet[multifile]
True if Property is used to represent labels. The default definition defines SKOS (prefLabel, altLabel, DC (title) and rdfs:label. This predicate is defined as multifile.
Source rdf_label(+R, -Label:literal) is nondet
Label is a label for R. This predicate first calls the hook label_hook/2. If this hook fails it produces all property-values for the properties defined by label_property/1 that have a literal value.
Source rdf_display_label(+R, -Label:atom) is det
Provide a label for R in the user's default language. This is the same as rdf_display_label(R, _, Label).
See also
- user_preference/2
Source rdf_display_label(+R, ?Lang, -Label:atom) is det
Label is the preferred label to display the resource R in the language Lang. As a last resort, this predicates creates a label from the URI R. In that case, Lang is unified with url.
Source literal_text(+Object, -Text:atom) is semidet
Text is the textual content of Object. Fails if Object is not an RDF literal (term literal(Value)). If Object is an XMLLiteral, Text is unified with the XML-text.
Errors
- instantiation_error if Object is not ground
Source truncate_atom(+Atom, +MaxLen, -Truncated) is det
If Atom is longer than MaxLen, truncate it. If MaxLen is inf, Truncated is unified with Atom.