Skip to content
Wouter Beek edited this page Dec 30, 2015 · 1 revision

1 API for enumerating existing terms

Observations:

  • rdf_resource/1 does not enumerate all resource-denoting terms. It enumerates the terms that are blank nodes or IRIs and that appear in the subject or object position of some triple.
  • Enumeration based on positional occurrence (rdf_subject/1 and rdf_current_predicate/1) is missing object and node support.
  • Enumeration based on kind (rdf_current_literal/1) is missing support for blank nodes, IRIs and names.

Proposal:

  • Remove rdf_resource/1.
  • Enumerate terms:
    • Add rdf_term/1, uniquely enumerating the current RDF terms.
  • Enumerate terms based on their positional occurrence:
    • Keep rdf_subject/1 as-is.
    • Rename rdf_current_predicate/1rdf_predicate/1.
    • Add rdf_object/1 to complement rdf_subject/1 and rdf_predicate/1.
    • Add rdf_node/1, uniquely enumerating terms that occur in either the subject or object position.
  • Enumerate terms based on their kind:
    • Rename rdf_current_literal/1rdf_literal/1.
    • Add rdf_bnode/1, uniquely enumerating terms that are blank nodes.
    • Add rdf_iri/1, uniquely enumerating terms that are neither blank node nor literal.
    • Add rdf_name/1, uniquely enumerating terms that are either IRI or literal.

2 API for creating new terms

Observations:

  • Blank nodes and nodes are different concepts in RDF 1.1.

Proposal:

  • Rename rdf_bnode/1rdf_create_bnode/1.
  • Replace rdf_node/1 by the predicate described in section 2.1.

3 API for checking a term's kind

Observations:

  • Kind checking (rdf_is_bnode/1 and rdf_is_literal/1) is missing support for IRIs.
  • rdf_is_resource/1 does not succeed for all resource-denoting terms.

Proposal:

  • Keep rdf_is_bnode/1 as-is.
  • Keep rdf_is_literal/1 as-is.
  • Rename rdf_is_resource/1rdf_is_iri/1.
  • Change rdf_is_resource/1/rdf_is_iri/1 to not succeed for non-IRIs.

4 Relocate non-RDF predicates

Proposal:

  • Rename and relocate rdf_md5/2. Mention in the documentation that this should not be used for security purposes (but there are many other applications where is can be useful).