Previous topic  Top  Next topic  Print this Topic
 

Terms

 

In ObjectLogic all objects have names. This includes classes and instances, values but also methods. The names of objects are formed by logical terms, known from datalog or prolog. Essentially, there are three types of terms:

1.Constants, like Person, car74 or admissibleDriver

Each constant starts with a letter followed by (uppercase or lowercase) letters, digits or the underscore symbol "_" of the ASCII character set.

2.Functions, like f(X), maximumSpeed(germany, autobahn)

Functions are complex terms that consist of function symbols (which follows the same grammar as the constants above) and a list of one or more terms (enclosed in parenthesis) representing the arguments.

3.Variables, such as ?X or ?Y

Variables follow the same grammar as the constants above. To distinguish constants from variables, the latter are always declared by a leading questionmark. Variables are only used in the context of rules and queries.

Data Types

Constants represent a value of one the following data types: strings, various number types (integer, decimal, double), strings, IRIs, date, time, dateTime, boolean and some more.

String constants are enclosed by "quotation marks" and may contain any legal printable character.
ObjectLogic has five number data types, but normally you only need two of them: integers and double (double precision floating numbers). Integers are e.g. 0,1,17,-17, double numbers are e.g 0.0, 1.0, -2.7, 3.12e-12
IRI constants are symbols with a namespace. IRIs are an internationalized variant of URIs, i.e. they support international characters. IRIs are typically used as identifiers for concepts and instances. ObjectLogic supports multiple syntax variants for this import data type:
Person                This identifier is already an IRI, as ObjectLogic uses the default namespace for it
a#Person                Here the namespace is specified by an prefix alias
<http://mycompany.com/hr#Person>        This is a full qualified IRI
Other data types follow the XML schema specification, e.g.
"2010-06-25"^^_date                        The date June, 25th 2010
"16:37:45"^^_time                        The time 16:37:45
"2010-06-25T16:37:45"^^_date        A dateTime term
true                                                Boolean true value
In addition to the basic terms, ObjectLogic also supports lists, which is described in more detail below.

Following the object-oriented paradigm, objects may be organized in classes. Furthermore, methods represent relationships between objects. This information on objects is expressed by F-atoms (cf. the Statements-section).