Did you know ... Search Documentation:
Pack hdt -- prolog/hdt.pl
PublicShow source
 hdt_open(-HDT, +File) is det
 hdt_open(-HDT, +File, +Options) is det
Open an existing HDT file and unify HDT with a handle to it. The handle is an opaque symbol that is subject to (atom) garbage collection. Options:
How the file is accessed. On of map (map the file into memory, default) or load (load the content of the file).
Whether an index is created. Default is true. Such an index is needed for partially instantiated calls to hdt_search/4. The index is maintained in a file with extension `.index` in the same directory as the HDT file. An index is not needed if you only want to extract all triples.
 hdt_search(+HDT, ?S, ?P, ?O)
True if <S,P,O> is a triple in HDT.
 hdt_header(+HDT, ?S, ?P, ?O)
True if <S,P,O> is a triple in the header of HDT.
 hdt_subject(+HDT, ?S) is nondet
 hdt_predicate(+HDT, ?P) is nondet
 hdt_object(+HDT, ?O) is nondet
 hdt_shared(+HDT, ?SO) is nondet
 hdt_node(+HDT, ?Node) is nondet
Enumerate possible values for the individual components of the triples represented in the HDT. Note that these enumarators do not enumerate blank nodes. The predicate hdt_shared/2 enumerates resources that exist in the dataset both as subject and object. If the second argument is instantiated hdt_search/4 is used to perform an indexed search and the predicates are semidet.
 hdt_suggestions(+HDT, +Base, +Role, +MaxResults, -Results:list) is det
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 `"`.
Base- is a string or atom
Role- is one of subject, predicate or object
 hdt_property(+HDT, ?Property) is nondet
True if Property is a property of HTD. Defined properties are
  • mapping(-Mapping)
  • max_id(-ID))
  • max_object_id(-ID))
  • max_predicate_id(-ID))
  • max_subject_id(-ID))
  • objects(-Count))
  • predicates(-Count))
  • shared(-Count))
  • subjects(-Count))
  • elements(-Count))
 hdt_subject_id(+HDT, ?Subject:atom, ?Id:integer) is semidet
 hdt_predicate_id(+HDT, ?Predicate:atom, ?Id:integer) is semidet
 hdt_object_id(+HDT, ?Object:any, ?Id:integer) is semidet
True if String is mapped to Id in the given role. Fails if the requested String or Id is not known for the given role in HDT.
Role- is one of subject, predicate or object
 hdt_pre_triple(+HDT, ?TripleIn, -TripleID) is det
 hdt_post_triple(+HDT, ?TripleIn, +TripleID) is det
Perform term->id and id->term translation for triples. The predicate hdt_search/4 could be defined as:
hdt_search(HDT, S, P, O) :-
    Triple   = t(S,P,O),
    TripleID = t(SID,PID,OID),
    hdt_pre_triple(HDT, Triple, TripleID),
    hdt_post_triple(HDT, Triple, TripleID).
See also
- hdt_search_id/4.
 hdt_search_id(+HDT, ?S:integer, ?P:integer, ?O:integer) is nondet
True if a triple with the indicated identifiers exists.
 hdt_search_cost(HDT, ?S, ?P, ?O, -Cost:nonneg) is det
 hdt_create_from_file(+HDTFile, +RDFFile, +Options)
Create a HDT file from an RDF file. RDFFile must be in ntriples format. Options:
URI is used for generating the header properties (see http_header/4.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 hdt_open(Arg1, Arg2, Arg3)
 hdt_predicate(Arg1, Arg2)
 hdt_shared(Arg1, Arg2)
 hdt_object(Arg1, Arg2)
 hdt_node(Arg1, Arg2)
 hdt_predicate_id(Arg1, Arg2, Arg3)
 hdt_object_id(Arg1, Arg2, Arg3)
 hdt_post_triple(Arg1, Arg2, Arg3)