3.1.3 RDF literals
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog Semantic Web Library 3.0
        • Two RDF APIs
          • library(semweb/rdf11): The RDF database
            • RDF literals
              • rdf_canonical_literal/2
              • rdf_lexical_form/2
              • rdf_compare/3
Availability::- use_module(library(semweb/rdf11)).
Source[det]rdf_compare(-Diff, +Left, +Right)
True if the RDF terms Left and Right are ordered according to the comparison operator Diff. The ordering is defines as:

  • Literal < BNode < IRI
  • For literals

    • Numeric < non-numeric
    • Numeric literals are ordered by value. If both are equal, floats are ordered before integers.
    • Other data types are ordered lexicographically.

  • BNodes and IRIs are ordered lexicographically.

Note that this ordering is a complete ordering of RDF terms that is consistent with the partial ordering defined by SPARQL.

Diff is one of <, = or >