Язык кодирования знаний KNOW

Язык кодирования знаний KNOW- Часть 1

Язык кодирования знаний KNOW Язык кодирования знаний KNOW Язык кодирования знаний KNOW Язык кодирования знаний KNOW Язык кодирования знаний KNOW Язык кодирования знаний KNOW Язык кодирования знаний KNOW Язык кодирования знаний KNOW

Нетрудно показать, что это язык кодирования знаний в форме семантических сетей. Операторы этого языка задают отношения между объектами - в чем и заключается основная идея семантических сетей.


Design Document

The Knowledge Representation Language of Webmind

[What is new in this version: math and logical relations, variables, and operators.]

Здесь и везде - WebMind - название интеллектуальной базы знаний, а в основном даже мощного когнитивного процессора - в перспективе обладающей собственным сознанием. Проект развития WebMind еще продолжается.

1. Introduction

It is a knowledge representation language, mainly for its communication with the other (human or computer) systems. In this document, such a language, KNOW (Knowledge Norm Of Webmind), is defined.
The following are some possible use cases of KNOW: Belief Editor, which allows a user to directly input knowledge - import, by which existing knowledge bases are imported into WebMind. This is happening in knowledge encoding in which the final result should be represented in this language Knowledge export, by which Webmind sends its domain knowledge to other (non-Webmind) systems. A means of interaction with Webmind through the Webmind Communicator (this depends on the ongoing design and development of the KNOWese grammar)

To serve these purposes, KNOW should be designed to keep some subtle balance:

In its relation to the users and external knowledge sources, the language should be independent to Webmind as much as possible. This is because we should not force the user to know Webmind well to feed knowledge into it, nor can we assume the existing knowledge sources are Webmind-like. Instead, we want the structure and expressing power of KNOW to be similar to that of natural languages, though we don''t want it to be bounded into any specific natural language, such as English. This is the case because an internal representation language (like KNOW) serves different purposes than those of an external communication language (such as English).

Based on this understanding, in the following I will define a context-free grammar for KNOW. This first version will inevitably be incomplete, and it only serves as a starting point. The people who works with it (in the near future, most relevant work will be in natural language, machine learning, reasoning) should report cases where knowledge cannot be properly represented in the current KNOW or where KNOW sentences cannot be properly converted into links and nodes, then the language will be revised accordingly.

2. The Grammar of KNOW

The grammar is written with the following notations:
"A => B C D" means that "A" consists of a sequence "B C D".
"A => B C [D]" means that "A" consists of a sequence "B C" or "B C D", that is, D is optional.
"A => B | C" means that "A" consists of "B" or "C".
"A => {B}+" means that "A" consists of a (non-empty) sequence of "B"s (with an arbitrary length).
"A:" followed by a description is used for a terminal with a special property.

Here comes the grammar:
=> {}+ | {}+ => [ ] | == see footnote => | | {}+ =>
Inheritance {}+ | Similarity {}+ | Implication {}+ | Equivalence {}+ | Property | NumericProperty | RelativeProperty [] | Time | NumericTime | RelativeTime [] | Place | RelativePlace [] | Association | PartOf {}+ | Own | Believe | Want => {}+ => => word | phrase | number | | | | modifier> argument> | => {}+ => number | | | {}+ : word => word [] => {}+ => == | != | > | < | >= | = mathOperator> => + | - | * | / => & & | || | ! : word or phrase : word or phrase or number : word or phrase : real number : real number in [0, 1] : real number in (0, 1)
The outermost tag should have three attributes: source, translator, and dateTranslated. The source field may be a reference to the source document used to create the encoding (example: mizar or cyc), or it may have the value created (which would imply that the translator has encoded knowledge from her/his own knowledge without the benefit of any particular source). The translator field holds the name of the person doing the XML encoding, though this could potentially be a reference to a translation script in some cases.

footnote -- In the case of a sentence which contains a strength and confidence will always both be 1. Whenever we don''t explicitly specify values in the grammar, it is taken to be implied that a relation> has strength=1 and confidence=1.


Sentences generated according to this formal grammar can be saved in two forms: in XML or in plain text.

In the XML version, each non-terminal item in the grammar corresponds to a tag with the same name. For example, the knowledge "John gave Mary a book written by himself" will become

give John Mary book1 1.0 0.9 Inheritance book1 book 1.0 0.9 author John book1 1.0 0.9

Here strength and confidence take default values.

Another way is to represent KNOW text as plain text, given the following conventions:

(1) Put each sentence in a [ ]. (2) If a text contains more than one sentence, put them in a { }, otherwise just use the sentence. (3) Put each phrase in a " ". (4) Separate adjunct items by a space. (5) Put strength and confidence in ( ). (6) If an argument is preceeded by a series of modifiers, put all of them in ( ). (7) Put an argument set in >.
Consequently, the same text become:

{ [give John Mary book1 (1.0 0.9)] [Inheritance book1 book (1.0 0.9)] [author book1 John (1.0 0.9)]}

3. Explanation and Examples

In the following, the grammar rules will be explained one by one, with examples (in plain text format) when necessary. => {}+
A text is the largest unit of knowledge and it contains a sequence of sentences.

The order of the sentences may matter. Embedded in such a class, the knowledge may not be the system''s belief, but some belief that the system can think about.

Example: { [give John Mary book1 1.0 0.9] [Inheritance book1 book 1.0 0.9] [author book1 John 1.0 0.9]} =>
A sentence is a relation with truth value (strength and confidence).
Example: [give John Mary book1 1.0 0.9]. => |

A relation corresponds to either an instance of a Webmind link type (and is called a builtInRelation) or a multiple-target InheritanceLink (called a userDefinedRelation).
The distinction between the two is made according to Webmind design considerations. A builtInRelation can be recognized and processed by special-purpose code in Webmind, while a userDefinedRelation is only used in reasoning by the default mechanism in the inference engine.


Both types of relation consists of a relation name, followed by a non-empty argument list. When user enter relations into the system, names of builtInRelations can be selected from a given list. All the other names are taken as userDefinedRelation. The order of the arguments do matter in most relations. To specify the desired order, examples are used once a relation name is chosen or given. We don''t want to specify the argument structure by limiting the category of each argument, nor do we want to name the arguments.

Example: [give John Mary book1]

(in the following examples, the strength and confidence will be omitted.)

In general, all built-in relations can be put into three categories:
(1) Inheritance relations, including Inheritance, Similarity, Implication, and Equivalence. These are the logical basic relations, by which the other relations can be represented.

(2) Property relations, including Property, NumericProperty, RelativeProperty, Time, NumericTime, RelativeTime, Place, and RelativePlace. "Property" is a special kind of relation, and serves as a modifier of a item. Though the boundary between "relation" and "property" is fuzzy, it still makes sense, and such a line can be drawn in most cases. For example, "Apple is red" can be seen as a relation among "apple", "color", and "red", but it is more natural to be seen as to assign a value (red) to an property (color) of an object (apple). On the contrary, "John gave mary a book" should not be put in this way. In the above properties, Property, NumericProperty, and RelativeProperty are the primary types, while the others are special situations of the three, where the "property" is either time or place.

(3) Special relations, including Association, PartOf, Own, Believe, and Want. These relations have nothing special from a logical point of view, but since they appear very often in Webmind, as well as in human knowledge, they are given special treatment to improve the efficiency of the system.

All built-in relations will be described one by one in the following.

ОТСЮДА НАЧИНАЕТСЯ ТО, ЧТО НАМ ОСОБЕННО НУЖНО -

ОПЕРАТОРЫ КОДИРОВАНИЯ ЗНАНИЙ -

=> Inheritance {}+ - Наследование

Such a relation will become a pair of InheritanceLinks (one ExtensionLink and one IntensionLink), indicating that the first argument is a special case of the second.
Example: [Inheritance bird animal]

When taking more that two arguments, [Inheritance a1, a2, ..., an] is identical to [Inheritance a1, a2], [Inheritance a2, a3], ..., [Inheritance an-1, an], with the same truth value for each relation.

=> Similarity {}+ Сходство

Such a relation will become a pair of SimilarityLinks, indicating that the two arguments are similar to each other (so their order doesn''t matter).
Example: [Similarity dog cat]

When taking more that two arguments, [Similarity a1, a2, ..., an] is identical to [Similarity a1, a2], [Similarity a2, a3], ..., [Similarity an-1, an], with the same truth value for each relation.

=> Implication {}+ - Логическое следование

Such a relation will become a pair of ImplicationLinks, indicating that the first text is a sufficient condition of the second. Here two texts are used, rather than arguments in general, because an implication relation is a higher-order relation between sentences.
Example: [Implication [give John Mary book1] [Own Mary book1]]

When taking more that two arguments, [Implication a1, a2, ..., an] is identical to [Implication a1, a2], [Implication a2, a3], ..., [Implication an-1, an], with the same truth value for each relation.

=> Equivalence {}+ - Эквивалентность

Such a relation will become a pair of EquivalenceLinks, indicating that the two texts are sufficient condition of each other (therefore the order of the texts doesn''t matter). Again, the arguments are texts, not words or phrases.
Example: [Equivalence [give John Mary book1] [receive Mary John book1]

When taking more that two arguments, [Equivalence a1, a2, ..., an] is identical to [Equivalence a1, a2], [Equivalence a2, a3], ..., [Equivalence an-1, an], with the same truth value for each relation.

=> Property - Свойство

This relation indicates that an object (first argument) has a property (second argument) with a known value (third argument). Such a relation will become either a PropertyLink or a MTIL.
Example: [Property apple color red]

=> NumericProperty - Численная мера свойства

This relation indicates that an object (first argument) has a property (second argument) with a known numeric value (measurement).

Example: [NumericProperty John height 1.75 meter]

=> RelativeProperty [] - относительная мера свойства

This relation indicates that an object (first argument) has a larger value in a property (third argument) than another object (second argument), with their difference as an optional argument. The implementation of this relation type is undecided yet --- it can either become a special PropertyLink, or a Property of a relation.
Example: [RelativeProperty John Tom height 0.2 meter]

=> Time - Время

This relation is a special case of Property, with "time" as the property, which is no longer indicated by an argument, but by the relation name. The first argument may be a text.

Example: [Time [give John Mary book1] yesterday]

=> NumericTime - Численная мера времени

Similar to the above, this relation is a special case of NumericProperty, with "time" as the property to be measured.
Example: [NumericTime day 24 hour]

=> RelativeTime [] - относительная мера времени

Similar to the above, this relation is a special case of RelativeProperty, with "time" as the property to be measured.
Example: [RelativeTime December November 1 day]

=> Place - Место

This relation is a special case of Property, with "place" as the property, which is no longer indicated by an argument, but by the relation name. The first argument may be a text.

Язык кодирования знаний KNOW - Часть 2

Язык кодирования знаний KNOW - Часть 2

=> Time - Время

This relation is a special case of Property, with "time" as the property, which is no longer indicated by an argument, but by the relation name. The first argument may be a text.
Example: [Time [give John Mary book1] yesterday] => NumericTime

Similar to the above, this relation is a special case of NumericProperty, with "time" as the property to be measured.
Example: [NumericTime day 24 hour]

=> RelativeTime [] - Относительное время

Similar to the above, this relation is a special case of RelativeProperty, with "time" as the property to be measured.
Example: [RelativeTime December November 1 day]

=> Place - Место

This relation is a special case of Property, with "place" as the property, which is no longer indicated by an argument, but by the relation name. The first argument may be a text.
Example: [Place Intelligenesis "New York City"]

=> RelativePlace [] - Относительное место

Similar to the above, this relation is a special case of RelativeProperty, with "place" as the property to be measured. However, it still need to use the third argument for the direction of the relation (such as above/below, left/right, and so on)
Example: [RelativePlace [meet John Mary] "Central Park" south 1 mile]

=> Association - Ассоциация

Such a relation indicates that the first argument is associated to the second one (in a unspecified way), and it will become a pair of AssociativeLinks.
Example: [Association doctor nurse]

=> PartOf - Часть

Such a relation indicates that the first argument is part of the second argument, and it will become a PartOfLink and a ContainLink.
We haven''t had special code for this relation except in the NL module yet.

Example: [PartOf head body]

When taking more that two arguments, [PartOf a1, a2, ..., an] is identical to [PartOf a1, a2], [PartOf a2, a3], ..., [PartOf an-1, an], with the same truth value for each relation.

=> Own - Иметь

Such a relation indicates that the first argument is the owner of the second argument.
Example: [Own Mary book1]

=> Believe - Верить

Since "believe" is a frequently used relation, it will become a PropertyLink (BeliefLink) from a system (human or computer) to a text. When the details are not important, the same KNOW can also be used to represent semantic relations such as "know", "guess", "see", "hear", and so on, with deferent default truth values.
Example: [Believe Pei {[Property Earth shape plat] [Property Moon "made of" cheese]}]

=> Want - Хотеть

This is similar to Believe except that the text indicating relations the system want to be true in a future time. This relation will be used to represent goals, hopes, desires, and so on. To be general, the second argument must be a text, not word or phrase, therefore Want is also a higher-order relation here (which is one of the several senses of "want").
Example: [Want Mary [give John Mary book1]] => {}+

Such a relation will become multiple-target InheritanceLinks in Webmind. It is necessary to confirm that every relationName is used with the same argument structure, which specifies the number, type, and order of the arguments.
Example: [give John Mary book1]

An argument can either be a simple one or a complex one.
A simple argument may be a word, a phrase, or a number.

A complex argument can either be a KNOW text, or an argument modified by a modifier, which is just like a simple argument itself.

A modifier usually correspond to a property, with the property name omitted. For example, "red apple" correspond to a kind of apple whose "color" property has "red" as its value.

A argument set will cause the relation to be duplicated for each argument in the set, with the same truth value.
Example: [Inheritance A B> C] is identical to [Inheritance A C] and [Inheritance B C], while [Inheritance A B C>] is identical to [Inheritance A B] and [Inheritance A C].

Please note that "argument set" is not the same as multiple argument. For example, [Inheritance A B C] is identical to [Inheritance A B] and [Inheritance B C].

A user defined relation name can be any English word or phrase.
Used in NumaricPropertyLink, this should be an English word or phrase that is a measurement unit.
A property value can be any real number. : real number in [0, 1]
The strength of a sentence is defined in the same way as the strength of a link in Webmind. Various default values can be used for deferent verbal expressions, such as "usually", "hardly", "is", ''is not", and so on. : real number in (0, 1)
The confidence of a sentence is defined in the same way as the confidence of a link in Webmind. Various default values can be used for deferent verbal expressions, such as "I guess", "in fact", and so on. Usually the extreme values (0 for no evidence, 1 for complete evidence) are not allowed

Элементарные единицы знания - Examples of encoding - Примеры кодирования на языке KNOW

Примеры кодирования на языке KNOW

Текст

Mike is one of Americans.
He is 14 years old. He has older sister. Like the others Americans he believes God. Two years ago he went to school. Mike doesn’t like to learn mathematics, physics and computer science. On the contrary, he likes study humanities. He is an usual American teenager.


Представление в виде языка KNOW

{
[Inheritance nation1 nation] // optional
[Inheritance Americans nation1] // optional
[Property Mike nation Americans]

// то же самое можно сделать так :

[PartOf Mike Americans]
[NumericProperty Mike age 14 years]

[Own Mike sister]
[RelativeProperty Mike sister older]

[Inheritance American1 American]
[Inheritance Mike American1]
[Believe Mike [in God]]

// необходимо, чтобы определить «2 years ago»
[RelativeTime FirstDayOfSChool today «2 years ago»]
[Time [Mike went to school] FirstDayOfSChool]

[RelativeProperty [learn Mike “the humanities”]
[learn Mike “mathematics, physics and computer science”] more like]

[PartOf Mike “American teenagers”]
}




-------------------------

Ниже приведены примеры кодирования знаний другим способом - для общего развития.

Это фрагменты семантических сетей - другой способ кодирования знаний (в частности - для WebMind)

Это материал для другой лабы

-------------------------

Concept:

Similar things:

Things that are special case of:

Things that this is a special case of:

Parts of this:

Things that this is a part of:

Things that this is generally associated with:

Things that this does:

Things that are done to this:

Properties that often has:

-----------------------------------
-------------------------

Concept: ability

Similar things: talent, skill

Things that are special case of: genius

Things that this is a special case of:

Parts of this:

Things that this is a part of:

Things that this is generally associated with: learning, sport, intelligence, talent, skill, expertise

Things that this does:

Things that are done to this: enhanced, improved, developed

Properties that often has: natural, amazing, uncanny

------------------------------------------------------------

Concept: absence

Similar things: disappearance, none, not present,

Things that are special case of: on leave, epilepsy

Things that this is a special case of:

Parts of this:

Things that this is a part of:

Things that this is generally associated with: work, school, employment, functions, invitations

Things that this does: costs money

Things that are done to this:

Properties that often has: irritating, unexplained, unreasonable, unexpected

-----------------------------------
-------------------------

Concept:

Similar things:

Things that are special case of:

Things that this is a special case of:

Parts of this:

Things that this is a part of:

Things that this is generally associated with:

Things that this does:

Things that are done to this:

Properties that often has:

-----------------------------------
-------------------------

Concept:

Similar things:

Things that are special case of:

Things that this is a special case of:

Parts of this:

Things that this is a part of:

Things that this is generally associated with:

Things that this does:

Things that are done to this:

Properties that often has:

-----------------------------------



Hosted by uCoz