• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

3.1.3 RDF literals
All Application Manual Name SummaryHelp

  • 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_canonical_literal(++In, -Literal)
Transform a relaxed literal specification as allowed for rdf_assert/3 into its canonical form. The following Prolog terms are translated:
Prolog Term Datatype IRI
floatxsd:double
integerxsd:integer
stringxsd:string
true or false xsd:boolean
date(Y,M,D) xsd:date
date_time(Y,M,D,HH,MM,SS) xsd:dateTime
date_time(Y,M,D,HH,MM,SS,TZ) xsd:dateTime
month_day(M,D) xsd:gMonthDay
year_month(Y,M) xsd:gYearMonth
time(HH,MM,SS) xsd:time

For example:

?- rdf_canonical_literal(42, X).
X = 42^^'http://www.w3.org/2001/XMLSchema#integer'.
ClioPatria (version V3.1.1-51-ga0b30a5)