7.3.7 Conflict-act

Introduction

Here we give some examples of ontology-driven searches.

Example

//
//  CONFLICT ACT EXAMPLE
//
//       Based on Henrik Scharfe's formalization of the Gideon-story
//       from Judges 6-8 in the Bible.
//
//       Ulrik Petersen
//       Created: September 13, 2003
//       Last update: September 13, 2003

// Type hierarchy
Entity > Physical.
Physical > Object, Collection, Process.
Object > Rock, Person, Winepress.
Collection > People_group, Men.
Process > Act.
Act > Conflict_act.
Conflict_act > Kill, Pursue.

// Catalog of instances
Men = Ephraim.
Person = Oreb, Zeeb.
Rock = Rock_of_Oreb.
Winepress = Winepress_of_Zeeb.
People_group = Midian.

// The men of Ephraim killed Oreb at the Rock of Oreb.
jud7(verse25b,
   [Kill]-
      -agnt->[Men : Ephraim],
      -ptnt->[Person : Oreb],
      -loc->[Rock: Rock_of_Oreb]).
                   
// The men of Ephraim killed Zeeb in the winepress of Zeeb.                                                             
jud7(verse25c,
   [Kill]-
      -agnt->[Men : Ephraim],
      -ptnt->[Person : Zeeb],
      -loc->[Winepress: Winepress_of_Zeeb]).

// The mean of Ephraim pursued Midian.
jud7(verse25d,
   [Pursue]-
       -agnt->[Men : Ephraim],
       -ptnt->[People_group : Midian]).

// Rules

// Connect Chapter 7 together into one predicate
judges(7, v, G) :- jud7(v, G).

// Conflict act
// returns agent (s1), action (a), and ptnt (s2) of conflict-acts.
conflict(c,v,s1,a,s2) :-
   judges(c,v,g),   // Get the chapter, verse, and graph
   subsume([Conflict_act]-
              -agnt->[Entity],
              -ptnt->[Entity], g),  // Make sure there is a conflict-act in g
   branchOfCG([Conflict_act]-agnt->[r : s1],g),  // Get the agnt (s1)
   branchOfCG([Conflict_act]-ptnt->[s : s2],g),  // Get the patient (s2)
   branchOfCG([a]-agnt->[r : s1], g),  // Get the conlict-act
   isSubType(a, Conflict_act).  // Make sure it is a conflict-act

Usage

If we ask the query:

?- conflict(c,v,s1,a,s2).

We get the following answer:

{c = 7, v = verse25b, s1 = Ephraim, a = Kill, s2 = Oreb}
{c = 7, v = verse25c, s1 = Ephraim, a = Kill, s2 = Zeeb}
{c = 7, v = verse25d, s1 = Ephraim, a = Pursue, s2 = Midian}


PrevLite: 7.3.6 concOfCG
NextLite: 7.3.8 Reusing predicates

Prev: 7.3.6 concOfCG
Up: 7.3 Examples
Next: 7.3.8 Reusing predicates