Translations between CGLF, CGIF, KIF, RDF and
the WebKB-2 languages (For-Taxonomy, Frame-CG, Formalized English)


Note. This document was written in 2001 and at the time it was still unclear whether or not RDF would remain associated with a DAML+OIL-like ontology, i.e. a language ontology inspired from description logics, or would be extended to include proper quantifiers such as Tim Berners Lee's forall and exists RDF constructs. Thus, in this document, whenever RDF is not expressive enough (that is, often), I use Tim Berners Lee's constructs. In 2003, it is now clear that OWL (a slight modification of DAML+OIL) will be the standard language ontology associated with RDF. Hence, the RDF representations in this document (and the ISWC'02 article written after it) are obsolete. However, in May 2003, I joined a small project to propose extensions to UML to permit it to import/export from OWL and possibly be more expressive, and I created a new version of this document but centered on UML and OWL. Please refer to this new document for RDF translations.


Using knowledge representation languages is not easy, especially since the documentations generally only give a few simple examples. This is for example the case for the Resource Description Format (RDF) and the Conceptual Graph Interchange Format (CGIF). The Knowledge Interchange Format (KIF) has many examples in its documentation and in the Ontolingua library, but certain knowledge representation cases are still difficult to find. Representations with the Conceptual Graph Linear Format (CGLF) are relatively well documented in [Sowa, 1992] and [Sowa, 1993].

This document presents a panorama of logical cases of knowledge representation, and shows how various notations can be used (or extended to be used) for these cases. In addition to the above cited languages, this document presents two notations derived from CGLF and designed to be as intuitive as possible in all the presented cases: Formalized English (FE) and Frame-CG (FCG).

If you are not interested in the trial of RDF/XML, you may prefer to access our ICCS'02 article. If you are mostly interested in how (poorly) RDF/XML compares with other notations, see this PDF article or this postscript article.

Knowledge providers may see this document as a guide for knowledge representation. Knowledge-based systems (KBSs) developpers may see it as a list of cases to take into account. Language developpers may see it as a workbench for comparing their notations to others. Here are the explored cases in increasing order of complexity.

Only logical cases are presented below (click here for ontological examples in FCG or here for more logical/syntactical examples in FCG). The translation into KIF provides a logical interpretation for the explored cases and hence for the syntactic features used in the other notations.

RDF is presented via its XML linearization: RDF/XML. The RDF lexical conventions (intercap style, first letter of class identifiers in uppercase) and the RDFS and DAML+OIL schemas are followed.
For the other notations, more appropriate lexical conventions (singular nouns, English spelling) and ontological conventions are followed.

The last presented case deals with category declaration. In the examples for the other cases, the used categories are supposed to be already declared (and, for the RDF representations, declared in the same document than these representations). The uppermost category for "concept types", i.e. "classes" in the RDF terminology (as opposed to relation types, i.e. "properties" in RDF) has for identifier: T.



Conjunctive Existentially Quantified Sentences

Here is an example of such sentences. "E" is for "English".

E: Tom owns a dog that is not Snoopy. FE: Tom is owner of a dog different_from Snoopy. FCG: [Tom, owner of: (a dog != Snoopy)] CGLF: [T:Tom]<-(owner)<-[dog:*x!=Snoopy] CGIF: [dog:*x] (owner ?x Tom) (different_from ?x Snoopy) KIF: (exists ((?x dog)) (and (owner ?x Tom) (/= ?x Snoopy))) RDF: <Dog><owner><rdf:Description about="#Tom"/></owner> <daml:differentIndividualFrom resource="#Snoopy"/></Dog>

Problem with the CGIF sentence: different_from is not in the Conceptual Graph (CG) standard, hence knowledge providers may use different identifiers for this basic form of negation.



Contexts

Contexts permit to represent statements over statements. Contexts are represented via delimitors (e.g. `...' in FE, [...] in FCG, '(...) and ^(...) in KIF) or keywords (e.g. aboutEach in RDF).

E: Tom believes Mary now likes him (in 2002) and that before she did not. FE: Tom is believer of ` *p `Mary is liking Tom' at time 2002' and is believer of `!*p is before 2002'. FCG: [Tom, believer of: [*p [Mary, agent of:(a liking,object:Tom)], time:2002], believer of: [!*p, before: 2002] ] CGLF: [proposition: *p [T:Mary]<-(agent)<-[liking]->(object)->[T:Tom] ] [T:Tom]- { (believer)<-[ [situation: ?p]->(time)->[time:"2002"], (believer)<-[ [situation:~?p]->(before)->[time:"2002"] ] } CGIF: [proposition *p: (agent [liking *l] Mary) (object ?l Tom) ] (believer [situation: (time [situation: ?p] "2002")] Tom) (believer [situation: (before [situation: ~[?p]] "2002")] Tom) KIF: (exists (?p) (and (= ?p '(exists ((?x liking)) (and (agent *l Mary) (object ?l Tom)))) (believer ^(time ,?p 2002) Tom) (believer ^(before (not ,?p) 2002) Tom))) RDF: <rdf:Description bagID="p"> <Liking><agent><rdf:Description about="#Mary"/></agent> <object resource="#Tom"/></Liking></rdf:Description> <rdf:Description bagID="not_p" aboutEach="#p" truth ="false"/> <rdf:Description bagID="now" aboutEach="#p" time ="2002"/> <rdf:Description bagID="past" aboutEach="#not_p" before="2002"/> <rdf:Description aboutEach="#now"><believer resource="#Tom"/> </rdf:Description> <rdf:Description aboutEach="#past"><believer resource="#Tom"/> </rdf:Description>

The relation types ("properties" in RDF) believer, time and before connect an instance of the type situation to another object. In Conceptual Graphs, it is customary to distinguish the "proposition" stated by a sentence (graph, logical formula) from the "situation" described by this proposition. This distinction has been made explicit in the above CGLF and CGIF sentences. However, in some cases, making this distinction is difficult for unexperienced people and inconvenient because it leads to adding several intermediary contexts. Furthermore, these intermediary contexts can be automatically inserted by a parser based on the signatures of the used relations. Therefore, we have not explicited these intermediary contexts in the other notations.

In CGLF and CGIF, a variable is introduced with the prefix '*'and re-used within the same context with the prefix '?'. Thus, two embedded sibling contexts may introduce variables with the same name but not referring to the same object. We do not think this approach easy to follow by people. Instead, in FE and FCG, variables may be indifferently prefixed by '?' or '*' and a variable introduction is distinguished by being used with a type and a quantifier (instead of without). Variable introductions must precede variable re-uses. When, within a graph, a variable re-use exists in a context (say c1) different from the context (say c2) where the variable has been introduced, the convention is that the variable is assumed to have been introduced in the minimum upper context embedding c1 and c2 (in CGLF and CGIF, this has to be done explicitly by the user but this is sometimes cumbersome and counter-intuitive).
Finally, FE and FCG also permit the introduction of free variables without type or quantifier but with the prefix '^'. The semantic of these free variables is the same as in KIF: within statements (as opposed to queries), these variables are assumed to be introduced and universally quantified in some upper context (as before, the lowest context that includes all the variable uses). As illustrated later, free variables are useful shortcuts when writing rules.

Problem with the RDF sentence: the truth property was invented by Berners-Lee in 1999 but is not in the RDF/RDFS standard nor in DAML+OIL.



Universal Quantification

E: Animals have exactly one head. FE: Any animal has for part 1 head. FCG: [any animal, part: 1 head] CGLF: [animal:@forall]->(part)<-[head: @1] CGIF: (part [animal: @forall] [head: @1]) KIF: (forall ((?a animal)) (exists1 '?h (and (head '?h) (part ?a '?h)))) RDF: <rdf:Property ID="headPart"> <rdfs:subPropertyOf resource="#part"/><rdfs:range resource="#Head"/> </rdf:Property> <rdfs:Class rdf:about="#Animal"> <rdfs:subClassOf><daml:Restriction daml:cardinality="1"> <daml:onProperty resource="#headPart"/> </daml:Restriction></rdfs:subClassOf></rdfs:Class>

Here is our KIF definition of exists1:
(defrelation exists1 (?var ?predicate) :=
  (truth ^(exists (,?var)
    (and (,?predicate ,?var) (forall(?y) (=> (,?predicate ?y) (=,?var ?y)))))))

The RDF representation was derived from an example in the DAML+OIL documentation. However, this representation uses a category definition (for Animal) instead of a sentence with a universal quantifier. As explained in the KIF standard, "definitions have no truth values in the usual sense; they are so because we say that they are so". Because RDF and RDFS plus DAML+OIL have no universal quantifier and because definitions are easier to handle than universal quantifier, it is best to overlook this subtle distinction in the RDF representation. A more general construct is proposed in the next section.
Another problem of this RDF representation is that it contains a declaration of the relation headPart. We would have liked to use a lambda abstraction (i.e. an anonymous category definition) instead but Restriction can only be used for defining an anonymous concept type, not an anonymous relation type.



Lambda Abstractions, Percentages, Possibilities and Valuations

E: At least 93% of healthy birds can fly. FE: At least 93% of [bird with chrc a good health] can be agent of a flight. FCG: [at least 93% of (bird, chrc: a good health), can be agent of: a flight] CGLF: [physical_possibility: [lambda(b)[bird:*b]->(chrc)->[health]->(measure)->[value:good]: @>93%] <-(agent)<-[flight] ] CGIF: [(lambda(bird *b) [health *h] (chrc ?b ?h) (measure ?h good)) *x: @>93% [physical_possibility: (agent [flight] *x)] ] KIF: (defobject healthy_bird (?b) := (exists ((?h health)) (and (bird ?b) (chrc ?b ?h) (measure ?h good)))) (forAtLeastNpercent 93 '?x healthy_bird (exists ((?f flight)) (physical_possibility (agent ?f '?x)))) RDF: <forall var="#b" at_least percent="93%"> <exists var="h"> <if><Bird about="#b"><chrc><Health about="#h"><measure resource="#good"/> <Health></chrc></Bird> <then><exists var="f"> <Flight about="#f"><agent can resource="#b"/></Flight> </exists></then></if></exists></forall>

Here is our KIF definition of forAtLeastNpercent (and its associate functions):
(defrelation forAtLeastNpercent (?n ?var ?type ?predicate) :=
  (exists ((?s set))
    (and (truth ^(forall (,?var) (=> (member ,?var ,?s) (,?type ,?var)))
         (>= (numMembersSuchThat ,?s ,?predicate) (/ (* (size ,?s) ?n) 100)))))

(define-function numMembersSuchThat (?set ?p) :-> ?num :=
  (if (and (set ?set) (predicate ?p)) (numElemsSuchThat (listOf ?set) ?p)))

(define-function numElemsSuchThat (?list ?p) :-> ?num :=
  (cond ((null ?list) 0)
        ((list ?list) (if ?p (1+ (numElemsSuchThat (rest ?list) ?p))))))

The CGLF and CGIF representations have several problems.
First, @>93% does not match the current lexical constraints for "defined quantifiers" (an extension of these is needed). Furthermore, since a "defined quantifier" can be anything and cannot actually be defined ("invented quantifier" would be a better name), its meaning is left implicit (the standardization of usual extended quantifiers such as @>93% is necessary).
Second, physical_possibility is not in the current CG standard.
Third, only the agent relation should be contextualized. In CGLF, this is cumbersome. In CGIF, should the concept node with type physical_possibility be in the referent part of the concept node with the numerical quantifier (@>93%)? What is the actual meaning of this construction? How to delimit the scope of this quantifier otherwise? The CG standard says that "for complex mixtures of quantifiers, the scope can be delimited by transparent contexts (marked by context brackets [ ] with no type label)". But is it consistent with the other uses of concept node embedding?
Fourth, good is not in the CG standard. FE and FCG have five keywords for quantitative valuation: good, bad, important, small, big, great. This permits the user not to introduce adjectives (more precisely, categories with adjectives as names) into the ontology and hence leads this ontology to be more re-usable and exploitable. We do not believe that the average users can or should have to define valuations for each possible measurable quantity (e.g. what would "good_boy", "good_work", "good_food" and "bad_food" mean?).
Fifth, measure and value are not standard either. Extensions or ontological conventions are needed.
Sixth, in the CGIF sentence, should *b and *x be merged in a single variable? The CG standard does not give indications.
Seventh, how to represent lambda-abstractions in CGLF? Sowa put them in concept node referent fields, and used the greek character lambda in his articles and the HTML encoding of this character (λ) in the CG standard (and even λ1 and λ2). We have adopted a more classic and consistent notation closer to the one used in CGIF.

We have not found any simple way to represent a lambda-abstraction (that is, an anonymous type declaration) in KIF. Hence, we have used a normal type declaration.

The above "RDF" sentence actually does not follow the RDF/XML grammar. It re-uses the forall and exists constructs that were invented by Berners-Lee in 1999 to represent universal quantification but which were not included in RDF. We added the attributes percent and at_least to the forall construct.
The insertion of the keyword/attribute can into a relation is also an extension of RDF and RDF/XML.

The above example can be modified to refer to "most birds" instead of "93% of birds". In FE and FCG, the keyword most may be used and is equivalent to at least 60% (hence, it can be represented in KIF in this form). In CGLF and CGIF, @most may be used. In RDF/XML, most may be added as a property to the forall construct.



Negations, Exclusions and Alternatives

We have already seen two forms of negation: one involving a different_from relation (differentIndividualFrom in DAML+OIL, /= in KIF), and one involving the negation of a sentence ("not" in KIF). This last form is more difficult to exploit by inference engines and leaves room for ambiguity. For example, "Tom does not own a blue car" may mean that "Tom has a car but not blue" or "Tom does not have a car". Thus, it is better to use the first form, or break sentences into smaller blocks connected by coreference variables to reduce or avoid ambiguities.
Here is a variant of the first form: negation on types. E: Tom owns something that is not a car. FE: Tom is owner of a !car. FCG: [Tom, owner of: a !car] CGLF: [T:Tom]<-(owner)<-[~car:*] CGIF: (owner [~car] Tom) KIF: (exists (?type ?x) (and (owner ?x Tom) (holds ?type ?x) (/= ?type car))) RDF: <rdf:Description ID="x"> <owner><rdf:Description about="#Tom"/></owner> <rdf:type><rdfs:Class><daml:differentIndividualFrom resource="car"/> </rdfs:Class></rdf:type></rdf:Description> <!-- "disjointWith" may be used instead of "differentIndividualFrom" -->

Exclusion between objects (and hence, some forms of negation) may also be represented via XOR-collections or OR-collections.
RDF proposes an alt collection to store alternatives but unfortunately does not specify if this "or" is inclusive or exclusive. Although specializing alt by or_bag and xor_set seems a good idea (even if RDF engines are unlikely to take advantage of this distinction), the current RDF/XML grammar only permits to define members (using li relations) to collections of types Bag, Alt and Seq, and not specializations of these types!
FE and FCG use OR-collections and XOR-collections as syntactic means to store "or" and "xor" relations between objects (types, instances or sentences). This can be done in RDF too (however, to store exclusion relations between categories, it is better to use the DAML relations disjointWith, complementOf and differentFrom).
Here is an example of OR-collection between instances. (Note: red, yellow and orange are not instance but subtype of color, and have many subtypes, e.g. crimson, dark_red and chrome_red. The instances of these colors are the actual occurrences of colors that physical objects have.)

E: Tom's car is red, yellow or orange. FE: Tom is owner of a car that has for color OR{a red, a yellow, an orange}. FCG: [Tom, owner of: (a car, color: OR{a red, a yellow, an orange})] CGLF: [Tom]<-(owner)<-[car]->(chrc)->[color]->(kind)->[TYPE: OR{red,yellow,orange}] CGIF: [car:*x] (owner *x Tom) (color *x [red|yellow|orange:]) KIF: (exists ((?x car) ?c) (and (owner ?x Tom) (color ?x ?c) (or (red ?c) (yellow ?c) (orange ?c)))) RDF: <Car><owner><rdf:Description about="#Tom"/></owner> <color><rdf:Description> <rdf:type><rdf:Alt><rdf:li resource="#Red"/> <rdf:li resource="#Yellow"/> <rdf:li resource="#Orange"/></rdf:Alt> </rdf:type></rdf:Description></color></Car>

There is no usual way to represent OR collections in CGLF and this notation apparently will not be standardized. We have chosen to use the FCG way rather than the CGIF way because it is more general (in CGIF, only types can be OR-ed without introducing contexts).

It should be noted that for this example, it would have been simpler to use a type such as warm_color instead of the OR-collection of red, yellow and orange (and this form eases inferencing). More generally, this section shows that a negation can be represented in numerous ways and that these representations are difficult for an inference engine to compare and hence exploit fully. Both for knowledge exchange with frame-based systems and for knowledge inferencing, different_from relations between instances or types should be prefered to other forms of negations.



Collections and Quantifier Precedence

Collections have already been introduced in the previous section and via examples using numerical quantifiers. In this section, we show how various interpretations of the English sentence "4 persons have approved 3 resolutions" (and some variations of it) can be interpreted. By studying how to represent relations between members of two simple collections, we illustrate the importance of specifying how a collection must be interpreted, and show how to handle complex cases of quantifier precedence (between numerical, existential and universal quantifiers).

The sentence "4 persons have approved 3 resolutions" is ambiguous. The 4 persons may have individually or collectively approved 3 resolutions (the same 3 or not), and "collectively" may have two meanings: a participation to a "unique" approval act or the approval of "most" of the resolutions (or a combination of both as ilustrated in the last example of this section). In this paper, "persons acting together/collectively" means that "there exists an act and each of the persons is agent of that act". This interpretation of "collectiveness" was used in [Sowa, 1992] and, in Conceptual Graph terminology, it implies that the act must be represented by a "concept node", not by a "relation node" (this has however not been stated by Sowa). In [Sowa, 1992], any collection in a concept node of a conceptual graph can be specified as having a distributive interpretation (each member of the collection individually participates to the relations associated to the node), a collective interpretation (the members collectively participate to the relations associated to the node), a defaut interpretation (an unspecified mix of collective and distributive interpretation) or a cumulative interpretation (the relations are about the collection itself). (The current CG standard does not really specify what the various interpretations of a collection can be, not even within the CGIF grammar).

RDF permits the distributive interpretation (or is it the default interpretation?) via the use of the keyword aboutEach. Without this keyword, the relations are about the collection itself (cumulative interpretation). However, the RDF authors also represent the collective interpretation via direct relations to the bag (see section 3.5 of RDFMS). This ambiguity can often be repaired by RDF parsers by exploiting the signatures of the relations (if the expected type is not a collection, this is the collective interpretation, otherwise the ambiguity remains). Hence, we have not introduced a new keyword for specifying the collective interpretation in the following examples. However, we have introduced the concept type set and the relation type size from our top-level ontology since neither RDF, RDFS nor DAML+OIL propose equivalent categories. The type set is declared as a subtype of rdf:Bag to permit the use of aboutEach.

The first example keeps the ambiguity of the above sentence (both collections have the default interpretation). The `s' at the end of persons and resolutions in the FE and FCG representations are supposed to be automatically removed (WebKB-2 does this when a numerical or universal quantifier is involved). In this section, FE is only given in this first example.

E: 4 persons have (each/together) approved 3 resolutions. FE: 4 persons are agent of an approval with object 3 resolutions. FCG: [4 persons, agent of: (an approval, object: 3 resolutions)] CGLF: [person:{*}@4 @certain]<-(agent)<-[approval]->(object)->[resolution:{*}@3] CGIF: (agent [approval:*a] [person: @4 @certain]) (object ?a [resolution: {}@3]) KIF: (forAllN 4 '?p person (forAllN 3 '?r resolution (exists ((?a approval)) (and (agent ?a '?p) (object ?a '?r))))) RDF: <Set ID="Persons"><size>4</size></Set> <forall var="p"> <if><Person about="#p"/><memberOf resource="#Persons"/></Person> <then><Set ID="Rs"><size>3</size></Set> <forall var="r"> <if><Resolution about="#r"><memberOf resource="#Rs"/></Resolution> <then><exists var="a"> <Approval about="#a"><agent resource="#p"/> <object resource="#r"/></Approval> </exists></then></if></forall></then></if></forall>

For modularity, we have introduced the "quantifier" forAllN.
(defrelation forAllN (?num ?var ?type ?predicate) :=
  (exists ((?s set)) (and (size ?s ?num)
    (truth ^(forall (,?var) (=> (member ,?var ,?s)
                                (and (,?type ,?var) ,?predicate)))))))

In CGLF and CGIF, the order of the quantifiers at a same level in a context is specified via a simple convention: the existential quantifier marked by the keyword @certain has precedence over the universal/numerical quantifiers which have precedence over the over existential quantifiers. Remaining ambiguities have to be solved by the user via the addition of contexts. In FE and FCG, the order and scope of the quantifiers follow the order and structure of the graphs. RDF does not specify this because the only direct (but limited) form of universal quantification it has (i.e. not via the use of relations between classes) is via RDF representations using aboutEach.
The next example shows a simple inversion of the quantifier order.

E: 3 resolutions have been approved by 4 persons (each/together). FCG: [3 resolutions, object of: (an approval, agent: 4 persons)] CGLF: [person:{*}@4]<-(agent)<-[approval]->(object)->[resolution:{*}@3 @certain] CGIF: (agent [approval:*a] [person: @4]) (object ?a [resolution: {}@3 @certain]) KIF: (forAllN 3 '?r resolution (forAllN 4 '?p person (exists ((?a approval)) (and (agent ?a '?p) (object ?a '?r))))) RDF: <Set ID="Rs"><size>3</size></Set> <forall var="r"> <if><Resolution about="#r"/><memberOf resource="#Rs"/></Resolution> <then><Set ID="Persons"><size>4</size></Set> <forall var="p"> <if><Person about="#p"><memberOf resource="#Persons"/></Person> <then><exists var="a"> <Approval about="#a"><agent resource="#p"/> <object resource="#r"/></Approval> </exists></then></if></forall></then></if></forall>



In FE and FCG, the collective interpretation is specified via the keywords together, group of, set of, bag of, list of, sequence of or alternatives (the first three are synonyms; in this paper, we most often use set to save space).
In CGLF and CGIF, the keyword Col is used, and the collection is assumed to be a set. Another type for the collection may be specified in the cumulative interpretation but we do not know how it could be done with the other interpretations.

If we take the two previous examples and gradually introduce the collective interpretation for the collections, we obtain five different logical interpretations (instead of six because when both collections are collectively interpreted, the inversion of quantifier scopes does not change the meaning). Below are three of these combinations (the other two are: "A group of 3 resolutions has been approved by 4 persons" and "A group of 4 persons has approved 3 resolutions"). In the third case, we give the three equivalent FCG sentences and a tentative RDF representation using aboutEach. For the other cases, using aboutEach is not possible, Berners-Lee's forall and exists constructs have to be used (in the same order as in the KIF representations).

E: 4 persons have (each/together) approved a group of 3 resolutions. FCG: [4 persons, agent of: (an approval, object: a set of 3 resolutions)] CGLF: [person:{*}@4@certain]<-(agent)<-[approval]->(object)->[resolution:Col{*}@3] CGIF: (agent [approval:*a] [person:@4]) (object ?a [resolution:@Col{}@3 @certain]) KIF: (forAllN 4 '?p person (exists ((?rs set) (?a approval)) (forAllIn ?rs 3 '?r resolution (and (agent ?a '?p) (object ?a '?r))))) E: 3 resolutions have been approved by a group of 4 persons. FCG: [3 resolutions, object of: (an approval, agent: a set of 4 persons)] CGLF: [person:Col{*}@4]<-(agent)<-[approval]->(object)->[resolution:{*}@3@certain] CGIF: (agent [approval:*a][person:@Col{}@4]) (object ?a [resolution:@3{}@certain]) KIF: (forAllN 3 '?r resolution (exists ((?ps set) (?a approval)) (forAllIn ?ps 4 '?p person (and (agent ?a '?p) (object ?a '?r))))) E: A group of 4 persons has approved a group of 3 resolutions. FCG: [a set of 4 persons,agent of:(an approval,object:a set of 3 resolutions)] FCG: [a set of 3 resolutions,object of:(an approval,agent:a set of 4 persons)] FCG: [an approval, agent: a set of 4 persons, object: a set of 3 resolutions] CGLF: [person: Col{*}@4]<-(agent)<-[approval]->(object)->[resolution: Col{*}@3] CGIF: (agent [approval: *a] [person: @Col{}@4]) (object ?a [resolution: @Col{}@3 @certain]) KIF: (exists ((?a approval) (?ps set) (?rs set)) (forAllIn ?ps 4 '?p person (forAllIn ?rs 3 '?r resolution (and (agent ?a '?p) (object ?a '?r))))) RDF: <Set ID="Persons"><size>4</size></Set> <Set ID="Resolutions"><size>3</size></Set> <rdf:Description aboutEach="#Persons"> <rdf:type resource="#Person"/> <agentOf><Approval><object><rdf:Description aboutEach="#Resolutions"/> </object></Approval></agentOf></rdf:Description>

Here is our definition for the "quantifier" forAllIn.
(defrelation forAllIn (?s ?num ?var ?type ?predicate) :=
  (and (size ?s ?num)
       (truth ^(forall (,?var) (=> (member ,?var ,?s)
                                   (and (,?type ,?var) ,?predicate))))))

The RDF representation uses agentOf, the relation type inverse of agent. The RDF/XML syntax is so poor that it requires the definition of a new type instead of permitting the use of some syntactic sugar such as a keyword of. It is un-natural and time-consuming for the user, but also imposes additional work to the RDF parser or inference engine.



In FE and FCG, the distributive interpretation is specified via the keyword each. In CGLF and CGIF, the keyword Distr is used. If we introduce the distributive interpretation into the previous seven combinations, we obtain nine different logical interpretations. Here are two of them.

E: 4 persons have each approved 3 resolutions. FCG: [each of 4 persons, agent of: (an approval, object: 3 resolutions)] CGLF: [person:distr{*}@4]<-(agent)<-[approval]->(object)->[resolution:{*}@3] CGIF: (agent [approval:*a] [person:@distr{}@4]) (object ?a [resolution:{}@3]) KIF: (forAllN 4 '?p person (exists1For '?p '?rs set (forAllIn '?rs 3 '?r resolution (exists1For '?p '?a approval (and (agent '?a '?p) (object '?a '?r)))))) E: 4 persons have each approved a group of 3 resolutions. FCG: [each of 4 persons,agent of:(an approval,object:a set of 3 resolutions)] CGLF: [person:distr{*}@4]<-(agent)<-[approval]->(object)->[resolution:Col{*}@3] CGIF: (agent [approval:*a][person:@distr{}@4]) (object ?a [resolution:@Col{}@3]) KIF: (forAllN 4 '?p person (exists1For '?p '?rs set (exists1For '?p '?a approval (forAllIn '?rs 3 '?r resolution (and (agent '?a '?p) (object '?a '?r))))))

Below is our KIF definition of exists1For. This quantifier permits us to specify that the persons are agent of different approvals and different resolutions (first example) or groups of resolutions (second example).
(defrelation exists1For (?var1 ?var2 ?type ?predicate) :=
  (truth ^(exists (,?var2)
    (and (,?type ,?var2)  (,?predicate ,?var1 ,?var2)
         (forall (?x) (=> (,?predicate ,?var1 ?x) (= ,?var2 ?x)))
         (forall (?y) (=> (,?predicate ?y ,?var2) (= ,?var1 ?y)))))))



Finally, we can also introduce "most" as an interpretation of collectiveness in each of the previous (7+9=16) combinations (hence, 16 logical interpretations again). Here is one of them.

E: A group of 3 resolutions has been approved by most in a group of 4 persons. FCG: [a group of 4 persons, agent of: (an approval, object: most in a group of 3 resolutions)] FCG: [most in a group of 3 resolutions, object of: (an approval, agent: a group of 4 persons)] CGLF: [person:Col{*}@4]<-(agent)<-[approval]->(object)->[resolution:Col{*}@3@most] CGIF: (agent [approval:*a] [person:@Col{}@4])(object ?a[resolution:@Col{}@3@most]) KIF: (exists ((?r approval) (?ps set) (?rs set)) (forAllIn ?ps 4 '?p person (forMostIn ?rs 3 '?r resolution (and (agent ?a '?p) (object ?a '?r)))))

Here is our KIF definition of forMostIn (the definition of numMembersSuchThat was given earlier).
(defrelation forMostIn (?set ?num ?var ?type ?predicate) :=
  (and (size ?set ?num)
       (truth ^(forall (,?var) (=> (member ,?var ,?set) (,?type ,?var))))
       (>= (numMembersSuchThat ,?set ,?predicate) (* (size ,?set) 0.60))))



Intervals

E: Tom has been running for 45 minutes to an hour. FE: Tom is agent of a run with duration a period with part 45 to 60 minutes. FCG: [Tom, agent of: (a run, duration: (a period, part: 45 to 60 minutes))] CGLF: [run]- { (agent)->[Tom], (duration)->[period]->(part)->[minute: Col{*}@45-60] } CGIF: (agent [run *r] Tom) (duration ?r [period *d]) (part ?d [minute: @Col{}@45-60]) KIF: (exists ((?r run) (?p period) (?minutes set)) (and (agent ?r Tom) (duration ?r ?p) (forAllInBetween ?minutes 45 60 '?m minute (part ?p '?m)))) RDF: <Run><agent resource="#Tom"/><duration><Period ID="p"/></Run> <Set ID="Minutes"><minSize>45</minSize> <maxSize>60</maxSize></Set> <rdf:Description aboutEach="#Minutes"> <rdf:type resource="#Minute"/> <partOf resource="#p"></rdf:Description>

Here is our KIF definition of forAllInBetween.
(defrelation forAllInBetween (?s ?n1 ?n2 ?var ?type ?predicate) :=
  (exists (?n) (and (size ?s ?n) (>= ?n ?n1) (=< ?n ?n2)
       (truth ^(forall (,?var) (=> (member ,?var ,?s)
                                   (and (,?type ,?var) ,?predicate))))))

In the CGLF and CGIF representations, the collective interpretation is specified for the minutes so that the numerical quantifier has the lowest precedence. In the FE and FCG representations, this is not necessary since the scopes of the quantifiers are specified via the graph structure. In both cases, a concept node of type period had to be introduced since the minutes participate to a same period/duration. This is the same problem as for the collective participation to an act: the act cannot be represented as a relation node. Here, a relation of type duration cannot directly connect the run to the minutes. However, we only became aware of this problem when trying to produce the KIF representation.

FE and FCG also have special notations for periods and for dates (including the hours, minutes and seconds if necessary). For example, the above FE sentence could have been written: Tom is agent of a run with duration a period with part 45:00 to 60:00. There is no special notation or convention for representing dates in CGLF, CGIF, KIF and RDF. Then, strings have to be used but this may conflict with the signatures of relations (e.g. in WebKB-2, a relation of type duration must go from a state or situation to a period, not to a string) or leave the information implicit and hence prevent its exploitation by inference/query engines.



Function Calls and Lists

Special syntactic sugar to distinguish functional relations from other relations is not mandatory since this distinction can be specified when the type of the relation is declared or defined (hence, we can assume that all languages permit function calls even if they do not permit function definitions). However, a syntactical difference eases readablility and syntactic checking. The following example involve two functions (length, +) and one relation (<).

E: The length of the list "Tom, Joe, Jack" plus 1 is less than 5. FE: length(LIST{Tom,Joe,Jack}) + 1 < 5. FCG: [length(LIST{Tom,Joe,Jack}) + 1 < 5] CGLF: [Number:*x]<-<plus>- <-1- [Number]<-<length><-[Person: <Tom,Joe,Jack>], <-2- [Number:1] [?x]->(superior)->[Number:5] CGIF: <length [Person:<Tom,Joe,Jack>] *l> <plus ?l 1 [Number]> KIF: (superior (+ (length (listof Tom Joe Jack)) 1) 5) RDF: <rdf:Seq><rdf:li resource="#Tom"/><rdf:li resource="#Joe"/> <rdf:li resource="#Jack"/> <length><Number ID="l"><length></rdf:Seq> <plus> <arg1 resource="#l"> <arg2>1</arg> <arg3><Number/></arg3> </plus>

Problem with the CGIF notation: the CG standard specifies that angular brackets should be used to delimit lists (ordered bags) but the CGIF grammar only accepts curly brackets. Furthermore, length and plus are not in the CG standard.

Problem with the RDF/XML notation: length, plus, arg1, arg2 and arg3 are not declared in RDF/RDFS/DAML+OIL.

In FE and FCG, the notation for functional relations must also be used for relations with arity superior than two (the type of the relation is the used for determining if this is a function call or not).



Higher-order Statements

First-order statements only permit to quantify over individuals. Higher-order statements also permit to quantify over types. For example, describing the transitivity of a particular relation (e.g. "the part of a part is also a part") can be a first-order statement, but describing in general what a transitive relation is, requires a second-order statement. Since definitions will be presented in the next section, the following example does not define a type such as transitive_binary_relation but uses the characteristic transitivity.

E: If a binary relation type rt is transitive then if x is connected to y by a relation of type rt, and y is connected to z by a relation of type rt, then x is connected to z by a relation of type rt. FE: If `a binaryRelationType ^rt has for chrc the transitivity' then `if `^x has for ^rt ^y that has for ^rt ^z' then `^x has for ^rt ^z' '. //rt,x,y,z are free variables FCG: [ [a binaryRelationType ^rt, chrc: the transitivity] => [ [^x, ^rt: (^y, ^rt: ^z)] => [^x, ^rt: ^z] ]] CGLF: [IF: [binaryRelationType: *rt]->(chrc)->[transitivity] [THEN: [IF: [T: *x]->(&rt)->[T: *y]->(&rt)->[T: *z] [THEN: [?x]->(&rt)->[?z] ]]]] CGIF: [IF: (chrc [binaryRelationType *rt] [transitivity]) [THEN: [IF: (holds ?rt [T:*x] [T:*y]) (holds ?rt ?y [T:*z]) [THEN: (holds ?rt ?x ?y) ]]]] KIF: (exists ((?t transitivity)) (forall ((?rt binaryRelationType) ?x ?y ?z) (=> (chrc ?rt ?t) (=> (and (holds ?rt ?x ?y) (holds ?rt ?y ?z)) (holds ?rt ?x ?z))))) RDF: <forall var="r" v2="x" v3="y" v4="z"> <!-- v2,v3,v4: new attributes --> <if><rdf:Description about="#rt"><chrc><transitivity/></chrc> </rdf:Description> <then><if><rdf:Description about="#x"> <rdf:property pname="#rt"><!-- pname: new attribute --> <rdf:Description about="#y"> <rdf:property pname="#rt"><rdf:Description about="#z"/> </rdf:property></rdf:Description> </rdf:property></rdf:Description> <then><rdf:Description about="#x"> <rdf:property pname="#rt"><rdf:Description about="#z"/> </rdf:property></rdf:Description> </then></if></then></if></forall>

In the CGLF sentence, we have used '&' to specify the mapping from the relation type rt to a free variables referring to a relation of type rt. [Sowa, 1993] uses the greek character rho but this is not a character easy to enter with usual keyboards. An alternative would be to keep the variable re-use prefix '?' since the location of the re-use (i.e. within a relation node) seems sufficient to highlight the special semantic. We have adopted this second solution in FE and FCG (in the example, '^' is used instead of '?' or '*' because a free variable is used, i.e. an implicitly universally quantified variable). In the CGIF sentence, since the current CGIF syntax does not permit variables for relation types, we have used a universal quantifier and the relation type holds as in the KIF representation.

To permit a variable to refer to a relation type, the RDF sentence uses another extension to XML from Berners-Lee: the pname attribute. The additional variable names v2, v3, v4 in the forall construct also comes from Berners-Lee.



Declarations and Definitions

In RDF, a category is uniquely identified by a URI, e.g. http://www.foo.com and http://www.bar.com/doc.html#car. In a multi-user KB system such as WebKB-2, user identifiers are more convenient knowledge source identifiers than document URIs. Thus, in WebKB-2, a category identifier can be not only a URI or an e-mail address but also the concatenation of the knowledge provider's identifier and a key name, e.g. wn#dog and pm#IR_system (``wn'' refers to WordNet 1.6 and ``pm'' is the login name of the user represented by the category spamOnly@phmartin.info). In this third case, the category may still be referenced from outside the KB by prefixing the identifier with the URL of the KB, e.g. http://www.webkb.org/kb/wn#dog.
This identifier encoding is used for all the input/output notations used in WebKB-2 (FCG, FE, KIF, CGIF, CGLF) except for RDF/XML where URIs have to be used.

In addition to an identifier, a category may have various names (which may also be names of other categories). In FE and FCG, a category identifier may show all the names given by the category creator, e.g. wn#dog__domestic_dog__Canis_familiaris (at least two underscores must be used for separating the names).

WebKB-2 proposes a special notation for declaring categories and links (i.e. second-order relations) between them: the "For Taxonomy" (FT) notation. It is an extension of the special notation used in CGLF for specialization links between categories. Hence, in the following example, we use FT instead of FE, FCG and CGLF.
For the RDF representation, the categories created by the user "pm" are supposed to be declared in the same document (otherwise the prefix "http://www.webkb.org/kb/pm#" must be added to the referred resources).
For the KIF representation, we have chosen to use relation types from RDF, RDFS and DAML+OIL rather than from the Frame-ontology and OKBC-ontology of the Ontolingua library, in order to ease the comparison of the notations.
Instead, for the CGIF representation, we have used special relation types (see the words in uppercase) and hence extended the CGIF grammar because this is more in the spirit of the notation (it is supposed to be a higher-level notation than KIF or RDF/XML and hence already incorporates many special categories such as EQ, GT and LT; such special cases also ease semantic checking and inferencing). We have also used the same syntactic sugar as in FT to delimit subtype partitions. Click here for more details on the rationales and the grammar of our extensions to CGIF.

FT: pm#thing__top_concept_type (^thing that is not a relation^) 29/11/1999 _ chose (oc fr), ^ rdfs#class, > {(pm#situation pm#entity)} pm#thing_playing_some_role, ! pm#relation, = sowa#T; CGIF: [TYPE: pm#thing *x ;thing that is not a relation;] (CREATOR ?x spamOnly@phmartin.info) (CREATION_DATE ?x 29/11/1999) (NAME ?x "thing") (NAME ?x "top_concept_type") (NAME_BY_IN ?x "chose" Olivier.Corby@sophia.inria.fr wn#french) (KIND ?x rdfs#class) (GT ?x {pm#situation pm#entity}) (GT ?x pm#thing_playing_some_role) (EXCL ?x pm#relation) (EQ ?x sowa#T) KIF: (defrelation pm#thing ()) (rdfs#class pm#thing) (pm#name pm#thing "thing") (pm#name pm#thing "top_concept_type") (pm#nameWithCreatorAndLanguage pm#thing "chose" Olivier.Corby@sophia.inria.fr wn#french) (dc#Creator pm#thing spamOnly@phmartin.info) (dc#Date pm#thing "29/11/1999") (rdfs#comment pm#thing "thing that is not a relation") (daml#disjointUnionOf pm#thing '(pm#situation pm#entity)) (rdfs#subClassOf pm#thing_playing_some_role pm#thing) (daml#disjointWith pm#thing pm#relation) (= pm#thing sowa#T) RDF: <rdfs:Class rdf:about="http://www.webkb.org/kb/pm#Thing"> <rdfs:label>thing</rdfs:label> <rdfs:label>top_concept_type</rdfs:label> <rdfs:label xml:lang="fr" dc:creator="Olivier.Corby@sophia.inria.fr">chose</rdfs:label> <dc:Creator>spamOnly@phmartin.info</dc:Creator> <dc:Date>29/11/1999</dc:Date> <rdfs:comment>thing that is not a relation</rdfs:comment> <rdf:type rdf:resource="http://www.w3.org/TR/rdf-schema#Class"/> <daml:disjointUnionOf rdf:parseType="daml:List"> <daml:Class rdf:about="#Situation"/> <daml:Class rdf:about="#Entity"/></daml:disjointUnionOf> <daml:disjointWith rdf:resource="#relation"/> <daml#sameClassAs rdf:resource="http://www.webkb.org/kb/sowa#T"/> </rdfs:Class> <rdfs:Class rdf:about="#Thing_playing_some_role"> <rdfs:subClassOf rdf:about="#Thing"/> </rdfs:Class>

In FT, the creator of a link is left implicit when it is the same as the creator of the category source of the link. Otherwise, the creator has to be specified within parenthesis (as illustrated above for the name "chose"). To represent link creators in the other notations, either relations with arity higher than two must be used (as illustrated above) or contexts.
Here is an example similar to the previous one but about a relation type.

FT: pm#kind__type (*,rdfs#class) = rdf#type, < dc#type, - pm#instance; CGIF: [TYPE: pm#kind *x] (CREATOR ?x spamOnly@phmartin.info) (NAME ?x "type") (RANGE ?x rdfs#class) (EQ ?x rdf#type) (LT ?x dc#type) (REVERSE ?x pm#instance) KIF: (defrelation pm#kind (?x ?y) :<= (rdfs#class ?y)) (rdf#property pm#kind) (pm#name pm#kind "kind") (pm#name pm#kind "type") (= pm#kind rdf#type) (rdfs#subClassOf pm#kind dc#type) (daml#inverseOf pm#kind pm#instance) RDF: <rdf:Property rdf:about="http://www.webkb.org/kb/pm#kind"> <rdfs:label>kind</rdfs:label> <rdfs:label>type</rdfs:label> <dc:Creator>spamOnly@phmartin.info</dc:Creator> <rdfs:range rdf:resource="http://www.w3.org/TR/rdf-schema#Class"/> <daml:samePropertyAs rdf:resource="http://www.w3.org/TR/REC-rdf-syntax#Type"/> <rdfs:subPropertyOf rdf:resource="http://purl.org/metadata/dublin_core#type"/> <daml:inverseOf rdf:resource="#instance"/> </rdf:Property>

The links used in the above two RDF representations can be considered as special cases of definition of necessary conditions for the source categories (although links of type daml#sameClassAs, daml#inverseOf and daml:disjointUnionOf actually define necessary and sufficient conditions). With the same namespace conventions as above, here is a more general case of definition of necessary conditions.

E: According to "pm", by definition, a person has for parent a person. FCG: [type pm#person (*x) :=> [*x, pm#parent: a pm#person] ] CGLF: [TYPE: pm#person]->(LT)->[(lambda(*x) [?x]->(pm#parent)->[pm#person])] CGIF: (LT pm#person (lambda (T*x) (pm#parent ?x [pm#person]))) KIF: (defrelation pm#person (?p) :=> (exists ((?p2 pm#person)) (pm#parent ?p ?p2))) RDF: <rdfs:Class rdf:ID="Person"> <rdfs:subClassOf><daml:Restriction> <daml:onProperty rdf:resource="#parent"/> <daml:toClass rdf:resource="#Person"/> </daml:Restriction></rdfs:subClassOf></rdfs:Class>

For definitions of sufficient conditions, GT and :<= may be used instead of LT and :=>. In RDF/XML, the rdfs:subClassOf links must be reversed. For definitions of necessary and sufficient conditions, EQ, := and daml#sameClassAs may be used.

The CG standard is quite incoherent and restrictive about lambda-abstractions and type definitions in CGLF and CGIF. The above proposal is the closest generalization we have found. We took into account the possible need for contextualizing the definition themselves: with the CGLF usual syntax for type definition by necessary and sufficient conditions (as in type pm#red_car is [pm#car]->(pm#chrc)->[pm#red]), contextualization cannot be done (unless the grammar is extended to accept such definitions as embedded graphs).

The CG standard does not specify how to define functional relations (actors) in CGLF and CGIF, just how to use them. An example of notation can be found in [Sowa, 1993]. We adapted it in the following example: we have preferred to use the [IF: ...] constructs rather than Sowa's ternary relation < (with a boolean as third parameter) and quadrary relation cond (with a boolean as first parameter).
Function definitions do not exist in RDF. We use forall constructs instead, as suggested by Berners Lee.

E: The length of a list is 0 if the list is empty, otherwise, 1 + the length of the list without its first element FCG: [function length (list *l) :-> natural *r := [if [l = nil] then [*r = 0] else [*r = 1 + length(rest(*l))] ]] CGLF: [function length (list *l, natural *n) [IF: [?l]->(EQ)->[list:nil] [THEN: [?n]->(EQ)->[number:0] ] [ELSE: [?l]-><rest>->[list]-><length>->[natural]-><plus1>->[?n] ] ] CGIF: [function length (list *l, natural *n) [IF: (EQ ?l nil) [THEN: (EQ ?n [number:0])] [ELSE: (rest ?l [list:*l2]) (length ?l2 [natural:?n2]) (plus1 ?n2 ?n)] ]] KIF: (deffunction length (?l) := (cond ((= ?l nil) 0) ((list ?l) (1+ (length (rest ?l)))))) RDF: <forall var="l"><exists var="n"> <if><daml:list about="#l"> <daml:sameIndividualAs rdf:resource="http://www.daml.org/2001/03/daml+oil.daml#nil"/> </daml:list> <then><rdf:Description about="#n"> <daml:sameIndividualAs>0</daml:sameIndividualAs> </rdf:Description></then> <else><exists var="l2" v2="n2"> <daml:list about="#l"> <rest><daml:list about="#l2"> <length><natural about="#n2"><plus1 resource="#n"/> </natural></length></daml:list> </rest></daml:list></exists></else> </if></exists></forall>


KIF also has two built-in operators (listOf and setOf) to assemble and decompose lists and sets; e.g.:
(deffunction first (?):= (if (= (listof ?x @items) ?l) ?x)|.
The other notations need to be extended with such operators.



Conclusion

Although we have used all the notations in all the presented cases, we often had to use syntactical or ontological extentions for CGLF, CGIF and RDF/XML. We have not encountered problems with KIF, nor with FE and FCG (plus FT) since we have designed them to provide a high-level notation for (at least) all these cases. However, we hope to have shown that these two notations are, in some senses, more "intuitive and complete" than CGLF, CGIF and RDF/XML. We also hope that this document will be an inspiration for extensions in other notations and hence permit more knowledge representation, translation, exchange and re-use.



Bibliography

J.F. Sowa (1992). Conceptual Graphs Summary. In: Conceptual Structures: Current Research and Practice (Eds: T.E. Nagle, J.A. Nagle, L.L. Gerholz and P.W. Eklund), Ellis Horwood (1992), pp. 3-51.

J.F. Sowa (1993). Relating Diagrams to Logic. In Proc. of ICCS'93 (Eds: G.W. Mineau, B. Moulin and J.F. Sowa), LNAI 699, pp. 1-35.