Facts

A simple fact has three parts: a subject, a property [1], and an object. For example,

Greg[child->Louisa].

Here, the subject is Greg, the property is child, and the object is Louisa. The fact simply says that Greg has Louisa as a child, or the individual Greg has the value Louisa on the property child. This is just like an RDF triple, for those who are familiar with that language. The statement does not preclude Greg from having other children, or values for other properties.

The square brackets and their contents are called a frame. There are two types of frame. The type seen here is an instance frame. It is used for asserting facts. The other type is called a schema frame. It is used for defining classes and we will encounter schema frame shortly.

The -> arrow indicates a normal property-value relation. We will see other types of arrows later.

You will not find the statement above, as written, in family.flr. Instead, we find:

Greg:Man[
child->{Kellie,Louisa},
spouse->Grit,
birthDate->"1991-04-27"^^\date].

This is a composite statement, which contains multiple basic facts. Semantically, this statement is equivalent to five individual statements:

Greg : Man.
Greg [ child -> Kellie ].
Greg [ child -> Louisa ].
Greg [ spouse -> Grit ].
Greg [ birthDate -> "1991-04-27"^^\date].

We see several new pieces of Flora syntax here.

  • The : operator means instance of. So Greg is an instance of Man (or “Greg is a man”, in the typical reading).
  • The , (comma) operator separates multiple facts. When used inside a frame, each fact is about the subject of the frame.
  • Curly brackets {…} in the object position of a frame indicates multiple values. So, Greg [ child -> {Kellie, Louisa} ] indicates that Kellie and Louisa are both children of Greg’s.
  • “1991-04-27”^^\date is a typed data value. Typed data values are given as a value inside double quotes, followed by ^^, followed by a type. Flora has a number of built-in data types, discussed later in this chapter. \date is one such data type. In general, Flora keywords start with a backslash, so don’t start your own identifiers with backslash.

We recommend that you use such composite frames to group together facts about the same individual (or class) as it improves readability. If you use the Sunflower KB Editor, it will create such composite facts. However, note that it is still possible to assert additional facts about the same individual (e.g., Greg), including additional facts about the same properties (e.g., child).

The comma to separate multiple facts can also appear at the top level. For example,

Greg [ child -> Kellie ], Greg [ child -> Louisa ].

We do not recommend this usage. Instead, if the subjects are the same (as in this case, i.e., Greg), use one composite frame as in the previous example. If the subjects are different, use two separate statements.

Frames can also be nested. For example,

Assembly123 [ hasPart -> Part1 [ weight -> 10.0 ] ].

This is equivalent to two facts:

Assembly123 [ hasPart -> Part1 ].
Part1 [ weight -> 10.0 ].

We recommend this usage only for situations where the nested subjects are “owned” by the top-level subject, and not used elsewhere. The KB Editor will not create nested frames, but it does support them. The nested individuals will show up in the KB Editor, and you can edit the nested frame. If you delete the “owning” subject, all nested facts will be saved as new top-level facts, or inside any other pre-existing frames for their subjects.

[1]Flora calls it method, but we stick with property because it is more commonly used in knowledge representation, in particular in OWL