As we have seen, the Metalog language can express sentences of various forms. The way Metalog understands sentences is given by the keywords, that are special reserved words, with a particular meaning understood by Metalog. So far, we have seen various keywords into action (for instance, "from", "and", "then". What follows is a complete list of all the Metalog keywords, with a very brief explanation and example for each of them.
Keyword | Description |
---|---|
and | Either a logical and (conjunction), or the presence of an ordered or
unordered collection (technically, an RDF container Bag or Seq)
Example: JOHN and MARY ARE "tall". |
or | Either a logical or (disjunction), or the presence of a list of alternatives
(technically, an RDF container Alt)
Example: if either JOHN or MARY IS "rich" then their SON IS likely to be "rich" too. |
then imply implies |
The logical implication.
Example: if JOHN IS "tall" then MARY IS "tall". |
comment | A comment follows, to be ignored.
Example: comment: this is the list of employees. |
represents | Creates a representation (abbreviation/annotation).
Example: JOHN represents "John_Smith". |
from | Builds names in context (technically, URI-References).
Example: "John" from "http://people.example.net" IS "tall". |
not | The logical negation.
Example: JOHN IS not
"tall". |
import | Imports other Metalog code from the specified address.
|
order | Combined with an "and" keyword, indicates the presence of an ordered
sequence (technically, an RDF Seq container).
|
add plus |
Addition (+) of numbers.
Example: JOHN HAS "2274" plus "752" dollars in his bank account. |
sub minus |
Subtraction (-) of numbers.
Example: JOHN HAS "2274" plus "752" dollars in his bank account. |
times mult |
Multiplication (*) of numbers.
Example: JOHN HAS "2274" times "3" dollars in his bank account. |
div divided |
Division (/) of numbers.
Example: JOHN HAS "2274" divided "2" dollars in his bank account. |
greater | The "greater than" test (>) for numbers.
Example: "50000" is way greater than "200". |
less | The "less than" test (<) for numbers.
Example: "200" is way less than "50000". |
different | The inequality test for numbers.
Example: "201" is different than "200". |
equal equals |
The equality test for numbers. If used in conjunction with the "greater" keyword, it indicates the "greater or equal than" (>=) test for numbers. Analogously, if used in conjunction with the "less" keyword, it indicates the "less or equal than" (<=) test for numbers.
Example: AGE equals 46. |
An important thing to remember is that any word which is not a Metalog keyword, or a variable, is discarded by Metalog. Or, better, every word that is in lower case. So, you can use such extra words at your will, to make sentences as readable as you can. As an example, consider again the two representations
JOHN represents the person "John Smith" from the company "http://www.example.com/staff".
IS represents the verb "is" from the collection "http://www.relationships.com/verbs".
A perfectly equivalent way of writing the above assertions could have been the essential
JOHN represents "John Smith" from "http://www.example.com/staff".
IS represents "is" from "http://www.relationships.com/verbs".
although, the first two representations are quite more readable.