PublicShow sourcehdt.pl

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source rdf(?S, ?P, ?O, +G)
True when <S,P,O> is a triple in G. G typically takes the form hdt:Name, searching the HDT file Name.hdt
Source rdf_subject(?S, +G)
True when S is a subject in the graph G.
Source rdf_predicate(?P, +G)
True when P is a predicate in the graph G.
Source rdf_object(?O, +G)
True when O is a object in the graph G.
Source rdf_shared(?IRI, +G)
True when IRI is both a subject and object in the graph G.
Source rdf_suggestions(+Base, +Role, +MaxCount, -List, +Graph)
True when Results is a list of suggestions for Base in the triple role Role. Some experimentation suggests it performs a prefix match on the internal string representation. This implies that literals are only found if the first character of Base is `"`.
Arguments:
Base- is a string or atom
Role- is one of subject, predicate or object
Source rdf_graph_property(-Property, +Graph) is nondet
True when Property is a property of Graph
Source rdf_prefix(:Alias, +URI) is det
Register a local prefix. This declaration takes precedence over globally defined prefixes using rdf_register_prefix/2,3. Module local prefixes are notably required to deal with SWISH, where users need to be able to have independent namespace declarations.
Source rdf_meta(+Heads)
This directive defines the argument types of the named predicates, which will force compile time namespace expansion for these predicates. Heads is a coma-separated list of callable terms. Defined argument properties are:
:
Argument is a goal. The goal is processed using expand_goal/2, recursively applying goal transformation on the argument.
+
The argument is instantiated at entry. Nothing is changed.
-
The argument is not instantiated at entry. Nothing is changed.
?
The argument is unbound or instantiated at entry. Nothing is changed.
@
The argument is not changed.
r
The argument must be a resource. If it is a term prefix:local it is translated.
o
The argument is an object or resource. See rdf_global_object/2.
t
The argument is a term that must be translated. Expansion will translate all occurences of prefix:local appearing anywhere in the term. See rdf_global_term/2.

As it is subject to term_expansion/2, the rdf_meta/1 declaration can only be used as a directive. The directive must be processed before the definition of the predicates as well as before compiling code that uses the rdf meta-predicates. The atom rdf_meta is declared as an operator exported from library(semweb/rdf_db). Files using rdf_meta/1 must explicitely load this library.

Beginning with SWI-Prolog 7.3.17, the low-level RDF interface (rdf/3, rdf_assert/3, etc.) perform runtime expansion of Prefix:Local terms. This eliminates the need for rdf_meta/1 for simple cases. However, runtime expansion comes at a significant overhead and having two representations for IRIs (a plain atom and a term Prefix:Local) implies that simple operations such as comparison of IRIs no longer map to native Prolog operations such as IRI1 == IRI2.