packages-semweb
packages-semweb copied to clipboard
Improve/clarify documentation of rdf_global_id/2
The following documentation seems outdated:
rdf_global_id(?Id, :GlobalId) is det.
Convert between NS:Local and global atomic identifier. To be completed.
Note that the predicate is a meta-predicate on the output argument. This
is necessary to get the module context while the first argument may be of
the form (:)/2.
The use of : seems to be no longer used in module rdf11. At the same time, : implies +, but rdf_global_id/2 can certainly be used with uninstantiated second argument (that is its most common use). I also suggest to rename NS to Alias and GlobalId to Iri.
In addition, [1] throws a type error, but [2] fails silently. IMO the predicate should always throw a type error in case the second argument is nonvar and not an atom.
[1] rdf_global_id(rdf:a, 1^^xsd:int).
[2] rdf_global_id(rdf:Y, 1^^xsd:int).