Examples of knowledge representations
print '
Declaration of top-level concept types, plus ordering of these types via the predefined "partition" relation
'; //Notes: 1) a partition is a collection of exclusive subtypes, i.e. subtypes //that cannot have common subtypes or instances; 2) the type Thing is //predefined as the supertype of all concept types; thus, if a new type //is (automatically or explicitly) declared, it should be a subtype of Thing [Thing (*the supertype of all first order concept types*), partition: { {Entity, Situation}, {Something_playing_a_role} }]. [Situation (*type of things that occur in a region of time and space*), partition: {{State, Process},{Phenomenon},{Situation_playing_a_role}}]. [Process, subtype: Event(*an event is a process the duration of which is considered nearly instantaneous for the application, e.g. in astronomy, the explosion of a star*)]. [Entity (*type of things that can be involved in a situation*), partition: { {Information_entity, Temporal_entity, Spatial_entity}, {Collection}, {Entity_playing_a_role} }]. [Spatial_entity (*type of entities that occupy a space region*), partition:{{Space_location, Physical_entity, Imaginary_spatial_entity}, {Spatial_entity_with_a_remarkable_characteristic}}]. [Physical_entity (*type of spatial entities made of matter*), partition: { {Inanimate_object, Living_thing}, {Goal_directed_entity(*a cognitive entity*)} }]. [Information_entity (*type for the information or its representations*), partition: { {Description, Descr_container, Characteristic, Measure, Measure_unit} }]. [Description (*description of a situation*), partition: { {Description_content, Description_medium} }]. [Description_content, partition: { {Belief, Hypothesis, Narration, Argument} }]. [Description_medium, partition: {{Symbol,Syntax,Language,Abstract_data_type,Script}}]. [Description_container, partition: { {File, Image, Hologram, Document_element} }]. [Characteristic (* a dimension of something *), partition: {{Psychological_characteristic, Physical_characteristic, Situation_characteristic}}]. [Physical_characteristic, partition: {{Mass, Length, Form, Color}}]. [Measure, partition: {{Psychological_measure, Physical_measure,Situation_measure}}]. [Measure_unit, partition: {{Psychological_measure_unit, Physical_measure_unit,Situation_measure_unit}}]. [Physical_measure_unit, partition: {{kg,m,cm,mm}}]. print "
Declaration of relation types plus some of their connections to concepts
"; [any thing, descr <= a description, //any thing can be abstracted/represented descr_in<= a descr_container, //e.g. in a file, an hologram, a software part <= a thing, //any thing can have at least 1 part chrc <= a characteristic //and characteristic(s), e.g. a length ]. [any characteristic, measure <= a measure, //any characteristic can be measured chrc of <= a thing //and can be the characteristic of things ]. [any measure, quantity: a number, //(note: the measure of an object's unit: a measure_unit, // characteristic may be unknown) measure of: a characteristic ]. [any description, //in Logic, it is called a "proposition" descr of : a thing, //a description is about something descr_medium : a descr_medium, //it uses symbols or a language descr_container: a descr_container,//it is stored, e.g. in a file author : 1 entity, //any description has a unique author believer <= a cognitive_agent, //it may have some believers modality <= a modality, //it may be put in context logical_relation <=a description,//and connected to other descriptions rhetorical_relation<=a description //by logical or rhetorical relations ]. [any descr_container, descr_support: a physical_entity, descr_in of: a thing]. [any descr_medium, descr_medium of: a thing]. [ [a thing *t, descr_in: a descr_container *c], <=> [*t, descr: (a description, descr_container: *c)] ]. [any situation, s_succ of: a situation, //any situation follows (an)other one(s) s_succ : a situation, //and is followed by (an)other one(s) location : a spatial_entity, //a situation occurs somewhere time : a temporal_entity, //and at a time (even an imaginary situation) situationChrc<= a situation_characteristic ]. [any process, triggering_event<= an event, ending_event <= an event, ending <= a state, ending of <= a state, precondition <= a state, postcondition <= a state, agent <= an entity, initiator <= a goal_directed_agent, instrument <= an entity, object <= a thing, experiencer<= a conscious_agent, recipient <= an agent, result <= a thing, sub_process<= a process, method <= a description, manner <= a situation_characteristic, source <= a spatial_entity, destination<= a spatial_entity, path <= a spatial_entity ]. [any collection, subset <= a collection, element<= a thing, count : a natural ]. [any temporal_entity, time of <= a situation, duration of <= a situation ]. [any physical_entity, physChrc <= a physical_characteristic]. [any goal_directed_entity, physChrc <= a psychological_characteristic]. print '
Ordering of relation types via the predefined relation "subtype", plus declaration of the relation types which had not yet been declared
'; [Result, domain: Process, range: Thing, subtype: Output]. [Object, domain: Process, range: Thing, subtype: {Input,Input_output}]. [Input, domain: Process, range: Thing, subtype: {Material, Parameter, Static_input, Dynamic_input}]. [Input_output, domain: Process, range: Thing, subtype: {Object_to_modify, Object_to_mute}]. [Logical_relation, subtype: {Or,Xor}]. [Order_relation, domain: Thing, range: Thing, subtype: {Meet,In,Near,Before,After,Above,Under}]. [On, subtype of: {Meet,Above}]. print '
Declaration of additional concept types for the examples below
'; //When the type of an undeclared concept cannot be infered via the //signature of a relation connected to it (e.g. if there is no relation //or the relation is also undeclared), print an error message and abort. //Otherwise, the type of the concept or the relation must be inferred. [Living_thing, subtype: {Animal,Plant}]. [Animal, subtype: {Person, Cat, Dog}]. [Person, partition: {{Man,Woman}}]. [Pet, subtype of: Entity_playing_a_role]. [Pet_dog, subtype of: {Pet, Dog}]. [Part, chrc: transitive]. print "
Simple FCGs (and declaration of individuals)
"; [the cat Tom, on: a mat]. [the person Mary, agent of: (a liking, object: Mary) ]. [a good cat Tom, on: a big mat]. [a person *p, agent of: (a liking, object: *p) ]. //coreference via a variable print "
Collections
"; [the pages {http://foo.org/foo.html, http://bar.org/bar.html}, creator: Ora_Lassila]. [the resolution, approver: (a committee, member: {Fred,Wilma}) ]. [together {John, Mary}, owner of: a house]. [2 professors, agent of: (a teaching, object: 3 courses) ]. [3 courses, object of: (a teaching, agent: 2 professors) ]. [together at least 2 of {John, Mary}, agent of: (an owning, object: a house)]. [X11_source_code, distributionSite: {ftp://ftp.x.org | ftp://ftp.eu.net}]. [a cat, between: {a mouse *m, (a den, owner: *m)}]. print "
Collections and types
"; [{Tom,Bianca,Yojo}, type:Smoker]. [Joe, type:Smoker, type:Driver]. [any person, part: at most 2 legs]. [any parisian, lover of: {Paris, Lyon}]. [most cats, owner: a person]. [any file "http://foo.org/doc*", copyright: "Foo"]. [2 files "http://foo.org/doc*", copyright: "Foo"]. print "
Contexts
"; ["http://www.w3.org/Home/Lassila", creator: Ora_Lassila](speaker: Ralph_Swick). [ ["http://www.w3.org/Home/Lassila", creator: Ora_Lassila], speaker: Ralph_Swick]. [a telling, time:Yesterday, agent:Paul, recipient:Mary, object: (Denise, agent of: (knowing, object: [Denise,chrc:a great naiveness]) ) ](author: x). [a telling, time:Yesterday, agent:I, recipient:Peter, object: *p [Denise, agent of: [working, city:Toronto] ](time:last_year) ]. [a thinking, agent:I, object: ~[*p]]. [ [Denise, psyChrc:pragmatic], situationChrc:fortunate]. print "
Implications
"; [ [an airport *x, departure of: (a flight, destination: an airport *y)], => [*x, flightTo: *y] ]. [ [an airport *x, flightTo: (an airport, flightTo: an airport *y)], => [*x, flightTo: *y] ]. [ [a type *x, subtype: a type *y], => [*y, subtype of: *x] ]. [ [a person *p, uncle: a person *u], => [*p,parent:(a man,brother:*u) ] ]. [ [a person *p, part: a thing *p1], => [*p, parent: (a man, part: a thing *p2!=*p1)] ]. [ [a person *p, ancestors: *v1 {*}], <=> [*p, son: (a person, ancestors: ({*}, subset of: *v1) ) ] ]. [ [a thing *x, gte: (a thing *y, gte: a thing *z) ], => [*x, gte: *z] ]. print "
FCGs representing complex sentences
"; [ [a play *p, author: Agatha_Christie, name: "Witness for the Prosecution", summary (author: Rudolph_Wille): [a girl *g, agent of: an appearance, agent of: (a disclosing, object: [Leonhard, girlfriend:*g]) ] ], succ: [ [an explanation, agent: Leonhard, recipient:Romaine, object: [ [a leaving, agent: Leonhard, object: Romaine], cause: [a whishing, agent: Leonhard, object: [a living, agent: Leonhard, accompaniment: *g] ] ] ], succ: [a killing, agent: Romaine, object: Leonhard, instrument: a ham-knife] ] ]. [a group of several (officials, instance of: Columbian), destination of: (a receiving, object: a group of millions of dollars, source: (a cartel, location: Cali, psyChrc: infamous, agent of: (a selling, object: some cocaine) ) ) ](period: past_period). [a group of Yakuza, agent of: (a making, object: {[an alliance, subset: several Yakuza *y, subset: (several triads *t, member: several chineses), subset: (several cartels *c, member: several columbian, agent of: (a selling, object: some drug) ) ], [the group of {*y,*t,*c}, agent of: a work]} ) ](period: past_period). print "
Examples of queries without path specifications
"; spec Entity; spec [an entity]; spec [a spatial_entity, order_relation: a spatial_entity]; spec [a cat, above: a spatial_entity]; spec [a cat, on: a mat]; spec [a process, time:Yesterday, agent: a person]; print "
Examples of queries with path specifications
"; spec [a process, (relation: a thing)+ agent of: a process]; spec [a process, (agent of:)1 | (object: an entity)* chrc: a great naiveness]; spec [a person, (agent of:)1 object: a person]; spec [a cat, (relation<=)* above: a spatial_entity]; print "
Examples of the use of aliases (not yet parsed)
"; alias un a; alias tout any; alias tapis mat; alias chat cat; [un chat, on: un tapis]. //-> [a cat, on: a mat]. alias chat "cat,"; [un chat on: un tapis]. //-> [a cat, on: a mat]. alias <= "on:"; [un chat <= un tapis]. //-> [a cat, on: a mat]. alias sur "on <="; [tout chat sur un tapis]. //-> [any cat, on <= a mat].