Representing Anthropological Knowledge: Calculating Kinship | |
Michael D. Fischer |
Analyzing and Understanding Cultural Codes
|
Kinship Contents
|
Reporting Genealogical Relationships
In the previous section we defined some extended genealogical relationships that included some of the following: mm(X,Y) :- m(Z,Y),m(X,Z). This is rather long-winded, since we are not capturing much of the regularity of the terms. We will keep to this schema however, to simplify the example. For a more elegant version, consult an extended example extracted from Chapter 7 of Applications in Computing for Social Anthropologists, Michael Fischer, 1994, Routledge, London. Finding relationships between people So far our examples will report people who have a specific relationship. Often we want to do the reverse, find all the relationships involving a single person. This is relatively straightforward if we have already defined the relationhsips we want to report. There are many approaches. We will continue with a simple, if repetitive approach. If we define a series of rules like the following:
The relate rule simply says, if the relationship on the right hand side holds, then this rule is true. This will have the effect of 'reporting' the relationship in the third position of the relate rule. We can get a report of relationships to a person by using the query: relate(X,mike,Rel). Clicking the 'Do Query' button will list any relationship mike has to anyone in the database, if that relationship has been defined by a) creating a rule for the relationship, and b) creating a corresponding relate rule. Following is a prolog example which defines the compound relationships above, the relate rules above, and some more in the top frame. Try some of these out, by typing in a query (to the right of the "Do Query" button) replacing the name mike in 'relate(X,mike,Y).' to some other name, and then clicking on the 'Do Query' button. You can also enter relate(X,mike,Y), for all people mike is related to, relate(X,Y,Z). for all relationships, and relate(X,Y,"ff") for all ff relationships. Some of these will take a long time, since we have not optimised this program except for relationships to ego. As an exercise, write a few relate clauses for mz, fz, fb, fzh, mbw, sc, dc,sw,dh. You can test your definitions by typing in a query (to the right of the "Do Query" button) replacing the 'mm(X,Y).' that is there.
Next section: Terminologial rules Note for writing rules: When writing your rules pay attention to two things: 1) make sure where you intend a variable for prolog to 'fill-in' with a name, that you use an upper-case letter for the variable name (A-Z), and 2) end your rule with a full-stop ('.'). This is VERY important. If you get things into too big a mess, you can reload the page by clicking on the reload button of the browser while holding down the option key on a Macintosh, or the ALT key under Windows or Unix. The correct answers are incorporated into the program in next section. Next section: Terminologial rules |