FORUM F-logic Data Types


    

Primitive data types are represented by constants of special form: _datatypeName"literal". The underscore _ and the quotes are part of the syntax. datatypeName is the name of the data type and literal is the value-part of the constant. The data type names and their attributes are listed below. The supported data types closely correspond to XML Schema data types.

Note that the form of the data type constants makes no assumption about the actual internal representation of these constants. A variety of options is possible. The compiler can translate such constants to function terms or to external calls to Java or C programs. For instance, a constant of the time data type such as "12:33:44"^^_time can be compiled into a term like $#%&time(12,33,44) or into $#%&time(12,33,44,45224) (45224 is the number of seconds in the time literal and can be used for comparison with other literals) or into Time#@!([49,50,51,51,52,52]) (here the numbers in the list are the ASCII codes of the digits in the date).

We also define syntax for variables that can be bound only to constants of the corresponding data types. The syntax is ?variableName^^datatypeName, where ^^ and ? are part of the syntax, while datatypeName is the name of a data type. For instance, ?Y^^_time.

Some data types, like time, dateTime, etc., are exact analogues of the corresponding XML Schema types. In this case, their names will be denoted using strings that have the form of a IRI. For instance, 'http://www.w3.org/2001/XMLSchema#time'. However, for convenience, all type names will have one or more F-logic specific abbreviated forms, such as _time or _t. These abbreviated forms are case-insensitive. So, _time and _TiMe are assumed to be equivalent. In addition, when the type names have the form of an IRI, the compact prefix representation is supported. For instance, if xsd is a prefix name for 'http://www.w3.org/2001/XMLSchema#' then "12:33:55"^^'http://www.w3.org/2001/XMLSchema#time' can be written as "12:33:55"^^xsd#time'.

The methods that are applicable to each particular primitive type vary from type to type. However, certain methods are more or less common:

We now list the supported data types.

  • _dateTime
  • Explanation: XML Schema dateTime type.
    Normal form:


    Class: _dateTime
    Synonyms: _dt, 'http://www.w3.org/2001/XMLSchema#dateTime'.

    Class methods:

    Component methods:

    Other methods:

    Examples:

  • _date
  • Explanation: XML Schema date type.
    Normal form:


    Class: _date
    Synonyms: _d, 'http://www.w3.org/2001/XMLSchema#date'.

    Class methods:

    Component methods:

    Other methods:

    Examples:

  • _time
  • Explanation: XML Schema time data type
    Normal form:


    Synonyms: _t, 'http://www.w3.org/2001/XMLSchema#time'.
    Class: _time

    Class methods:

    Component methods:

    Other methods:

    Examples:

  • _duration
  • Explanation: XML Schema duration type
    Normal form:


    Class: _duration

    Synonyms: 'http://www.w3.org/2001/XMLSchema#duration'

    Class methods:

    Component methods:

    Other methods:

    Examples:

  • _boolean
  • Explanation: XML Schema Boolean type
    Normal form:

    Synonyms: 'http://www.w3.org/2001/XMLSchema#boolean'
    Class: _boolean

    Class methods:

    Other methods:

    Examples:

  • _double
  • Explanation: XML Schema double type
    Normal form:

    Synonyms: Class: _double

    Class methods:

    Other methods:

    Examples:

  • _decimal
  • Explanation: XML Schema decimal type (arbitrary precision)
    Normal form:

    Synonyms: Class: _decimal

    Class methods:

    Other methods:

    Examples:

  • _integer
  • Explanation: XML Schema integers (arbitrary length)
    Normal form:

    Synonyms: Class: _integer

    Class methods:

    Other methods:

    Examples:

  • _long
  • Explanation: XML Schema long integers
    Normal form:

    Synonyms: Class: _long

    Class methods:

    Other methods:

    Examples:

  • _iri
  • Explanation: IRI as defined by [RFC 2396], as amended by [RFC 2732]
    Normal form:

    Synonyms:
    Class: _iri

    Class methods:

    Component methods:

    Other methods:

    Examples:

  • _string
  • Explanation: XML Schema string type

    Synonyms: http://www.w3.org/2001/XMLSchema#string

    Normal form:

    Class: _string

    Class methods:

    Other methods:

    Examples:

  • _text
  • Explanation: XML Schema string type with additional language tag. Note: this data type is currently under discussion at W3C, so the specifics might change.

    Synonyms: http://www.w3.org/2007/rif#text

    Normal form:

    Class: _text

    Class methods: See _string

    Other methods:

    Examples:
  • _list
  • Explanation: The Prolog type of list.
    Normal form:

    Class: _list

    Class methods:

    Other methods:

    Examples:

  • _XMLLiteral
  • Explanation: XMLLiteral type of RDF.

    Synonyms: http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral

    Normal form:

    Class: _XMLLiteral

    Class methods: See _string

    Other methods:

    Examples:
    
    
        

    $Date: 2008/05/29 11:12:11 $