<?xml-stylesheet type="text/xsl" href="extremehtml.xsl"?>
<!DOCTYPE paper SYSTEM "extremepaperxml.dtd" [
<!ENTITY dodd090901 SYSTEM "dodd090901.jpeg" NDATA jpeg>
<!ENTITY dodd090902 SYSTEM "dodd090902.jpeg" NDATA jpeg>
<!ENTITY dodd090903 SYSTEM "dodd090903.jpeg" NDATA jpeg>
<!ENTITY dodd090904 SYSTEM "dodd090904.jpeg" NDATA jpeg>
<!ENTITY dodd090905 SYSTEM "dodd090905.jpeg" NDATA jpeg>
<!ENTITY dodd090907 SYSTEM "dodd090907.jpeg" NDATA jpeg>
<!ENTITY dodd090908 SYSTEM "dodd090908.jpeg" NDATA jpeg>
<!ENTITY dodd090909 SYSTEM "dodd090909.jpeg" NDATA jpeg>
<!ENTITY dodd090910 SYSTEM "dodd090910.jpeg" NDATA jpeg>
<!ENTITY dodd090911 SYSTEM "dodd090911.jpeg" NDATA jpeg>
<!ENTITY dodd090912 SYSTEM "dodd090912.jpeg" NDATA jpeg>
<!ENTITY dodd090913 SYSTEM "dodd090913.jpeg" NDATA jpeg>
<!ENTITY dodd090914 SYSTEM "dodd090914.jpeg" NDATA jpeg>
<!ENTITY dodd090915 SYSTEM "dodd090915.jpeg" NDATA jpeg>
<!ENTITY dodd090917 SYSTEM "dodd090917.jpeg" NDATA jpeg>
<!ENTITY dodd090918 SYSTEM "dodd090918.jpeg" NDATA jpeg>
<!ENTITY dodd090919 SYSTEM "dodd090919.jpeg" NDATA jpeg>
<!ENTITY dodd090920 SYSTEM "dodd090920.jpeg" NDATA jpeg>
<!ENTITY dodd090921 SYSTEM "dodd090921.jpeg" NDATA jpeg>
<!ENTITY dodd090922 SYSTEM "dodd090922.jpeg" NDATA jpeg>
<!ENTITY dodd090923 SYSTEM "dodd090923.png" NDATA png>
<!ENTITY dodd090924 SYSTEM "dodd090924.png" NDATA png>
<!ENTITY dodd090925 SYSTEM "dodd090925.jpeg" NDATA jpeg>
<!ENTITY dodd090926 SYSTEM "dodd090926.png" NDATA png>
<!ENTITY dodd090927 SYSTEM "dodd090927.jpeg" NDATA jpeg>
<!ENTITY dodd090928 SYSTEM "dodd090928.jpeg" NDATA jpeg>
<!ENTITY dodd090929 SYSTEM "dodd090929.jpeg" NDATA jpeg>
<!ENTITY dodd050501 SYSTEM "dodd050501.jpeg" NDATA jpeg>
<!ENTITY dodd050502 SYSTEM "dodd050502.jpeg" NDATA jpeg>
<!ENTITY dodd050503 SYSTEM "dodd050503.jpeg" NDATA jpeg>
<!ENTITY dodd050504 SYSTEM "dodd050504.jpeg" NDATA jpeg>
<!ENTITY dodd050505 SYSTEM "dodd050505.jpeg" NDATA jpeg>
<!ENTITY dodd050506 SYSTEM "dodd050506.jpeg" NDATA jpeg>
<!ENTITY dodd050507 SYSTEM "dodd050507.jpeg" NDATA jpeg>
<!ENTITY dodd050508 SYSTEM "dodd050508.jpeg" NDATA jpeg>
<!ENTITY dodd050509 SYSTEM "dodd050509.jpeg" NDATA jpeg>
<!ENTITY dodd050510 SYSTEM "dodd050510.jpeg" NDATA jpeg>
<!ENTITY dodd050513 SYSTEM "dodd050513.jpeg" NDATA jpeg>]>

<paper>
<front>
<title>Meta-Programming the Placement of Aspect Concerns and Advice Using Ontologies</title>
<subt>Computer Use of Metaphor Processing Augments Their Programming</subt>
<conference>Extreme Markup Languages 2005</conference>
<author>
  <fname>David</fname><surname>Dodds</surname>
  <address>
    <affil>Open-Meta Computing</affil>
    <email>drdodds@open-meta.com</email>
    <web>www.open-meta.com</web>
  </address>
  <bio><para>Bio: David Dodds has worked with computers since 1968, when he wrote Continuous Systems Models
(CSMP) on IBM mainframe computers at university. Later he worked at Nortel (Northern Telecom
Bell Northern Research) where he designed and developed graphical interfaces and scientific and
technical visualization systems, and wrote text understanding software, these were in-house projects to
allow extraction of content from telephony specification documents for use by graphical-interface
programs, and he also wrote expert systems in C and Prolog. Prior to that, in university environments,
he programmed a speech synthesis system; which produced the first ever machine spoken Coast Salish;
and designed and developed technical scientific models and simulations; including a simulated town
council in a continuous system Forrester Limits to Growth model. He was Sessional Lecturer and taught
computing science in a university computing science department.</para>
<para>He has been working the last several years
on the various emerging XML technologies, was on the W3C SVG (Scalable Vector Graphics) workgroup to develop the 
specification for SVG 1.0, and on the Idealliance committee to develop XML Topic Map (XTM) specifcation.
David has published numerous papers in robotics and on fuzzy systems. Two of these papers were published in
the SPIE proceedings Space Station Automation III. He was lead-author of the book
WROX Professional XML Meta Data. He also worked as technical reviewer for Kurt Cagle&rsquo;s SVG
book. He has presented a number of papers on XML SVG and RDF, Intelligent and Content Aware
Graphics Systems.</para><para>
David presented two papers at SVGOpen 2003, one on Accessing SVG Content Linguistically and Conceptually,
the other on Programming SVG Advanced Access Using Metadata and Fuzzy Sets. He presented a paper,
Natural Language Processing and Diagrams, about the use of ontologies and logic, at The 2004 International
Conference on Machine Learning; Models, Technologies and Applications; which is a part of The 2004 International
Multiconference in Computer Science and Computer Engineering. David's paper, Extending Representation Capability 
(Representation Extention Through the Corresponding Metaphor Process) was in the Extreme 2004 conference proceedings.
He presented a paper, Components of Meta-Programming, Computer Analogies and Metaphors, at The 2005 International 
Conference on Programming Languages and Compilers which is a part of The 2005 International MultiConference in
Computer Science and Computer Engineering.</para></bio>
</author>
<keywords>
  <keyword>representation</keyword>
  <keyword>ontology</keyword>
  <keyword>context and situation</keyword>
  <keyword>metaphor in science and technology</keyword>
  <keyword>transfer and corresponding metaphor process cmp</keyword>
</keywords>
<abstract>
  <para>There are a number of means to accomplishing meta-programming of digital computers. Meta-programming is 
  programming about programming. Examples of meta-programs are compilers and schedulers. Two elements in the arsenal of
  meta-programming techniques are reflection and aspect oriented programming. Reflection gives the programming the ability
  to functionally inspect itself so as to see its own components and possibly to operate them as well. A meta-program with
  component knowledge, such as the constituent programming language, can use reflection to modify the behaviour of that
  body of code toward a goal end (rather than necessarily having that done by a human). Aspect oriented meta-programming
  can use knowledge of code morphology (like join points) to add modular code elements to programs so as to add capability
  which affects the code body across its breadth rather than just in-line sequentially. Logging (activation records) is such
  a capability.</para>
  <para>Ontologies are a means of representing knowledge, the semantics of terms. An ontology can provide knowledge of spatial
  concerns and concommitant logic can provide details of how to perform needed operations, such as knowing how to scan for
  spatial concerns and being able to recognize them once there. This can be done employing procedural know-how and the
  meta-programming system uses this know-how intelligently by implementing "knowing that".(which may be achieved by monitoring
  the activation record, simple introspection of activity).</para>
</abstract>
<copyright>© David Dodds 2005</copyright>
</front>
<body>
  <section><title>Background</title>
  <randlist style="bulleted"> 
      <title><highlight style="under">The Most Important Idea In This Paper</highlight></title> 
      <li> 
       <para>- Aspect oriented programming concepts like <highlight style="ital">cross-cutting</highlight>,
       <highlight style="ital">point cuts</highlight> and <highlight style="ital">join points</highlight> are 
       <highlight style="bold">spatial metaphors</highlight>, which can be processed via a 
       <highlight style="bold">meta-programming</highlight> system which includes metaphor / analogy 
       processing in addition to literal (code) text processing.</para> 
      </li> 
    </randlist>
  
    <para><verbatim>http://www.open-meta.com

</verbatim></para>

<figure anchor="fixed">  
        <title>Some will consider that there are too many notes (too much code) in this paper. The code is there to
        show how things are implemented and to try to avoid "step two" in the illustration, which is what a bunch of 
        wordy handwaiving would be without the "proof" (how-to) of the code.</title>
        <graphic figname="dodd050513" scale="10%"/>
</figure>

<para>This paper is about "aspects" and placing them in Java code using AspectJ. The paper is about
representation and metaphor / analogy and how the techniques of reflection and aspects may be processed by means of 
a meta-programming system. This paper is about the productive or gainful use of metaphors and analogies by computers.
Spatial metaphors and analogies are the main vehicle discussed here. We are not talking about Shakespeare metaphors 
nor about literature studies. We are talking about science metaphors like <highlight style="ital">black hole</highlight>, 
<highlight style="ital">event horizon</highlight>, <highlight style="ital">dark matter</highlight>,
<highlight style="ital">gravity well</highlight> and <highlight style="ital">curved space</highlight>.
 To make the progression of the paper obvious the progression is stated here.</para>

<para>The next sections provide information about a series of subtopics of the paper so that the reader may follow the
progression presented and know the background information required to provide an understanding of the paper overall.</para>

<seqlist style="bulleted"> 
      <title><highlight style="under">The next sections talk about</highlight></title> 
      <li> 
       <para>- examples of the <highlight style="bold">Meta-Programming</highlight> technology: -- this is shown so that one 
       can see how Meta-Programming code is used to perform (self) introspection and (self) modification at run-time.</para> 
      </li>
      <li> 
       <para>- examples of the <highlight style="bold">Java Reflection</highlight> technology: -- this is shown so that one 
       can see how Java Reflection code is used to perform (self) introspection and (self) modification at run-time.</para> 
      </li>
      <li> 
       <para>- <highlight style="bold">AspectJ</highlight> aspect-programming language: -- several examples of actual AspectJ
        programming.</para> 
      </li>
      <li> 
       <para>- an example of structure mapping information.</para> 
      </li>
      <li> 
       <para>- an example subset of the <highlight style="bold">OpenCyc</highlight> ontology: -- this is shown so that one 
       can see how ontological definitions of (physiological) aspects of the human body may provide knowledge to a computer
       system, including location.</para> 
      </li> 
      <li> 
       <para>- an example subset of the <highlight style="bold">Daxsvg</highlight> ontology: -- this is shown so that one 
       can see how ontological definitions of spatial aspects of the conceptual / visual world may provide knowledge to a
       computer system, including location.</para> 
      </li> 
      <li> 
       <para>- three line-drawing illustrations: -- which show example visual data sets depicting the human body. </para> 
      </li>
      <li> 
       <para>- <highlight style="bold">Metal</highlight> meta-programming language: -- shows an example of a high level meta-programming
        language.</para> 
      </li>
      
    </seqlist>
    
    </section>
    
<section><title>Metaprogramming</title>    
    <para>Metaprogramming (programming)From Wikipedia, the free encyclopedia.</para>

    <para>
Metaprogramming is the writing of programs that write or manipulate other programs (or themselves) as their data
 or that do part of the work that is otherwise done at runtime during compile time. This allows programmers to 
 produce a larger amount of code and get more done in the same amount of time as they would take to write all 
 the code manually.
 
    <randlist style="bulleted">
    <li>
    <para> * The most common metaprogramming tool is a compiler which allows a programmer to write a relatively short
     program in a high-level language and uses it to write an equivalent assembly language or machine language
      program. This generally saves a good deal of time compared to writing the machine language program directly.</para> 
    </li>
    <li>
    <para> * Another still fairly common example of metaprogramming might be found in the use of lex (see also: flex)
     and yacc (see also: bison), which are used to generate compilers and interpreters.</para>
    </li>
    </randlist>
    
Reflection is a valuable language feature for facilitating metaprogramming. Having the programming language 
itself as a first class data type (as in Lisp) is also very useful.
</para></section>

<section><title>Reflection</title>

<para>Reflection (computer science) From Wikipedia, the free encyclopedia.</para>
<para>
In computer science, reflection is the ability of a program to examine and possibly modify its high level structure
 at runtime. It is most common in high-level virtual machine programming languages like Smalltalk, and less common 
 in low-level programming languages like C.</para>

<para>When program source code is compiled, information about the structure of the program is normally lost as lower level
 code (typically assembly language code) is emitted. If a system supports reflection, the structure is preserved as 
 metadata with the emitted code.</para>

<para>Known platforms supporting reflection are:</para>
<randlist style="bulleted">
    <li> * Lisp, and lisp variants (eg, Scheme) (fully reflective with no distinction between compile-time and run-time)</li>
    <li> * The Java Virtual Machine (JVM), but only to a limited extent</li>
    <li> * .NET and the Common Language Runtime (CLR)</li>
    <li> * Objective-C</li>
    <li> * Python</li>
    <li> * PHP, since version 5</li>
    <li> * Ruby</li>
    <li> * The Maude system of rewriting logic</li>
    <li> * Smalltalk (fully reflective with no distinction between compile-time and run-time)
    </li>
    </randlist>
<para>More generally, reflection is an activity in computation that <highlight style="under">reasons about its own computation</highlight>.
The programming paradigm driven by reflection is called reflective programming.</para>

<para>[ Reflective programming From Wikipedia, the free encyclopedia.</para>

<para>In computer science, reflective programming is a programming paradigm that encourages programming driven by the use of
reflection at runtime.]</para>

<para>Implementation</para>

<para>A language supporting reflection provides a number of features available at runtime that would otherwise be very obscure
or impossible to accomplish in a lower-level language. Some of these features include:</para>
<randlist style="bulleted">
    <li> * The ability to discover and modify source-code constructions (such as code blocks, classes, methods, protocols, etc.)
      as first-class objects at runtime.</li>
    <li> * The ability to convert a string matching the symbolic name of a class or function into an invocation of that class or
      function.</li>
    <li> * The ability to evaluate a string as if it were a source-code statement at runtime.
    </li>
    </randlist>
<para>These features can be implemented in different ways. Interpreted programming languages, such as Ruby and PHP, are ideally 
suited to reflection, since their source code is never lost in the process of translation to machine language the 
interpreter has the source readily available. Complied (sic) languages rely on their runtime system to provide information
about the source code. A compiled Objective-C executable, for example, records the names of all methods in a block of the
executable, providing a table to correspond these with the underlying methods (or selectors for these methods) compiled 
into the program.</para>

<para>some example Java code</para>

<para>
    <verbatim><![CDATA[
// Without reflection
FooT fooHE = new FooT ();
fooHE.helloWorld ();

// With reflection
Class clazzY = Class.forName ("FooT");
Method methodIC = clazzY.getMethod ("helloWorld", null);
methodIC.invoke (clazzY.newInstance (), null);
]]></verbatim></para>

<para>"Both codes create the instance of a class 'FooT' and calls its method 'helloWorld'. The difference is that in the first
piece, the name of the class and the method is hard-coded; it is not possible to use a class of another name. In the 
second piece, the names of the class and the method can vary at runtime.</para>

<para>(See java.lang.reflect for more of this feature.)"</para>



<para>Following: some SUN Microsystems Java code examples. copyright SUN</para>

<para>
    <verbatim><![CDATA[
This example shows how to get the fully-qualified and non-fully-qualified name of a reflected object. 
See also e60 Getting the Name of a Class Object.

    Class cls = java.lang.String.class;
    Method method = cls.getMethods()[0];
    Field field = cls.getFields()[0];
    Constructor constructor = cls.getConstructors()[0];
    String name;
    
    // Fully-qualified names
    name = cls.getName();     // java.lang.String
    name = cls.getName()+"."+field.getName();     // java.lang.String.CASE_INSENSITIVE_ORDER
    name = constructor.getName();      // java.lang.String
    name = cls.getName()+"."+method.getName();    // java.lang.String.hashCode
    
    // Unqualified names
    name = cls.getName().substring(cls.getPackage().getName().length()+1);  // String
    name = field.getName();            // CASE_INSENSITIVE_ORDER
    name = constructor.getName().substring(cls.getPackage().getName().length()+1); // String
    name = method.getName();           // hashCode


e60. Getting the Name of a Class Object

    // Get the fully-qualified name of a class
    Class cls = java.lang.String.class;
    String name = cls.getName();        // java.lang.String
    
    // Get the fully-qualified name of a inner class
    cls = java.util.Map.Entry.class;
    name = cls.getName();               // java.util.Map$Entry
    
    // Get the unqualified name of a class
    cls = java.util.Map.Entry.class;
    name = cls.getName();
    if (name.lastIndexOf('.') > 0) {
        name = name.substring(name.lastIndexOf('.')+1);  // Map$Entry
    }
    // The $ can be converted to a .
    name = name.replace('$', '.');      // Map.Entry
    
    
    // Get the name of a primitive type
    name = int.class.getName();         // int
    
    // Get the name of an array
    name = boolean[].class.getName();   // [Z
    name = byte[].class.getName();      // [B
    name = char[].class.getName();      // [C
    name = short[].class.getName();     // [S
    name = int[].class.getName();       // [I
    name = long[].class.getName();      // [J
    name = float[].class.getName();     // [F
    name = double[].class.getName();    // [D
    name = String[].class.getName();    // [Ljava.lang.String;
    name = int[][].class.getName();     // [[I
    
    // Get the name of void
    cls = Void.TYPE;
    name = cls.getName();               // void


e114. Getting the Field Objects of a Class Object
There are three ways of obtaining a Field object from a Class object.

    Class cls = java.awt.Point.class;
    
    // By obtaining a list of all declared fields.
    Field[] fields = cls.getDeclaredFields();
    
    // By obtaining a list of all public fields, both declared and inherited.
    fields = cls.getFields();
    for (int i=0; i<fields.length; i++) {
        Class type = fields[i].getType();
        process(fields[i]);
    }
    
    // By obtaining a particular Field object.
    // This example retrieves java.awt.Point.x.
    try {
        Field field = cls.getField("x");
        process(field);
    } catch (NoSuchFieldException e) {
    }



e115. Getting and Setting the Value of a Field
This example assumes that the field has the type int.

    try {
        // Get value
        field.getInt(object);
    
        // Set value
        field.setInt(object, 123);
    
        // Get value of a static field
        field.getInt(null);
    
        // Set value of a static field
        field.setInt(null, 123);
    } catch (IllegalAccessException e) {
    }

e116. Getting a Constructor of a Class Object
There are two ways of obtaining a Constructor object from a Class object.

    // By obtaining a list of all Constructors object.
    Constructor[] cons = cls.getDeclaredConstructors();
    for (int i=0; i<cons.length; i++) {
        Class[] paramTypes = cons[i].getParameterTypes();
        process(cons[i]);
    }
    
    // By obtaining a particular Constructor object.
    // This example retrieves java.awt.Point(int, int).
    try {
        Constructor con = java.awt.Point.class.getConstructor(new Class[]{int.class, int.class});
        process(con);
    } catch (NoSuchMethodException e) {
    }

e117. Creating an Object Using a Constructor Object
This example creates a new Point object from the constructor Point(int,int).

    try {
        java.awt.Point obj = (java.awt.Point)con.newInstance(
            new Object[]{new Integer(123), new Integer(123)});
    } catch (InstantiationException e) {
    } catch (IllegalAccessException e) {
    } catch (InvocationTargetException e) {
    }

e118. Getting the Methods of a Class Object
There are three ways of obtaining a Method object from a Class object.

    Class cls = java.lang.String.class;
    
    // By obtaining a list of all declared methods.
    Method[] methods = cls.getDeclaredMethods();
    
    // By obtaining a list of all public methods, both declared and inherited.
    methods = cls.getMethods();
    for (int i=0; i<methods.length; i++) {
        Class returnType = methods[i].getReturnType();
        Class[] paramTypes = methods[i].getParameterTypes();
        process(methods[i]);
    }
    
    // By obtaining a particular Method object.
    // This example retrieves String.substring(int).
    try {
        Method method = cls.getMethod("substring", new Class[] {int.class});
        process(method);
    } catch (NoSuchMethodException e) {
    }


e119. Invoking a Method Using a Method Object

    try {
        Object result = method.invoke(object, new Object[] {param1, param2, ..., paramN});
    } catch (IllegalAccessException e) {
    } catch (InvocationTargetException e) {
    }

Java Reflection tutorial info
The program first gets the Class description for method1, and then calls getDeclaredMethods to
 retrieve a list of Method objects, one for each method defined in the class. These include 
 public, protected, package, and private methods. If you use getMethods in the program instead
  of getDeclaredMethods, you can also obtain information for inherited methods.

Once a list of the Method objects has been obtained, it's simply a matter of displaying the 
information on parameter types, exception types, and the return type for each method. Each of
 these types, whether they are fundamental or class types, is in turn represented by a Class descriptor.
The output of the program is:

  name = f1
   decl class = class method1
   param #0 class java.lang.Object
   param #1 int
   exc #0 class java.lang.NullPointerException
   return type = int
   -----
   name = main
   decl class = class method1
   param #0 class [Ljava.lang.String;
   return type = void
   -----
   
  ]]></verbatim></para>
  
 </section> 
 
 
<section><title>AspectJ</title>

<para>aspectjcookbook_examples\chapter_2\Simple Example
    <verbatim><![CDATA[     
package com.oreilly.aspectjcookbook;

public class MyClass
{
	public void foo(int number, String name)
	{
		System.out.println("Inside foo (int, String)");
	}

	public static void main(String[] args)
	{
		// Create an instance of MyClass
		MyClass myObject = new MyClass();
		// Make the call to foo
		myObject.foo(1, "Russ Miles");
	}
}



package com.oreilly.aspectjcookbook;

/**
 * <p>Title: HelloWorld aspect for Recipe 2.2</p>
 * <p>Description: Simple aspect for demonstrating a very simple aspect</p>
 * <p>Copyright: Copyright (c) 2003 Russell Miles</p>
 * @author Russell Miles
 * @version 1.0
 */

public aspect HelloWorld 
{
   /*
   Specifies calling advice whenever a method
   matching the following rules gets called:
   
   Class Name: MyClass
   Method Name: foo
   Method Return Type: * (any return type)
   Method Parameters: an int followed by a String
   */
   pointcut callPointCut() : 
      call(void com.oreilly.aspectjcookbook.MyClass.foo(int, String));

   // Advice declaration
   before() : callPointCut()
   {

      System.out.println(
         "Hello World");
      System.out.println(
         "In the advice attached to the call point cut");
   }
}
]]>
    </verbatim>
    </para>

 <para>aspectjcookbook_examples\chapter_4\Execution Pointcut
    <verbatim><![CDATA[

public class MyClass
{
	public void foo(int number, String name)
	{
		System.out.println("************ Business/Application Logic *************");
		System.out.println("Inside constructional method MyClass.void foo(int, String)");
		System.out.println("*****************************************************");
	}

	public static final void main(String args[])
	{
		// Create instance of the object
		MyClass myObject = new MyClass();

		// Exercise all of the calls on the MyClass object
		System.out.println("About to enter the method MyClass.foo(int,String)");
		myObject.foo(1, "Russ Miles");
	}
}



public aspect ExecutionRecipe 
{
   /*
   	Specifies calling advice whenever a method 
   	matching the following rules enters execution:
   	
   	Class Name: MyClass
   	Method Name: foo
   	Method Return Type: int
   	Method Parameters: an int followed by a String
   */
   pointcut executionPointcut() : execution(
      void MyClass.foo(int, String));

   // Advice declaration
   before() : executionPointcut()
   {
      System.out.println(
         "------------------- Aspect Advice Logic --------------------");
      System.out.println("In the advice picked by ExecutionRecipe");
      System.out.println(
         "Signature: "
            + thisJoinPoint.getStaticPart().getSignature());
      System.out.println(
         "Source Line: "
            + thisJoinPoint.getStaticPart().getSourceLocation());
      System.out.println(
         "------------------------------------------------------------");
   }
}

]]>
    </verbatim>
    </para>
    
    
<para>DisplayUpdating.java explanation of following code.
    <verbatim><![CDATA[
  DisplayUpdating.java
aspect DisplayUpdating {

    before(Shape s): this(shape) && 
        (execution(void Shape.moveBy(int, int)) ||
         execution(void Shape+.set*(*))) {

        Display.update(s);
    }
}
]]>
    </verbatim>
    </para>
    
</section>

<section><title>Structure Table with corresponding SVG Gensyms</title>

 <para> A human tells the program the names of the body parts via the keyboard, and points to the relevant areas of the 
 picture with a mouse so that the program can generate the path definition (SVG group element g). Partial structure
 mapping of two representations is used, one the "known" (or "source knowledge") and the other the "input comparand", to 
 determine similarity of the two structured representations. That provides an evaluation of the comparand's metaphorical
 representation of the source knowledge item. (A "foot" is a named location, comprised of a vector-path or collection of
 x,y points.) Example: foot of Popeye located at bottom of Popeye, (metaphorically) foot of mountain located at bottom 
 of mountain. See the tables following and the ("knowledge") reference pictures further down.
 <table>
 <tgroup cols="2">
  <colspec colnum="1" colname="col1" colwidth="1.00" /> 
  <colspec colnum="2" colname="col2" colwidth="1.00*" /> 
 <thead>
 <row>
  <entry colname="col1">Body Part Name</entry> 
  <entry colname="col2">SVG group gensym</entry> 
  </row>
  </thead>
 <tbody>
 <row>
  <entry colname="col1">hat</entry> 
  <entry colname="col2">g43</entry> 
  </row>
 <row>
  <entry colname="col1">head</entry> 
  <entry colname="col2">g8</entry> 
  </row>
 <row>
  <entry colname="col1">face</entry> 
  <entry colname="col2">g14</entry> 
  </row>
 <row>
  <entry colname="col1">eyes</entry> 
  <entry colname="col2">g4</entry> 
  </row>
 <row>
  <entry colname="col1">nose</entry> 
  <entry colname="col2">g23</entry> 
  </row>
 <row>
  <entry colname="col1">mouth</entry> 
  <entry colname="col2">g2</entry> 
  </row>
 <row>
  <entry colname="col1">torso</entry> 
  <entry colname="col2">g15</entry> 
  </row>
 <row>
  <entry colname="col1">arm</entry> 
  <entry colname="col2">g5</entry> 
  </row>
 <row>
  <entry colname="col1">leg</entry> 
  <entry colname="col2">g21</entry> 
  </row>
 <row>
  <entry colname="col1">foot</entry> 
  <entry colname="col2">g27</entry> 
  </row>
  </tbody>
  </tgroup>
  </table>
</para>
</section>



<section><title>Tabularized Graph Structure</title>

<para>The visual data sets used here to define body elements (arm, head, etc) can be given an ordering or sequence by including
 in the table the spatial relationship of the elements. The same information could be represented as a graph structure.
 Notice the graph or sequence 'vertical orientation --) bottom --) foot'
 <table>
 <tgroup cols="3">
  <colspec colnum="1" colname="col1" colwidth="1.00*" /> 
  <colspec colnum="2" colname="col2" colwidth="1.00*" /> 
  <colspec colnum="3" colname="col3" colwidth="1.00*" />
 <thead>
 <row>
  <entry colname="col1">orientation: vertical </entry> 
  <entry colname="col2">part-of: body</entry> 
  <entry colname="col2">has-relation: attached</entry>
  </row>
  </thead>
 <tbody>
 <row>
  <entry colname="col1">top</entry> 
  <entry colname="col2">hat</entry>
  <entry colname="col3">visdata: g43 below: head above: none</entry> 
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">head</entry>
  <entry colname="col3">visdata: g8 below: face above: hat</entry> 
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">face</entry>
  <entry colname="col3">visdata: g14 below: eyes above: head</entry>
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">eyes</entry>
  <entry colname="col3">visdata: g4 below: nose above: face</entry>
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">nose</entry>
  <entry colname="col3">visdata: g23 below: mouth above: eyes</entry>
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">mouth</entry>
  <entry colname="col3">visdata: g2 below: torso above: nose</entry>
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">torso</entry>
  <entry colname="col3">visdata: g15 below: arm above: mouth</entry>
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">arm</entry>
  <entry colname="col3">visdata: g5 below: leg above: torso</entry>
  </row>
 <row>
  <entry colname="col1"></entry> 
  <entry colname="col2">leg</entry>
  <entry colname="col3">visdata: g21 below: foot above: arm</entry>
  </row>
 <row>
  <entry colname="col1">bottom</entry> 
  <entry colname="col2">foot</entry>
  <entry colname="col3">visdata: g27 below: none above: leg</entry>
  </row>
  </tbody>
  </tgroup>
  </table>
</para>
</section>

<section><title>Spatial (and Corresponding) Metaphor, Daxsvg ontology and its logic</title>

<para> <bibref refloc="bib6" /> showed code and data to explain the mechanism behind an implementation of "corresponding
 metaphor", by which is meant that a system can detect / "recognize" certain kinds of analogies. The example shown
 was "foot" of "Business Man Bob" being the source of the metaphor and the lower part / volume of a rock formation 
 (shown in a picture) being metaphorically "the foot of the mountain." The correspondence that permitted detection
  / "perception" of that analogy was that there was, in common (to "Business Man Bob", and the mountain in the picture)
   a (corresponding) lower part or volume to both "structures" or visual objects. The lower structural component, in
    Business Man Bob's case, had been given the name "foot" by humans and this name could be transferred as an analogical
    or metaphorical reference to the lower structural part or volume of the mountain. One could have easily have called the
    "foot" "pied" or "foos" instead and it would have made no difference.   xgmml graph structure of structure data two column table.
    (arrow or link from orientation:vertical ==)bottom == foot.  </para>
    
<para>Fuzzy set calculations comprise part of the system of this paper and they are implemented by means of
continuous mathematical functions, which map a variable of the fuzzy function&rsquo;s x-axis into a membership value
which ranges from 0 to 1. These mathematical functions are the analog part of the computation which implements
this system. The analog calculation provides a continuous coverage of the logical range 0:1 and is a 
computationally legitimate way of providing a non-binary non-enumerated-value scope.</para>

<para>In the case of the DAXSVG ontology
    above the comments tell (us) the nature of the logic implemented by the Java code which is
    associated with this ontology. For example, the AtRight predicate in the above ontology has associated
    Java code which calculates the <highlight style="ital">degree</highlight> to which the predicate is true.
    RDF is designed to operate as though a true or false system but my associated Java is able to
    calculate shades of grey for predicates because context is used. How context is used to do this is
    explained in the presentation <bibref refloc="bib5" />. Code details showing how that is done
    are explicitly given further on in this paper.</para>
    
    <para>An example of a <highlight style="under">boolean</highlight> (aka "crisp") determination of 
    <highlight style="ital">AtRight</highlight>, is shown next, in Java.</para>
    <para>
    <verbatim><![CDATA[
    	public boolean AtRight( int x1, int x2 )
    	        {
    	            if (x1 < x2 )
    	            {
    	                return true;
    	            }
    	            else
    	            {
    	                return false;
    	            }
            }
    ]]></verbatim>
    </para>
    <para>Each of the RDF predicates in DAXSVG has a program member written in Java. These programs 
    , like the one above, provide required actions for the DAXSVG ontology. The Java program above is
    purposely simplified for illustrative purposes. </para>
    <para>The nature of the simplification is this, the above
     program provides a boolean or true / false dichotomization of there being a &ldquo;to the right&rdquo; spatial
     relationship existing at the time of testing between two (SVG) objects whose (SVG) x-axis origin values
     are x1 and x2. The DAXSVG, as can be seen by reading the comments for the predicates in it, is used not
     as a boolean type system of true / false but rather a continuous system implementing shades of grey.
     A boolean function such as the one shown above can only detect &ldquo;to the right&rdquo; being true or false,
     all or nothing. Code used in association with the DAXSVG predicates computes a degree or how much the
     spatial (or other) predicate is true. The
     predicates themselves in the DAXSVG are conceptual identifiers they do not detect or compute the shade of
     grey themselves. Each DAXSVG conceptual identifier has associated with it one or more Java code modules.
     Together the DAXSVG predicates and the associated code modules comprise a kind of (collection of) 
     ontological-object. Objects
     in computing have both a data aspect and an executable aspect (such as methods). {Note the term "aspect" in
     the preceding sentence was not used to mean the same thing as "aspect" means in the context of "aspect
     oriented programming".] Following is Java code for the actual function that is used by the system described 
     in this paper. This version of AtRight uses a continous function to calculate a (so-called) "fuzzy" return value.</para>
     <para>In the case of the DAXSVG ontology
    above the comments tell (us) the nature of the logic implemented by the Java code which is
    associated with this ontology. For example, the AtRight predicate in the above ontology has associated
    Java code which calculates the <highlight style="ital">degree</highlight> to which the predicate is true.
    RDF is designed to operate as though a true or false system but my associated Java is able to
    calculate shades of grey for predicates because context is used. How context is used to do this is
    explained in the presentation <bibref refloc="bib5" />. Code details showing how that is done
    are explicitly given further on in this paper.</para>
     <para>
    <verbatim><![CDATA[
    	public real AtRight( int x1, int x2 )
    	        {
    	            if (x1 < x2 )
    	            {
    	                findxy( x1, x2 )
    	                return 1 - (.5 + 1/PI * atan(((sqrt((x2 - x1)^2 + (y2 - y1)^2)) - k1) / k2));
    	            }
    	            else
    	            {
    	                return 0;
    	            }
            }
    ]]></verbatim>
    This version of AtRight uses the function 1 - f(x) to calculate "how much" the object x2 is to the right of object x1.
    The function findxy uses the x coordinate of each of the pointobjects involved. The two objects being compared have coordinates
    of x1,y1 and x2,y2. It is a simple matter to find the corresponding y1 and y2 for each object involved, simply by lookup of the
    location of the two objects having x1 and x2 as part of their 'location'. If there are more than 2 points in the input space
    then AtRight would have to have the y components of their location included in the parameter list, which can be accomplished via
    overloading and prototype definition. If the context of the scenario was that the points were in a three dimensional space (x,y,z)
    then the equation (used by the Java return)would have to be of the three axis kind shown in this paper. Findxy ( ) also 
    provides the <highlight style="ital">context</highlight> required to perform the calculation. The fuzzy function, such as Near( ),
    must be done using a scope or context. This context allows sensible calculations to be performed in situations like "A big dog 
    is smaller than a small house." Findxy( ) allows global (variable) information to be resolved, which the calculation can tap into.
    (The points discussed in this section are the centroids (center of gravity) of their respective containing morphologies whether two
    dimensional or three dimensional. A fuller discussion of the fuzzy functions, such as AtRight( ), Near( ), and so on would show 
    the (additional) logic and further calculations also present in those (detailed) functions which take the 
    <highlight style="ital">morphologies</highlight> of the objects into account and other aspects which the context is informed by.
    A simple example is that of two clouds where their centroids are far apart but yet some volumes of each of them not only touch
    but intermingle with each other to some extent. Clearly the magnitude / extent of the morphology itself is at least as important
    as the relative locations of the centroids involved in the comparison / scenario.) The AtRight version shown
    above (for a two dimensional problem space) calculates the euclidean distance separating the two points and the Near function 
    (1 - f(x)), which uses that distance as x in the f(x), which calculates Near(x), or in English, "how near to the right of x1 is x2".
    "How near" is a scalar not a boolean, and it may be depicted as an english expression through the means of Zadeh's "
    <highlight style="ital">linguistic variable</highlight>" technique. Examples "quite near to the right", "somewhat near to the right",
    "not very near to the right" etc. (The means of computing linguistic variables was explained in my earlier paper, and is in the fuzzy
    set literature Zadeh79, Schmucker93, Negoita93, Dodds81 AAAS, Dodds01 WROX, Dodds04a,b Vegas Montreal ). 
    </para>
     
    <para>The programs in the Java collection have a scheduler
    program which runs them as needed, and provides the information needed for their parameters.
    This scheduler and parameter definer are components of the meta-programming system which operates my
    system discussed in this paper.</para>
</section>

<section><title>Subset of OpenCyc Upper Ontology: some anatomical knowledge</title>

<para>The technique of partial structure mapping can provide a name which can be used in ontologies
 as a linguistically derived
     term. When we look at the CYC knowledge-base we see that it has defined a number of valuable useful
     knowledge items to do with foot. A piece of the CYC knowledge-base is shown next. This OWL (Web Ontology
     Language) item is just one of a myriad of OWL entries in the CYC knowledge-base. CYC may be used to infer
     tacit information, that is information which is not explicitly present in an input / data set. Notice that
     the CYC OWL item below tells the computer in semantic web terms about &ldquo;foot&rdquo;. Notice that this
     subset (below) of the OpenCyc upper ontology specifies ontological information about &ldquo;foot&rdquo;,
      &ldquo;arm&rdquo;, &ldquo;hand&rdquo;, &ldquo;hat&rdquo;,
     &ldquo;appendage&rdquo; (concept), &ldquo;torso&rdquo;, &ldquo;animal body region&rdquo; (spatial concept),
      &ldquo;head&rdquo;, &ldquo;pants&rdquo;, &ldquo;shirt&rdquo;, &ldquo;shoe&rdquo;, &ldquo;skirt&rdquo;. The
      ontology provides a &ldquo;conceptual&rdquo; framework for the computer vis-a-vis &ldquo;things in the world&rdquo;.
    <verbatim><![CDATA[
    <owl:Class rdf:ID="Foot-AnimalBodyPart">
        <rdfs:label xml:lang="en">feet (types of things)</rdfs:label>
        <rdfs:comment>The collection of all vertebrates&apos; feet.  A
            foot is a terminal part of a #$Vertebrate #$Leg.  Feet are
            used in locomotion, support, balance, kicking, etc.</rdfs:comment>
        <guid>bd58be93-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#PublicConstant"/>
        <rdf:type rdf:resource="#SymmetricAnatomicalPartType"/>
        <rdf:type rdf:resource="#AnimalBodyPartType"/>
        <rdfs:subClassOf rdf:resource="#Appendage-AnimalBodyPart"/>
        <rdfs:subClassOf rdf:resource="#Individual"/>
        <owl:disjointWith rdf:resource="#Digit-AnatomicalPart"/>
        <owl:disjointWith rdf:resource="#Limb-AnimalBodyPart"/>
    </owl:Class>
    <daml:Class rdf:ID="Arm">
        <rdfs:label>arms</rdfs:label>
        <rdfs:comment>The collection of all animal arms.  An #$Arm of an
            animal is one of its #$AnimalBodyParts, more particularly
            one of its appendages, a limb which it uses for manipulation
            moreso than for locomotion.  A #$Hand is considered part of
            an #$Arm.</rdfs:comment>
        <guid>bd58e9e5-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#SymmetricAnatomicalPartType"/>
        <rdf:type rdf:resource="#AnimalBodyPartType"/>
        <rdfs:subClassOf rdf:resource="#BiologicalLivingObject"/>
    </daml:Class>
    <daml:Class rdf:ID="Hand">
        <rdfs:label>hands</rdfs:label>
        <rdfs:comment>The collection of all terminal parts of a
            #$Vertebrate forelimb which are structurally suited to
            function as a grasping organ (as in people, newts, etc.).
            E.g., FerdinandTheBull has his forelimbs end in hooves,
            which are not capable of grasping things, so those are NOT
            considered #$Hands.</rdfs:comment>
        <guid>bd588655-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#AnimalBodyPartType"/>
        <rdf:type rdf:resource="#SymmetricAnatomicalPartType"/>
        <rdfs:subClassOf rdf:resource="#BiologicalLivingObject"/>
        <rdfs:subClassOf rdf:resource="#Appendage-AnimalBodyPart"/>
    </daml:Class>
    <daml:Class rdf:ID="Hat">
        <rdfs:label>hats</rdfs:label>
        <rdfs:comment>A collection of objects.  Each element of #$Hat is
            either a hat or other headgear or hatlike object.  Subsets
            include #$Helmet, #$SwimmingCap, and #$Sombrero.</rdfs:comment>
        <guid>bd58a525-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#ExistingObjectType"/>
        <rdf:type rdf:resource="#ProductType"/>
        <rdfs:subClassOf rdf:resource="#ClothingAccessory"/>
    </daml:Class>
    <daml:Class rdf:ID="Appendage-AnimalBodyPart">
        <rdfs:label>appendages</rdfs:label>
        <rdfs:comment>The collection of all appendages of #$Animals.  An
            appendage is an #$AnimalBodyPart that is connected to, and
            extends from, the animal&apos;s #$Torso (or else from
            another of its appendages, such as a hand extending from an
            arm).  Each appendage is used by the #$Animal for one or
            more functions; altogether, appendages serve a wide variety
            of functions such as locomotion, manipulation, sensing,
            fighting, scratching, heat dissipation, balance, etc.
            Appendages are not crucial for the life of the animal, thus
            a #$Neck-AnimalBodyPart or #$Head-AnimalBodyPart is not
            considered to be an appendage.</rdfs:comment>
        <guid>bd5882f8-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#ExistingObjectType"/>
        <rdf:type rdf:resource="#AnimalBodyPartType"/>
        <rdfs:subClassOf rdf:resource="#AnimalBodyPart"/>
        <rdfs:subClassOf rdf:resource="#BiologicalLivingObject"/>
    </daml:Class>
    <daml:Class rdf:ID="Torso">
        <rdfs:label>torsos</rdfs:label>
        <rdfs:comment>The collection of all human torsos.  A #$Torso is
            the main portion of the person&apos;s body, and one can
            conceive of a human body as a torso to which are connected
            the head and various appendages (#$Appendage-AnimalBodyPart).</rdfs:comment>
        <guid>bd59098e-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#UniqueAnatomicalPartType"/>
        <rdf:type rdf:resource="#AnimalBodyPartType"/>
        <rdfs:subClassOf rdf:resource="#BiologicalLivingObject"/>
    </daml:Class>
    <daml:Class rdf:ID="AnimalBodyRegion">
        <rdfs:label>animal body region</rdfs:label>
        <rdfs:comment>The set of parts of an animal&apos;s body that one
            might point to, operate on, photograph, transplant, etc.  So
            this is a collection of (conceptual) spatial subdivisions of
            the bodies of #$Animals, generally contiguous and having
            some more or less clear boundary.  Some elements of this
            collections are Einstein&apos;s head, #$SantasBeard, and
            Babe Ruth&apos;s right arm.  Other elements of this set are
            what might be considered unhealthy body regions, such as a
            blister, a puncture wound, a bruise, etc. -- but those are
            still clearly a part of an animal&apos;s body, can be
            pointed to, photographed, bandaged up, etc.     Note that
            this concept is quite different from an animal body
            `system&apos; (such as the lymph system, the nervous system,
            etc.) which comprises a small portion of an animal&apos;s
            total mass but is distributed throughout the animal&apos;s
            body -- see #$AnimalBodyPart.  (At the naive, commonsense
            level of physiology, and for almost all purposes, it is
            perfectly acceptable to conceptualize Santa&apos;s beard as
            one #$AnimalBodyRegion, and the same for Farrah
            Fawcett&apos;s hair, etc.  A borderline case of this is:
            Cher&apos;s fingernails.  In some contexts, one would treat
            those as an #$AnimalBodyRegion, and in other contexts one
            would treat them as ten separate #$AnimalBodyRegions.)</rdfs:comment>
        <guid>bd5adaa1-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#ExistingObjectType"/>
        <rdfs:subClassOf rdf:resource="#OrganismPart"/>
        <rdfs:subClassOf rdf:resource="#AnimalBLO"/>
    </daml:Class>
    <daml:Class rdf:ID="Head-AnimalBodyPart">
        <rdfs:label>heads</rdfs:label>
        <rdfs:comment>The collection of all heads of #$Animals. [Note:
            the hyphenated name reflects the need to have other terms in
            the knowledge base like #$Head-Vertebrate, representing a
            subset of this set, about which some useful specialized
            information is stated.]</rdfs:comment>
        <guid>bd58ba60-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#UniqueAnatomicalPartType"/>
        <rdf:type rdf:resource="#AnimalBodyPartType"/>
        <rdfs:subClassOf rdf:resource="#AnimalBodyPart"/>
        <rdfs:subClassOf rdf:resource="#BiologicalLivingObject"/>
    </daml:Class>
    <daml:Class rdf:ID="Pants">
        <rdfs:label>pants</rdfs:label>
        <rdfs:comment>A collection of objects.  Every element of #$Pants
            is a clothing item worn on the lower torso and legs.  The
            collection #$Pants includes the subsets #$ShortPants and
            #$LongPants.  There are also very specialized subsets, e.g., #$FootballPants.</rdfs:comment>
        <guid>c0fbc8c8-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#ExistingObjectType"/>
        <rdf:type rdf:resource="#ProductType"/>
    </daml:Class>
    <daml:Class rdf:ID="Shirt">
        <rdfs:label>shirts</rdfs:label>
        <rdfs:comment>A collection of objects.  Every element of #$Shirt
            is a clothing item that is worn to cover the upper part of
            the human torso, with openings for the neck and lower body,
            and either openings for, or sleeves encircling, the arms.
            Subsets include #$LongSleeveShirt, #$Blouse, and #$TankTop.</rdfs:comment>
        <guid>bd588139-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#ExistingObjectType"/>
        <rdf:type rdf:resource="#ProductType"/>
    </daml:Class>
    <daml:Class rdf:ID="Shoe">
        <rdfs:label>shoes</rdfs:label>
        <rdfs:comment>A collection of objects.  Every element of #$Shoe
            is a shoe or shoelike thing worn on the feet.  Important
            subsets include #$Boot-Footwear, #$Sandal, #$Slipper, and
            #$CasualShoe.  Elements of the collection #$Shoe are single
            shoes.  Pairs of shoes are elements of the collection
            denoted by (#$PairFn #$Shoe).</rdfs:comment>
        <guid>bd58a4e8-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#ExistingObjectType"/>
        <rdf:type rdf:resource="#ProductType"/>
        <rdfs:subClassOf rdf:resource="#ClothingItem"/>
    </daml:Class>
    <daml:Class rdf:ID="Skirt">
        <rdfs:label>skirts</rdfs:label>
        <rdfs:comment>The collection of all skirts, a category of
            clothing intended to cover the lower part of the body.</rdfs:comment>
        <guid>bd58dd4e-9c29-11b1-9dad-c379636f7270</guid>
        <rdf:type rdf:resource="#ExistingObjectType"/>
        <rdf:type rdf:resource="#ProductType"/>
    </daml:Class>
     ]]>
    </verbatim>This ontological item tells the computer that a foot is not a finger, arm, or leg; and that its
     location is a terminal part of a leg (i.e. at the end of a leg, not the middle or elsewhere). This
     ontological semantic knowledge is valuable for it allows the program we are discussing in this paper to
     identify / locate a foot in a visual data set yet without being committed to a particular photograph
     of one, nor drawing or X3D three-dimensional data set of a foot.
    </para>
    
</section>


<section><title>Winston's Relation Graphs Automatically Learn Analogies via "Near Misses" Examples</title>

<para>What Winston <bibref refloc="bib14" /> called "near misses" were "seen to directly convey important
   points . The near misses allow the programs to evolve models of concepts by augmenting descriptions with
   information about what parts of the description are important. It is important to know, for example, that
   the presence of a hole in the arch is essential, whereas the colour of the materials is incidental."
   Winston's analogical learning program allowed the computer to input sketches of objects and learn their
   relevant semantic components / constituents through analysis of a collection of positive and negative
   exemplars. This approach can be used to permit the learning of relevant analog / metaphor components from
   the reference diagrams / pictures in this paper. (The most relevant metaphor obtained from the reference
    / definition pictures in this paper is that a "foot" is at the lower extreme of a vertically oriented object.
    Hence foot of the mountain, as well as foot of Popeye (Business Man Bob, Betty Boop).)
     </para> 
   <para>Winston says "We use analogy when we say something is a Cinderella story and when we learn about 
   resistors by thinking about water pipes. We also use analogy when we learn subjects like economics, 
   medicine, and law. This paper presents a theory of analogy and describes an implemented system that embodies 
   the theory. The specific competence to be understood is that of using analogies to do certain kinds of 
   learning and reasoning. Learning takes place when analogy is used to generate a constraint description in 
   one domain, given a constraint description in another, as when we learn Ohm's law by way of knowledge about 
   water pipes. Reasoning takes place when analogy is used to answer questions about one situation, given another 
   situation that is supposed to be a precedent, as when we answer questions about Hamlet by way of knowledge 
   about Macbeth."</para>
   
   </section>
   
   <section><title>Vector based Illustrations can be reference data sets</title>
   

<figure anchor="fixed">  
        <title>The illustration shows "Popeye the Sailor". The line-drawing is an example of a visual and numerical
        (vector paths and fill definitions) data set used as a source of information. Like Business Man Bob, Popeye
        has a head, torso, arms, legs and feet. (Eyes and a hat). The picture is 255 Y units high (y=255 is the 
        bottom of the picture, y=0 is the top), he ranges from y=7 to y=254, his "height" ("my height") is 247 Y units. The 
        picture width is 185 X units, x=0 is on the left. "Popeye" has a "foot" at y=229:247 and another at y=233:254.</title>
        <graphic figname="dodd050501" scale="10%"/>
</figure>

<figure anchor="fixed">  
        <title>SVG illustration displays Business Man Bob. It is a collection of SVG paths which constitute a
        visio-spatial data set processable by the computer as &ldquo;lines&rdquo; rather than &ldquo;dots&rdquo;,
        and which is used as the basis of a metaphor-tenor. (i.e. Visible metaphor source.)
        [source jpg from Radicalman site p147] This illustration was part of my Extreme 2004 paper.</title>
        <graphic figname="dodd090925" scale="10%"/> 
</figure>  

     <para>To us the rendered paths (lines) of the data set constitute a recognizable depiction of a male human,
    if not a charicature or cartoon thereof. It is not a photograph or hologram nor are they needed. A 
    texture-mapped
    X3D three-dimensional humanoid would be nice but is not necessary. At the same time that we recognize 
    instantly that the rendered SVG paths depict a man, the computer, not being able to &ldquo;see&rdquo;,
    &ldquo;perceives&rdquo;/detects a collection of SVG paths and nothing else. (Our &ldquo;seeing&rdquo;
    of the &ldquo;man&rdquo; is based on non-conscious inferencing which we call (pattern)
    &ldquo;recognition&rdquo;. If we were to look at what was actually falling on our retina it would be a 
    collection of &ldquo;lines&rdquo; and &ldquo;dots&rdquo;. It is the combination of our visual neurons and
    our visual cortex in our brain which piece together those visible elements into a &ldquo;man&rdquo;.
    &ldquo;Man&rdquo; is a mental phenomenon in our subjective mind, there is no &ldquo;man&rdquo; in the
     picture or on the screen or paper. There are only black-coloured marks.)
    </para>
    <para>The SVG path element defines a set of x,y co-ordinate pairs which describe a complex geometry.
     Simple geometries like circles, rectangles, etc have their own SVG elements such as circle, rect, etc.
     The SVG path collection which defines the Business Man Bob data set is a collection of named 
     sequences of x,y-pair co-ordinates. The frame or box that the Business Man Bob data set is seen in
     in the illustration has a standard SVG (graphics) origin of x,y = 0,0 being the upper left corner of
     the frame. (The system relies on that piece of knowledge in order to make sense of the terms found
     in the DAXSVG ontology, &ldquo;where&rdquo; up and down, left and right &ldquo;are&rdquo;.)</para>
     
     <figure anchor="fixed">  
        <title>The illustration shows "Betty Boop". The line-drawing is an example of a visual and numerical (paths)
        data set used as a source of information. Like Business Man Bob, Betty Boop has a head, torso, arms, legs
        and feet. (Eyes but no hat). The picture is 249 Y units high (y=249 is the bottom of the picture, y=0 is the
        top), she ranges from y=6 to y=242, her "height" is 236 Y units. The picture width is 143 X units. "Betty" 
        has a "foot" at y=224:242 and another at y=211:226.</title>
        <graphic figname="dodd050508" scale="10%"/> 
     </figure>
     
     <subsec1><title>Gensym names for SVG paths</title>
     
    <para>The system in this paper uses the gensym (generate symbol) technique of creating names, the 
    Business Man Bob
     collection of SVG paths uses the SVG Group element (g) to allow an SVG id to be defined for each path. The
     twenty-seventh SVG Path is shown next. It has been named g27, the twenty-seventh generated gensym name (g#).
     Each SVG group in the Business Man Bob data set has a unique SVG id using the gensym naming system.
    <verbatim><![CDATA[
    <g id="g27">
    	<path d="M 126 349 L 152 359 153 364 142 365 124 364 Z"
           style="fill:none; stroke:black; stroke-width:2"/>
    </g>
    ]]>
    </verbatim>There is no particular information contained in the name g27 other than it is the twenty-seventh
     name generated by the system (name generator). By giving the SVG path element a name (eg. g27) it is
     possible for XML programs to address the path x,y values symbolically, and also the name can be used in a
     context or ontology. The arm-length of the figure is 123 (y-units). The arm-length of this figure is its
     &ldquo;my arm&rsquo;s reach&rdquo;. The &ldquo;My&rdquo; body height is 275 (y-units).</para>
    
    <para>The values shown for the SVG path element in the illustration above defines the actual set of x,y
     co-ordinate pairs which describe a particular geometry in the Business Man Bob data set. To our human 
     eye we easily recognize it as a &ldquo;foot&rdquo; (specifically, the &ldquo;foot&rdquo; of 
     &ldquo;Business Man Bob&rdquo;). 
     </para>
     </subsec1>
 
     <subsec1><title>Cartesian co-ordinate system for spatial representation</title>
     
     <figure anchor="fixed">  
        <title>Rene Descartes defined a system for spatial representation. It is named after him and consists
        of axes or dimensions which are orthogonal to each other. Nowadays we use this system in our thinking
        so much that we forget about it largely. The illustration shows a visualization of cartesian co-ordinate
        system. It is the systemization of the concepts of cartesian spatial representation that allows science,
        and mathematics (algebra) to do things which benefit from (formal) depiction of spatial things.</title>
        <graphic figname="dodd050502" scale="10%"/>
     </figure>
        
     <figure anchor="fixed">  
        <title>The third dimension is depicted via an (z) axis which is orthogonal to both the x and the y axes, 
        as shown in this projection illustration. The page / screen is two dimensional so the third axis is
        depicted by a visual technique called projection. One can continue to apply the system to dimensions
        greater than 3 (3D) but it is very difficult to visually depict these. Sometimes "sequenced interval /
        change" of a 3D projection, such as below, is used to depict (the passage of) time. (using that change
        as a means of depicting the &ldquo;fourth dimension&rdquo;, that is, &ldquo;time&rdquo;.)</title>
        <graphic figname="dodd050503" scale="10%"/>
     </figure>

     </subsec1>
       
       
     <subsec1><title>Fuzzy functions defined using Continuous functions</title> 
      
     <figure anchor="fixed">  
        <title>The fuzzy function f(x) calculates a sigmoidal curve, with k1 being the center of the curve
        , and k2 the slope of the curve. The concepts of Near-Far, for example, may be represented using this 
        function.
        Far is computed by f(x), and Near is computed as its complementary function f'(x) = 1-f(x).
        [From the proceedings Dodds 1989, see the bibliography]</title>
        <graphic figname="dodd050504" scale="10%"/>
     </figure>  
      
     <figure anchor="fixed">  
        <title>The fuzzy function f(x) calculates a sigmoidal curve, with k1 being the center of the curve
        , and k2 the slope of the curve. The concepts of Near-Far, for example, may be represented using this 
        function.
        Far is computed by f(x), and Near is computed as its complementary function f'(x) = 1-f(x).
        [From the proceedings Dodds 1989, see the bibliography]</title>
        <graphic figname="dodd050505" scale="10%"/>
     </figure>
        
     <figure anchor="fixed">  
        <title>The fuzzy function f(x) calculates a sigmoidal curve, with k1 being the center of the curve
        , and k2 the slope of the curve. The concepts of Near-Far, for example, may be represented using this 
        function.
        Far is computed by f(x), and Near is computed as its complementary function f'(x) = 1-f(x).
        [From the proceedings Dodds 1989, see the bibliography]</title>
        <graphic figname="dodd050506" scale="10%"/>
     </figure>
        
     <figure anchor="fixed">  
        <title>The fuzzy function f(x) calculates a sigmoidal curve, with k1 being the center of the curve
        , and k2 the slope of the curve. The concepts of Near-Far, for example, may be represented using this 
        function.
        Far is computed by f(x), and Near is computed as its complementary function f'(x) = 1-f(x).
        [From the proceedings Dodds 1989, see the bibliography]</title>
        <graphic figname="dodd050507" scale="10%"/>
     </figure>

     <figure anchor="fixed">  
        <title>The fuzzy function f(x) calculates a sigmoidal curve, with k1 being the center of the curve
        , and k2 the slope of the curve. The concepts of Near-Far, for example, may be represented using this 
        function.
        Far is computed by f(x), and Near is computed as its complementary function f'(x) = 1-f(x).
        [From the proceedings Dodds 1989, see the bibliography]</title>
        <graphic figname="dodd090905" scale="10%"/> 
     </figure>

     <figure anchor="fixed">  
        <title>Graphical depiction of the fuzzy function f(x) &ldquo;sigmoidal&rdquo;, in this case x ranging
         from x=0 
        to x=+120. MV axis (y-axis) is the grade of  membership value. The sigmoidal labelled Far is the graph
        of f(x), while the sigmoidal labelled Near is its complement, 1 - f(x). [From the
         paper Dodds 1988, see the bibliography]</title>
        <graphic figname="dodd090912" scale="10%"/> 
     </figure>

        </subsec1>
        
        
     

   </section>



<para>Next have a look at Figure 7, the photograph of Monument Valley, and also look at Figure 8.</para>
    
    <figure anchor="fixed">  
        <title>Monument Valley. Illustration shows rock formation vertically oriented, compare with similar
         vertical orientation of source data set human figure Business Man Bob. That figure is the source or
         origin comparator for metaphors based on the spatial features of the human body.
	</title>
        <graphic figname="dodd090927" scale="10%"/> 
       </figure>
     
      <figure anchor="fixed">  
        <title>Illustration shows rock formation vertically oriented. It is recognizable to humans as a wall or
         canyon side. The data set Business Man Bob serves as the basis of a metaphor-tenor, i.e. visible 
         metaphor source. This rock wall serves as the metaphor-vehicle, or also known as metaphor comparand.
	</title>
        <graphic figname="dodd090928" scale="10%"/> 
       </figure>
       
<figure anchor="fixed">  
        <title>The illustration shows "join points" outlined via red coloured rounded corner rectangles. These rectangles
        visually make explicit the spatial (2D) aspect of aspect oriented programming. The (visual and conceptual) spatial
        relationship of the code "moveBy(int, int)" and "setX(int)" is very clear in this diagram. (The red rectangles 
        in this picture are vertically oriented.) Copyright 2004 Mik Kersten, University of British Columbia. </title>
        <graphic figname="dodd050509" scale="10%"/>
</figure>

<figure anchor="fixed">  
        <title>The illustration shows the O'Reilly book "AspectJ Cookbook" by Russ Miles. The AspectJ coding examples 
        shown in this paper come from this book. Copyright 2004 O'Reilly. </title>
        <graphic figname="dodd050510" scale="10%"/>
</figure>



<section><title>The MetaL meta-language for meta-programming</title>
 <para>
    <verbatim><![CDATA[
http://www.meta-language.net/sample.html
# Hello world! written in MetaL

Source code of the Hello world! program written in MetaL.

<?xml version="1.0"?>
<!--
     @(#) $Id: sample.html,v 1.5 2003/06/23 17:08:22 mlemos Exp $
  -->
<output>
 <script>
  <string>Hello World!&#10;</string>
 </script>
</output>
# Hello world! generated in Java

Source code of the Hello world! program generated in Java by the MetaL compiler.

public final class helloworld
{
	public static void main(String[] args)
	{
		System.out.print("Hello World!\n");
	}
}

# MetaL source code of a real example of a OOP class

Example of the definition of one real object oriented programming class written in Metal for generating XML documents.

<class>

 <documentation>
  <idiom>en</idiom>
  <purpose>Composing and generating XML documents.</purpose>
  <usage>The class has several independent functions that should be used
   to compose the structure of an XML document.  When the structure is
   fully composed, the <functionlink>write</functionlink> should be used
   to output the document in the XML format.</usage>
  <example>Here follows an example of typical use of this class:<pre><examplecode>

   <comment>First create an object of the class.</comment>
   <set> <xmlwriterobject /> <createxmlwriterobject /> </set>

   <comment>Now, start defining the XML document from the root tag.</comment>
   <set> <hashvariable>noattributes</hashvariable> <hash /> </set>
   <void><addxmlwritertag>
    <arguments>
     <tag><string>myxmldocument</string></tag>
     <attributes><variable>noattributes</variable></attributes>
     <parent><emptystring /></parent>
     <path><variable>root</variable></path>
     <indent><true /></indent>
    </arguments>
   </addxmlwritertag></void>

   <comment>Then define the rest of the document tags and data.</comment>
   <void><addxmlwritertag>
    <arguments>
     <tag><string>name</string></tag>
     <attributes><variable>noattributes</variable></attributes>
     <parent><buffervalue><variable>root</variable></buffervalue></parent>
     <path><variable>toptag</variable></path>
     <indent><false /></indent>
    </arguments>
   </addxmlwritertag></void>
   <void><addxmlwriterdata>
    <arguments>
     <data><string>John Doe</string></data>
     <parent><buffervalue><variable>toptag</variable></buffervalue></parent>
     <path><variable>path</variable></path>
    </arguments>
   </addxmlwriterdata></void>

   <comment>Tags may have attributes.</comment>
   <set> <hashvariable>attributes</hashvariable> <hash /> </set>
   <setentry>
    <hashvariable>attributes</hashvariable>
    <string>country</string>
    <string>us</string>
   </setentry>
   <void><addxmlwritertag>
    <arguments>
     <tag><string>address</string></tag>
     <attributes><variable>attributes</variable></attributes>
     <parent><buffervalue><variable>root</variable></buffervalue></parent>
     <path><variable>toptag</variable></path>
     <indent><true /></indent>
    </arguments>
   </addxmlwritertag></void>

   <comment>Tags and the correspondent data may be added with a single function call.</comment>
   <void><addxmlwriterdatatag>
    <arguments>
     <tag><string>street</string></tag>
     <attributes><variable>noattributes</variable></attributes>
     <parent><buffervalue><variable>toptag</variable></buffervalue></parent>
     <path><variable>datatag</variable></path>
     <data><string>Wall Street, 1641</string></data>
    </arguments>
   </addxmlwriterdatatag></void>
   <void><addxmlwriterdatatag>
    <arguments>
     <tag><string>zip</string></tag>
     <attributes><variable>noattributes</variable></attributes>
     <parent><buffervalue><variable>toptag</variable></buffervalue></parent>
     <path><variable>datatag</variable></path>
     <data><string>NY 72834</string></data>
    </arguments>
   </addxmlwriterdatatag></void>

   <comment>Any time before generating the document you may specify a DTD to let other tools validate it...</comment>
   <set>
    <xmlwriterobjectvariable>dtdtype</xmlwriterobjectvariable>
    <string>SYSTEM</string>
   </set>
   <set>
    <xmlwriterobjectvariable>dtdurl</xmlwriterobjectvariable>
    <string>myxmldocument.dtd</string>
   </set>

   <comment>...and a stylesheet for displaying the document in particular way in XML capable browsers.</comment>
   <set>
    <xmlwriterobjectvariable>stylesheettype</xmlwriterobjectvariable>
    <string>text/xsl</string>
   </set>
   <set>
    <xmlwriterobjectvariable>stylesheet</xmlwriterobjectvariable>
    <string>myxmldocument.xsl</string>
   </set>

   <comment>When you are done with the XML document definition, generate it.</comment>
   <if>
    <istrue>
     <writexml>
      <arguments>
       <output><variable>output</variable></output>
      </arguments>
     </writexml>
    </istrue>
    <then>

     <comment>If the document was generated successfully, you may not output it.</comment>
     <buffervalue><variable>output</variable></buffervalue>

    </then>
    <else>
     <comment>If there was an error, output it as well.</comment>
     <group><string>Error: </string><join /><xmlwriterobjectvariable>error</xmlwriterobjectvariable></group>
    </else>
   </if>

  </examplecode></pre></example>
 </documentation>

 <file><installpath />/library/xml/xml_writer_class<languageextension /></file>
 <basepath><openpath /></basepath>
 <tag>METAL_LIBRARY_XML_XML_WRITER_CLASS</tag>
 <version>@(#) $Id: sample.html,v 1.5 2003/06/23 17:08:22 mlemos Exp $</version>
 <copyright>Copyright  (C) Manuel Lemos 2001-2002</copyright>
 <title>XML writer</title>
 <author>Manuel Lemos</author>
 <authoraddress>mlemos@acm.org</authoraddress>

 <variable>
  <name>structure</name>
  <type>HASH</type>
  <value></value>
  <protected />
 </variable>

 <variable>
  <name>nodes</name>
  <type>HASH</type>
  <value></value>
  <protected />
 </variable>

 <variable>
  <name>stylesheet</name>
  <type>STRING</type>
  <value></value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Define the URL for the default stylesheet definition to be
    used render the XML document.</purpose>
   <usage>If you intend that browsers display this document in specific
    way define the URL of where it is located the stylesheet to be used
    to render the document. Set this variable to an empty string if you
    do not intend to specify a stylesheet.</usage>
  </documentation>
 </variable>

 <variable>
  <name>stylesheettype</name>
  <type>STRING</type>
  <value>text/xsl</value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Stylesheets may be of several types. This variable defines
    the MIME content type of the stylesheet specified for this document.</purpose>
   <usage>Set this variable to MIME designation for the type of
    stylesheet defined by the variable
    <variablelink>stylesheet</variablelink>.</usage>
   <example><tt><stringvalue>text/css</stringvalue></tt></example>
  </documentation>
 </variable>

 <variable>
  <name>dtdtype</name>
  <type>STRING</type>
  <value></value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Define which type of document type definition (DTD).</purpose>
   <usage>If you intend to specify a DTD, eventually for validation
    purposes, set this variable to either:
    <stringvalue>INTERNAL</stringvalue>,
    <stringvalue>SYSTEM</stringvalue> or
    <stringvalue>PUBLIC</stringvalue>. Set this variable to an empty
    string to not use a DTD. <stringvalue>INTERNAL</stringvalue> mean
    that the DTD is bein defined inline within the
    <variablelink>dtddefinition</variablelink> variable.
    <stringvalue>SYSTEM</stringvalue> or
    <stringvalue>PUBLIC</stringvalue> means that the DTD is defined in
    an external resource defined by either
    <variablelink>dtddefinition</variablelink> or
    <variablelink>dtdurl</variablelink>.</usage>
  </documentation>
 </variable>

 <variable>
  <name>dtddefinition</name>
  <type>STRING</type>
  <value></value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Define of the DTD.</purpose>
   <usage>For an internal DTD, this variable should contain the actual
    DTD definition. For an external DTD, it should be of the form
    <tt><stringvalue>Registration//Organization//Type Label//Definition Language</stringvalue></tt>.</usage>
   <example>Example of an internal DTD definition:<pbr />
    <tt><stringvalue>&lt;!ELEMENT html (head, body)&gt;&#10;&lt;!ELEMENT head (title?)&gt;&#10;&lt;!ELEMENT title (#PCDATA)&gt;&#10;&lt;!ELEMENT body (#PCDATA)&gt;&#10;</stringvalue></tt><pbr />
    Example of an external DTD definition:<pbr />
    <tt><stringvalue>-//W3C//DTD XHTML 1.0 Strict//EN</stringvalue></tt></example>
  </documentation>
 </variable>

 <variable>
  <name>dtdurl</name>
  <type>STRING</type>
  <value></value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Define the URL of an external DTD.</purpose>
   <usage>Optionally specify an absolute or relative URL of an external
    DTD.</usage>
   <example><tt><stringvalue>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</stringvalue></tt></example>
  </documentation>
 </variable>

 <variable>
  <name>outputencoding</name>
  <type>STRING</type>
  <value>utf-8</value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Define the character set encoding of the output
    document.</purpose>
   <usage>Currently the class supports only the encodings <tt>utf-8</tt>
    or <tt>iso-8859-1</tt>.</usage>
  </documentation>
 </variable>

 <variable>
  <name>inputencoding</name>
  <type>STRING</type>
  <value>iso-8859-1</value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Define the character set encoding of the of the data values
    passed to the function <functionlink>adddata</functionlink> or the
    attribute values passed to the function
    <functionlink>addtag</functionlink>.</purpose>
   <usage>Currently the class supports only the encodings <tt>utf-8</tt>
    or <tt>iso-8859-1</tt>.</usage>
  </documentation>
 </variable>

 <variable>
  <name>linebreak</name>
  <type>STRING</type>
  <value>&#10;</value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Characters to be used when breaking lines of the output XML
    document.</purpose>
   <usage>Use either <stringvalue>&#10;</stringvalue>,
    <stringvalue>&#13;&#10;</stringvalue> or
    <stringvalue>&#13;</stringvalue>.</usage>
  </documentation>
 </variable>

 <variable>
  <name>indenttext</name>
  <type>STRING</type>
  <value> </value>
  <documentation>
   <idiom>en</idiom>
   <purpose>Characters to be used when indenting the lines of the output
    XML document.</purpose>
   <usage>Use either one or more spaces or tab characters.</usage>
  </documentation>
 </variable>

<function>
  <name>escapedata</name>
  <type>STRING</type>
  <protected />
  <argument>
   <name>data</name>
   <type>STRING</type>
  </argument>
  <do>
   <set> <variable>position</variable> <zero /> </set>
   <set> <variable>length</variable> <length><argument>data</argument></length> </set>
   <set> <variable>escapeddata</variable> <emptystring /> </set>
   <loop>
    <while>
     <variable>position</variable> <less /> <variable>length</variable>
    </while>
    <do>
     <set>
      <variable>character</variable>
      <substring>
       <argument>data</argument>
       <variable>position</variable>
       <one />
      </substring>
     </set>


# Java class generated from MetaL source code

Example of the Java code generated from the MetaL source code above.

/*
 *
 * Copyright  (C) Manuel Lemos 2001-2002
 *
 * @(#) $Id: sample.html,v 1.5 2003/06/23 17:08:22 mlemos Exp $
 *
 */

import java.util.Hashtable;

public class xml_writer_class
{
	protected Hashtable structure=new Hashtable();
	protected Hashtable nodes=new Hashtable();
	
	public String stylesheet="";
	public String stylesheettype="text/xsl";
	public String dtdtype="";
	public String dtddefinition="";
	public String dtdurl="";
	public String outputencoding="utf-8";
	public String inputencoding="iso-8859-1";
	public String linebreak="\n";
	public String indenttext=" ";
	public String error="";
	
	protected String escapedata(String data)
	{
		int position;
		int length;
		String escapeddata;
		String character;
		int code;
		
		position=0;
		length=data.length();
		escapeddata="";
		for(;position<length;)
		{
			character=data.substring(position,position+1);
			code=(int)(character.charAt(0));
			switch(code)
			{
				case 34:
					character="&quot;";
					break;
				case 38:
					character="&amp;";
					break;
				case 39:
					character="&apos;";
					break;
				case 60:
					character="&lt;";
					break;
				case 62:
					character="&gt;";
					break;
				default:
					if(code<32)
						character=("&#"+java.lang.String.valueOf(code)+";");
					break;
			}
			escapeddata=escapeddata.concat(character);
			position++;
		}
		return escapeddata;
	}
	
	protected boolean encodedata(String data, String[] encodeddata) throws java.io.UnsupportedEncodingException
	{
		String _switch_value;
		String encoded_data;
		String decoded;
		
		if(this.inputencoding.equals(this.outputencoding))
			encodeddata[0]=this.escapedata(data);
		else
		{
			_switch_value=this.outputencoding.toLowerCase();
			switch(_switch_value.equals("utf-8") ? 0 : (_switch_value.equals("iso-8859-1") ? 1 : 2))
			{
				case 0:
					if(this.inputencoding.toLowerCase().equals("iso-8859-1"))
					{
						encoded_data=new String(this.escapedata(data).getBytes("UTF8"));
						encodeddata[0]=encoded_data;
					}
					else
					{
						this.error=("can not encode iso-8859-1 data in "+this.outputencoding);
						return false;
					}
					break;
				case 1:
					if(this.inputencoding.toLowerCase().equals("utf-8"))
					{
						decoded=new String(data.getBytes(),"UTF8");
						encodeddata[0]=this.escapedata(decoded);
					}
					else
					{
						this.error=("can not encode utf-8 data in "+this.outputencoding);
						return false;
					}
					break;
				default:
					this.error=("can not encode data in "+this.inputencoding);
					return false;
			}
		}
		return true;
	}
	
	protected boolean writetag(String[] output, String path, String indent)
	{
		String tag;
		int attributecount;
		Hashtable attributes;
		String key;
		boolean end;
		Object cursor;
		int elements;
		boolean doindent;
		String elementindent;
		int element;
		String elementpath;
		
		tag=((String)((Hashtable)this.structure.get(path)).get("Tag"));
		output[0]=output[0].concat(("<"+tag));
		attributecount=((Hashtable)((Hashtable)this.structure.get(path)).get("Attributes")).size();
		if(attributecount>0)
		{
			attributes=((Hashtable)((Hashtable)this.structure.get(path)).get("Attributes"));
			cursor=(Object)attributes.keys();
			end=!((java.util.Enumeration)cursor).hasMoreElements();
			key=end ? null : (String)((java.util.Enumeration)cursor).nextElement();
			for(;!end;)
			{
				output[0]=output[0].concat((" "+key+"=\""+((String)attributes.get(key))+"\""));
				end=!((java.util.Enumeration)cursor).hasMoreElements();
				key=end ? null : (String)((java.util.Enumeration)cursor).nextElement();
			}
		}
		elements=((Integer)((Hashtable)this.structure.get(path)).get("Elements")).intValue();
		if(elements>0)
		{
			output[0]=output[0].concat(">");
			doindent=((Boolean)((Hashtable)this.structure.get(path)).get("Indent")).booleanValue();
			elementindent=((doindent) ? this.linebreak+indent+this.indenttext : "");
			element=0;
			for(;element<elements;)
			{
				elementpath=(path+","+java.lang.String.valueOf(element));
				output[0]=output[0].concat(elementindent);
				if(this.nodes.containsKey(elementpath))
				{
					if(!(this.writetag(output,elementpath,indent+this.indenttext)))
						return false;
				}
				else
					output[0]=output[0].concat(((String)this.structure.get(elementpath)));
				element++;
			}
			output[0]=output[0].concat((((doindent) ? this.linebreak+indent : "")+"</"+tag+">"));
		}
		else
			output[0]=output[0].concat("/>");
		return true;
	}
	
	public boolean write(String[] output)
	{
		String _switch_value;
		
		if(!this.error.equals(""))
			return false;
		if(!(this.structure.containsKey("0")))
		{
			this.error="XML document structure is empty";
			return false;
		}
		output[0]=("<?xml version=\"1.0\" encoding=\""+this.outputencoding+"\"?>"+this.linebreak);
		if(!this.dtdtype.equals(""))
		{
			output[0]=output[0].concat(("<!DOCTYPE "+((String)((Hashtable)this.structure.get("0")).get("Tag"))+" "));
			_switch_value=this.dtdtype;
			switch(_switch_value.equals("INTERNAL") ? 0 : (_switch_value.equals("SYSTEM") ? 1 : (_switch_value.equals("PUBLIC") ? 2 : 3)))
			{
				case 0:
					if(this.dtddefinition.equals(""))
					{
						this.error="it was not specified a valid internal DTD definition";
						return false;
					}
					output[0]=output[0].concat(("["+this.linebreak+this.dtddefinition+this.linebreak+"]"));
					break;
				case 1:
					if(this.dtdurl.equals(""))
					{
						this.error="it was not specified a valid system DTD url";
						return false;
					}
					output[0]=output[0].concat("SYSTEM");
					if(!this.dtddefinition.equals(""))
						output[0]=output[0].concat((" \""+this.dtddefinition+"\""));
					output[0]=output[0].concat((" \""+this.dtdurl+"\""));
					break;
				case 2:
					if(this.dtddefinition.equals(""))
					{
						this.error="it was not specified a valid public DTD definition";
						return false;
					}
					output[0]=output[0].concat(("PUBLIC \""+this.dtddefinition+"\""));
					if(!this.dtdurl.equals(""))
						output[0]=output[0].concat((" \""+this.dtdurl+"\""));
					break;
				default:
					this.error="it was not specified a valid DTD type";
					return false;
			}
			output[0]=output[0].concat((">"+this.linebreak));
		}
		if(!this.stylesheet.equals(""))
		{
			if(this.stylesheettype.equals(""))
			{
				this.error="it was not specified a valid stylesheet type";
				return false;
			}
			output[0]=output[0].concat(("<?xml-stylesheet type=\""+this.stylesheettype+"\" href=\""+this.stylesheet+"\"?>"+this.linebreak));
		}
		return this.writetag(output,"0","");
	}
	
	public boolean addtag(String tag, Hashtable attributes, String parent, String[] path, boolean indent) throws java.io.UnsupportedEncodingException
	{
		Hashtable encodedattributes;
		String attribute_name;
		boolean end;
		Object cursor;
		String[] encoded_data={null};
		
		if(!this.error.equals(""))
			return false;
		path[0]=((parent.equals("")) ? "0" : (parent+","+java.lang.String.valueOf(((Integer)((Hashtable)this.structure.get(parent)).get("Elements")).intValue())));
		if(this.structure.containsKey(path[0]))
		{
			this.error=("tag with path "+path[0]+" is already defined");
			return false;
		}
		encodedattributes=new Hashtable();
		cursor=(Object)attributes.keys();
		end=!((java.util.Enumeration)cursor).hasMoreElements();
		attribute_name=end ? null : (String)((java.util.Enumeration)cursor).nextElement();
		for(;!end;)
		{
			encodedattributes.put(attribute_name,"");
			if(!(this.encodedata(((String)attributes.get(attribute_name)),encoded_data)))
				return false;
			encodedattributes.put(attribute_name,encoded_data[0]);
			end=!((java.util.Enumeration)cursor).hasMoreElements();
			attribute_name=end ? null : (String)((java.util.Enumeration)cursor).nextElement();
		}
		{
			Hashtable _hashtable=new Hashtable(4);
			
			_hashtable.put("Tag",tag);
			_hashtable.put("Attributes",encodedattributes);
			_hashtable.put("Elements",new Integer(0));
			_hashtable.put("Indent",new Boolean(indent));
			this.structure.put(path[0],_hashtable);
		}
		this.nodes.put(path[0],new Boolean(true));
		if(!parent.equals(""))
			((Hashtable)this.structure.get(parent)).put("Elements",new Integer((((Integer)((Hashtable)this.structure.get(parent)).get("Elements")).intValue()+1)));
		return true;
	}
	
	public boolean adddata(String data, String parent, String[] path) throws java.io.UnsupportedEncodingException
	{
		String[] encoded_data={null};
		
		if(!this.error.equals(""))
			return false;
		if(!(this.structure.containsKey(parent)))
		{
			this.error=("the parent tag path"+path[0]+"is not defined");
			return false;
		}
		if(data.equals(""))
			return true;
		path[0]=(parent+","+java.lang.String.valueOf(((Integer)((Hashtable)this.structure.get(parent)).get("Elements")).intValue()));
		if(!(this.encodedata(data,encoded_data)))
			return false;
		this.structure.put(path[0],encoded_data[0]);
		((Hashtable)this.structure.get(parent)).put("Elements",new Integer((((Integer)((Hashtable)this.structure.get(parent)).get("Elements")).intValue()+1)));
		return true;
	}

	public boolean adddatatag(String tag, Hashtable attributes, String data, String parent, String[] path) throws java.io.UnsupportedEncodingException
	{
		String[] datapath={null};
		
		return this.addtag(tag,attributes,parent,path,false) && this.adddata(data,path[0],datapath);
	}
};

]]>
    </verbatim>This DisplayUpdating.java explanation of preceding code.
    </para>
    
</section>
<!--
  The midpoint of the line segment connecting the point (x1 , y1) to point (x2 , y2) is

Midpoint = ((x1+x2)/2 , (y1+y2)/2).
-->


    



<section><title>Old Section are you Keeping it for this years paper</title>

<figure anchor="fixed">  
        <title>A representation of the SAW Situation Awareness Ontology.</title>
        <graphic figname="dodd090922" scale="10%"/> 
</figure>
   
   <para>Lakoff spatial metaphors have an &ldquo;origin&rdquo; (locus) or &ldquo;starting place&rdquo;
    (&ldquo;zero&rdquo;) based on the body of the
    person using the metaphor.
With substantial ease adult humans assign the origin of this space to being at the eyes of the self, or generally
 the outerbody surface (&ldquo;my outside&rdquo;) and as needed the innerbody volume bounded by that outerbody
  surface
  (&ldquo;my insides&rdquo;).
Humans are able to effectively &ldquo;move&rdquo; the origin from the body of self to some other location. This
 other
 place then gives the &ldquo;zero perspective&rdquo;.</para>
 <para>This is a visual depiction of constrained activity via the actors. It is a depicted context.
 The non- permeable barrier (obstruction) object visually represents a constraint.</para> 
 <para>This particular deBono diagram depicts goal oriented group behaviour in pursuit of achieving a goal but
  is blocked by an obstruction.
Lakoff spatial metaphors use orientation in three dimensional Euclidean space as representation.</para>
<para>The SVG animation file which accompanies this set of slides is an instance of deBono diagram combined with
 Lakoff spatial metaphor.
This particular deBono diagram depicts goal oriented group behaviour in pursuit of achieving a goal but is
 blocked by an obstruction.
Lakoff spatial metaphors use orientation in three dimensional Euclidean space as representation. deBono diagrams,
 shown in Atlas of Management Thinking, depict particles, which have trails, progressing from a starting point 
 moving along a path to some end point. The particles represent agents or actors (people) and the path represents
  spatial progress toward some location. The agents move toward a labeled goal area, with the passage of time. 
  There are &ldquo;physical constraints&rdquo; in the picture which prevent the paths from going just anywhere. These 
  constraints represent contexts, such as &ldquo;focus&rdquo;.
The diagrams have an implied &ldquo;gravity&rdquo; &ldquo;naive physics&rdquo; model) and visual objects (like walls) are not permeable.
 There is a temporal factor as well as spatial one.Visually the deBono diagram shows that the spatial progress 
 of two &ldquo;agents&rdquo; is halted by an obstruction, which moves into place as they approach near the goal, and the
  HML terms referenced depict that there is a concommitant socio-cultural aspect to such deliberate deflection 
  or blockage.this animation, then, visually presents through time the following metaphor. &ldquo;Actors&rdquo; 
  proceed 
  from initial starting points directly towards a goal area. The path represents effort or a journey and in
   this example is directly oriented to arriving at the goal area after some time has passed in the transit.
   Just as they are approaching near the goal area a physical barrier slides in front of them, preventing their
    further approach to the goal area. There is a tunnel  object in the picture which prevents the path from
     going to either side to circumvent the obstruction. This is a visual depiction of constrained activity 
     via the actors. It is a depicted context.The non- permeable barrier (obstruction) object visually 
     represents a constraint. Another actor, the obstructor, causes the occurance of the obstruction
      and it enters the context of the animation near the end of the animation duration time.
       The animation stops with the actors blocked from achieving the collective goal.</para>
       
       <para>The metaphor expressed via this computer representation 
is  that people act through time to achieve a goal. Metaphorically they take a journey along a path and ever
 more closely near the goal (fixed goal in this case). Constraints in the world affect their path and control
  their efforts. Achieving a goal takes time, it is not instantaneous and not without constraints.An actor
   can introduce deflections or blockages of progress. There is concomitant social and other affect which
    precedes actions and which is produced as the result of actions and events. These are modeled by use of HML.
deBono diagram paths and nonpermeable barriers are visual metaphors for activity and constraints in the world. 
Lakoff spatial aspects in this visual animation of metaphor are that there is directionality imposed on the 
visual space. The top is &ldquo;UP&rdquo;, and the bottom of the visual space is &ldquo;DOWN&rdquo;. While this seems commonsensical
 computers do not have any such built in notions and must be programmed with that information. Superimposed
  on top of deBono&rsquo;s naive physics model of agent paths is Lakoff&rsquo;s metaphor &ldquo;SUCCESS IS UP&rdquo;.
The closer the agent gets to the UP location (in this case the top of the picture) the greater his SUCCESS is.
This metaphor is often accompanied by the &ldquo;GOOD IS UP&rdquo; one as well, resulting in &ldquo;I felt
 really up having
 achieved my goals&rdquo;. Because the two meaning contexts (deBono diagram and Lakoff spatial) are 
 superimposed the animated diagram can depict, in a way meaningful to the computer; agent activity,
  constraints on that activity and can model or associate relevant HML terms with the events and the 
  actors participating. Example: for most of the period of the animation the actors are increasingly
   nearing the goal area, they are becoming increasingly successful. When the obstruction to further 
   progress occurs they no longer have increasing success. There is a measure of success but incomplete.
    There is thwarting of goal achievement. Frustration could be inferred to result from this. 
    HML is able to provide representation for this and a production system which uses HML terms
     can be used to infer (&ldquo;predict&rdquo; / detect) likely social outcomes from events in the actors 
     physical world (such as deliberate thwarting). The Human Markup Language (HML) structured
      vocabulary provides a standardized reference for the representation of socio-cultural 
      information conveyed and implied in the deBono (Lakoff) diagram.
Contexts and inferencing provide means for computer  determine appropriate terms use.
Constructing Metaphors:Because the metaphors are depicted visually and use XML SVG and other XML technologies,
 it is possible for the computer to do the following:
The locations, colors, sizes etc of all the graphics elements constituting an animation can be read
 by a program and used in inferencing.
The SVG code can be created by XSLT to produce animations anew. The animations could be designed to
 reflect a set of situations depicted by a graph structure like context graphs and or those indicated 
 by HML terms, which may have been participants in a chain of inferences. 
 DAML is used in OpenCYC and SUMO to express taxonomic interrelationships, amongst the general physical,
  cultural and social knowledge coded there. Terms like #$PurposefulAction and #$performedBy are
   related to other CYC concepts represented, in such a way that a reasoner can perceive &ldquo;connections&rdquo; 
   not directly stated in input.</para>
   <para>Metaphors permit people to convey their understanding of one thing through the
symbol associated with another. A representation of such metaphors provides
a useful means to characterize the commonalities among different complex sequences
of action that are observed, or that of spatial correspondences.</para>
    </section>
  
    
    
  <section><title>A Context in XGMML graph structure</title>
    
    <para>Here is a <highlight style="bold">context</highlight> represented by a graph structure. The XML name space
    is called  
      <acronym.grp>
              <acronym>XGMML</acronym> 
              <expansion>XML Graph Modeling and Markup Language</expansion> 
      </acronym.grp> with a few additions of my own. The attribute element &ldquo;att&rdquo; contained in a 
      &ldquo;node&rdquo; 
      element provides the information constituting a property-list. Nodes and edges may take weight values. A 
      timestamp value may be a property-list member and in some circumstances may be the sole discriminator which
      distinguishes one otherwise identical sub-graph from another. This represents the evolution of semantic data
      with the passage of time, and is one of the ways the system represents (and recognizes) &ldquo;persistence&rdquo;.
    </para>
    <para>
    <verbatim><![CDATA[
    <?xml-stylesheet type="text/xsl" href="xgmmlContext1xsl.xsl"?>  
    <!DOCTYPE graph SYSTEM "xgmml.dtd"> 
    <graph xmlns="http://www.cs.rpi.edu/XGMML" > 
    <node id="1" label="timestamp" weight="0">
    <graphics type="circle" x="270" y="90" h="10" >
    </graphics>
    <att name="systemtimestamp" value="2004-06-27T17:47:33+07:00"/> <!--EXSLT gets
    time and date from system puts it in node-->
    </node>
    <node id="2" label="AtRight" weight="0">
    <graphics type="circle" x="350" y="190" h="10" >
    </graphics>
    <att name="object" value="1"/>
    <att name="object" value="2"/>
    <att name="origin" value="upperleft"/>
    </node>
    <node id="3" label="object1" weight="0">
    <graphics type="circle" x="190" y="190" h="10" >
    </graphics>
    <att name="xcoord" value="110"/>
    <att name="ycoord" value="35"/>
    <att name="origin" value="upperleft"/>
    </node>
    <node id="4" label="object2" weight="0">
    <graphics type="circle" x="290" y="290" h="10" >
    </graphics>
    <att name="xcoord" value="120"/>
    <att name="ycoord" value="39"/>
    <att name="origin" value="upperleft"/>
    </node>
    <node id="5" label="object1" weight="0">
    <graphics type="circle" x="390" y="390" h="10" >
    </graphics>
    <att name="xcoord" value="210"/>
    <att name="ycoord" value="27"/>
    <att name="origin" value="upperleft"/>
    </node>
    <node id="7" label="object2" weight="0">
    <graphics type="circle" x="490" y="090" h="10" >
    </graphics>
    <att name="xcoord" value="220"/>
    <att name="ycoord" value="29"/>
    <att name="origin" value="upperleft"/>
    </node>
    <edge source="2" target="4" weight="0" label="Edge from node AtRight to node object2" >
    </edge>
    <edge source="1" target="2" weight="0" label="Edge from node timestamp to node AtRight" >
    </edge>
    <edge source="2" target="3" weight="0" label="Edge from node AtRight to node object1" >
    </edge>
    </graph>
    ]]></verbatim>The context graph immediately above is purposely very simple so that visual inspection of it 
    and reading in text what it represents should provide an immediate grasp of what it is and is used for. A 
    context graph in a production system would not be this simple or small, it would have many more nodes and links
    , representing (other) data objects, (other) spatial and temporal relationship predicates, other timestamps,
    and graph-edges (&ldquo;connections&rdquo;) to ontological-structures in RDF, DAML-OIL, Protege, etc., some 
    of which may represent additional contexts including &ldquo;situation&rdquo;. There is an
    XGMML example of context graph diagram SVG visualization-rendering with system datetimestamp. The XSLT program
    &ldquo;xgmmlContext1xsl.xsl&rdquo; is available for download at http://www.open-meta.com. This program scans a context graph
    network and translates it into a viewable SVG diagram picture, which makes it easier to visualize the
    relationships among a complex graph-node structure.
    </para>
   
    <para>
    This XML markup shows XGMML graph with a timestamp node at id=1 which points at a relationship node
    AtRight at id=2 and that node in turn points at object1 and object2 nodes at id=3 and id=4 respectively.
    The upshot is that a graph structure is defined of two objects in the relationship AtRight, occurring
    at time-date 2004-06-19T17:47:33+07:00. At some later time or date a timestamp node, say id=8, might point at id=2
    but then id=2 might be pointing at id=5 and id=7. This is how change and tracking of events is represented
    using a graph structure. The relationship might stay the same, as in AtRight, but the objects in the
    relationship change with time. A &ldquo;fixed place&rdquo; or &ldquo;anchor&rdquo; node 
    labelled &ldquo;now&rdquo; could successively point
    at new/current timestamp nodes. Edges can be labelled with the timestamp at the time of their generation.
    In this way we have a (re-visitable) synchronic episodic &ldquo;memory&rdquo;. 
    (These are the basic elements for a representation for A. Damasio&rsquo;s &ldquo;proto-self&rdquo; sequences.)</para>
    <para>The node attribute named &ldquo;origin&ldquo; indicates the type of SVG-axis graphic-origin for the
     SVG object represented. The default origin is
    in the upper left corner but SVG allows the origin to be redefined. By including the origin as an item
    in the context and the value for it obtained from the node attribute value (i.e. member of the property-list
    for the node) the system can know which test or
    condition to use, because the mathematical logical-comparison (for spatial orientation information) changes
    as the SVG origin location changes.</para>
    <para>The listing of the DAXSVG ontology (in RDF/S) follows. It is also available at, 
    http://www.open-meta.com. The DAXSVG spatial ontology is written in RDFS and was
    explained in <bibref refloc="bib4" />. It has an accompanying Java logic-set which provides the requisite actions
    for this ontology. While the RDFS version of this ontology can not take values a Protege ontology version
    can have slots defined and populated via the Java code.</para>
  </section>
  
  <section><title>An Ontology in RDFS, the DAXSVG Ontology</title>  
    <para>
    <verbatim><![CDATA[
    <!-- Copyright 2001 - 2004 David Dodds
    Context { 
              change of state, 
              occurrence of event, 
              occurrence of particular pattern of states and or events, 
              occurrence of a sequence (detected via HMM Hidden Markov Model), or graph 
              (such as XGMML)
    }
    -->
    
<rdf:RDF xml:lang="en"
               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
               xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<rdfs:Class rdf:ID="SvgEntity">
        <rdfs:comment>The class of SVG entities, referenced by their id in the SVG code. 
        THIS schema is modeled on the schema at 
        http://www.w3.org/2000/01/rdf-schema#Resource. 
        It is intended for use in tandem with it. It is called daxsvg-schema-rdf.xml
        </rdfs:comment>
        <rdfs:subClassOf rdf:resource="http://www.open-meta.com/2000/01/rdf-schema#Resource"
         />
</rdfs:Class>

<rdf:Property ID="Near">
	<rdfs:comment>has a degree of nearness (by value). g1(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Far">
	<rdfs:comment>has a degree of farness (by value). complement of near, 1 - g1(x)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Large">
	<rdfs:comment>has a degree of largeness (by value). g2(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Small">
	<rdfs:comment>has a degree of smallness (by value). complement of large, 1 - g2(x)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Big">
	<rdfs:comment>has a degree of largeness (by value). g2(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Little">
	<rdfs:comment>has a degree of smallness (by value). complement of large, 1 - g2(x)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Fast">
	<rdfs:comment>has a degree of quickness (by value). g3(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Slow">
	<rdfs:comment>has a degree of slowness (by value). complement of isfast, 1 - g3(x)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Before">
	<rdfs:comment>has a degree of occurance (by value) at time values monotonically decreasing
	 from a value t1, on the T(x) timeline. g31(x). a named ordered collection may be used 
	 instead of the timeline.</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="During">
	<rdfs:comment>has a degree of occurance (by value) at time values between t1 and t2, on the
	 T(x) timeline. g32(x). a named ordered collection may be used instead of the timeline.
	 </rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="After">
	<rdfs:comment>has a degree of occurance (by value) at time values monotonically increasing
	 from a value t2, on the T(x) timeline. g33(x). a named ordered collection may be used 
	 instead of the timeline.</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Often">
	<rdfs:comment>has a degree of quickness (by value). g4(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Seldom">
	<rdfs:comment>has a degree of infrequency (by value). complement of often, 1 - g4(x)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Simultaneously">
	<rdfs:comment>has a degree of multiplicity (by value). g5(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Egressive">
	<rdfs:comment>has a degree of departureness (by value). g6(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Ingressive">
	<rdfs:comment>has a degree of arrivedness (by value). complement of egressive, 1 - g6(x)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Changing">
	<rdfs:comment>has a degree of changingness or quickness (by value). g7(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Static">
	<rdfs:comment>has a degree of unchangingness (by value). complement of changing, 1 - g7(x)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Touches">
	<rdfs:comment>has a degree of same location (by value). same location as object's x,y g14(z)
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="AtRight">
	<rdfs:comment>has a degree of to the right (by value). g15(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="AtLeft">
	<rdfs:comment>has a degree of to the left (by value). g16(x)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Center">
	<rdfs:comment>has a degree of [at the] centerness (by value). g8(x). 
	SVG maxx - minx / 2, maxy - miny / 2</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Periphery">
	<rdfs:comment>has a degree of outerness (by value). complement of center, 1 - g8(x) 
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Containz">
	<rdfs:comment>has a degree of containingness (by value). uses center g8(x). [Note: Contains 
	(with an s) is already defined in the schema axsvg-schema-rdf at w3.org] </rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Lacunarity">
	<rdfs:comment>presents a curve (by value). Its fractal lacunarity L.    g9()</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="FractalDimension">
	<rdfs:comment>presents a curve, surface, or volume (by value).Its fractal dimension D. g10()
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Significance">
	<rdfs:comment>has a degree of importance (by value). Product of relevance g11() and novelty
	 g12()</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Top">
	<rdfs:comment>absolute marker, maximum y value in 2D reference system. (SVG miny, origin 
	upper left)</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Bottom">
	<rdfs:comment>absolute marker, minimum y value in 2D reference system. SVG maxy
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Left">
	<rdfs:comment>absolute marker, minimum x value in reference system. SVG minx</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Right">
	<rdfs:comment>absolute marker, maximum x value in reference system. SVG maxx</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Front">
	<rdfs:comment>absolute marker, 0 degree angle in reference system x axis</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Back">
	<rdfs:comment>absolute marker, 180 degree angle in reference system x axis</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Above">
	<rdfs:comment>absolute marker, 90 degree angle in reference system z axis</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Below">
	<rdfs:comment>absolute marker, -90 degree angle in reference system z axis</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Inside">
	<rdfs:comment>has a degree of insideness (by value). g27(x). inside is the containee 
	perspective of containz</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="Self">
	<rdfs:comment>reference to outer extents of (containz) subjective reference system
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="colour">
	<rdfs:comment>numerical representation of colours using rgb model</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="morphology">
	<rdfs:comment>description vector defining shape of something. includes fractal D and L.
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="size">
	<rdfs:comment>a second order descriptor which is a relative measure of object area or 
	volume.	The SVG canvas information contained in the SVG element of a picture is usually
	the basis of the relative comparison. This is used as the reference frame. The box method
	of fractal dimension may also be used to obtain a measure of size.</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="location">
	<rdfs:comment>a second order descriptor which uses the Near, Far, AtRight, AtLeft, 
	InFrontof, Above, Below, Behind, Inside, Containz, Beside, Periphery, Center, Touches
	predicates as necessary and is represented either by a property list representation of
	the resulting findings or by an XGMML context graph structure as needed.</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="mobility">
	<rdfs:comment>description vector defining position change of something. includes fractal D 
	and L.</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>

<rdf:Property ID="time">
	<rdfs:comment>description vector defining time count of something relative to a beat source;
	 or sequence. The default source of time is the computer system clock (i.e. timestamp).
	 </rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
</rdf:Property>
    
    </rdf:RDF>
    ]]></verbatim>
    </para>
    
    <para>The above DAXSVG ontology contains the  semantics for describing the important aspects of the
    spatial domain including in particular relative spatial location (predicates) from a reference point
    making those semantic elements <highlight style="bold">situated</highlight>. Situated &ldquo;perception&rdquo;
    is very important in deciding what to do to achieve goals (i.e. planning) and previous other systems
    which used context-free planning generated much more complicated plans to achieve a same goal.</para>
    
    <para>The RDF Schema comment in each of the above ontology items does not contain executable information.
    That is to say that RDF cannot read and interpret the content of a comment. Comments in ontologies
    are meant to be annotations, for human eyes not machine consumption.</para> 
  </section>
  
  <section><title>CYC OWL Ontology</title>
    <para>Some ontology systems, such as CYC 0.60b OWL, have much more extensive comment sections than my
    DAXSVG has. A single item from CYC OWL is shown below for comparison of use of rdfs:comment.</para>
    <para>
    <verbatim><![CDATA[
    <owl:Class rdf:ID="ActorSlot">
            <rdfs:label xml:lang="en">predicates describing actors in events</rdfs:label>
            <rdfs:comment>A collection of binary predicates; a
                specialization of #$Role.  Each instance of #$ActorSlot
                relates some instance of #$Event to a temporal thing
                involved in that event (here called a  participant ,
                although the thing in question might not be playing an
                active role in the event).  The first argument of every
                instance of #$ActorSlot is constrained to be an instance of
                some specialization of #$Event, and the second argument is
                constrained to be an instance of some specialization of
                #$SomethingExisting.  All instances of #$ActorSlot have
                #$actors as their #$genlPreds, directly or indirectly, so
                that the actor slots form a kind of hierarchy.  Each
                specialized actor slot indicates _how_ its participant
                participates in the event, i.e., in what role (e.g.,
                #$inputs, #$outputs, #$doneBy).  Actor slots are _not_ used
                to indicate the time of an event&apos;s occurrence, external
                representations of the event, and other more remotely
                related things that are not directly or indirectly  involved
                in the occurrence of the event.  Time and other quantities
                are relevant to events but are not instances of
                #$SomethingExisting; thus, they are related to events by
                some non-#$ActorSlot predicate.  Things which are remotely
                related to the event -- for instance, someone who is
                affected by the event but doesn&apos;t exist when the event
                occurs -- may be related using some instance of #$Role that
                does not belong to #$ActorSlot, such as #$affectedAgent.
                See also #$Role.</rdfs:comment>
            <guid>bd588029-9c29-11b1-9dad-c379636f7270</guid>
            <rdf:type rdf:resource="#PublicConstant-DefinitionalGAFsOK"/>
            <rdf:type rdf:resource="#PublicConstant-CommentOK"/>
            <rdf:type rdf:resource="#PublicConstant"/>
            <rdf:type rdf:resource="#PredicateCategory"/>
            <rdf:type rdf:resource="#AtemporalNecessarilyEssentialCollectionType"/>
            <rdfs:subClassOf rdf:resource="#BinaryRolePredicate"/>
    </owl:Class>
    ]]></verbatim>
    </para>
    </section>
    
  <section><title>DAXSVG Ontology has Associated Java Code</title>
    <para>In the case of the DAXSVG ontology
    above the comments tell (us) the nature of the logic implemented by the Java code which is
    associated with this ontology. For example, the AtRight predicate in the above ontology has associated
    Java code which calculates the <highlight style="ital">degree</highlight> to which the predicate is true.
    RDF is designed to operate as though a true or false system but my associated Java is able to
    calculate shades of grey for predicates because context is used. How context is used to do this is
    explained in the presentation <bibref refloc="bib5" />. Code details showing how that is done
    are explicitly given further on in this paper.</para>
    
    <para>An example of a boolean determination of AtRight, is shown next, in Java.</para>
    <para>
    <verbatim><![CDATA[
    	public boolean AtRight( int x1, int x2 )
    	        {
    	            if (x1 < x2 )
    	            {
    	                return true;
    	            }
    	            else
    	            {
    	                return false;
    	            }
            }
    ]]></verbatim>
    </para>
    <para>Each of the RDF predicates in DAXSVG has a program member written in Java. These programs 
    , like the one above, provide required actions for the DAXSVG ontology. The Java program above is
    purposely simplified for illustrative purposes. </para>
    <para>The nature of the simplification is this, the above
     program provides a boolean or true / false dichotomization of there being a &ldquo;to the right&rdquo; spatial
     relationship existing at the time of testing between two (SVG) objects whose (SVG) x-axis origin values
     are x1 and x2. The DAXSVG, as can be seen by reading the comments for the predicates in it, is used not
     as a boolean type system of true / false but rather a continuous system implementing shades of grey.
     A boolean function such as the one shown above can only detect &ldquo;to the right&rdquo; being true or false,
     all or nothing. Code used in association with the DAXSVG predicates computes a degree or how much the
     spatial (or other) predicate is true. The
     predicates themselves in the DAXSVG are conceptual identifiers they do not detect or compute the shade of
     grey themselves. Each DAXSVG conceptual identifier has associated with it one or more Java code modules.
     Together the DAXSVG predicates and the associated code modules comprise a kind of (collection of) 
     ontological-object. Objects
     in computing have both a data aspect and an executable aspect (such as methods).</para>
    <para>The programs in the Java collection have a scheduler
    program which runs them as needed, and provides the information needed for their parameters.
    This scheduler and parameter definer are components of the meta-programming system which operates my
    system discussed in this paper.</para>
    <para>The above program is designed to be run to obtain a truth value for the predicate AtRight
    (in the DAXSVG ontology as shown above). There are two (SVG) objects being analyzed by the program,
    object one and object two.  The <highlight style="bold">context</highlight>, uses the item 
    <highlight style="ital">actorLocation</highlight> (among other predicates such as
    <highlight style="ital">hasCurrentAction</highlight>, <highlight style="ital">actorRole</highlight>,
    which were seen above in the section &ldquo;An Ontology in DAML-OIL&rdquo;).
    The context item actorLocation is used to activate the Java module which performs the required actions 
    associated with that predicate. The Java program actorLocation( ) therefore is run to perform the required
    activities. In the program actorLocation( ) there is code to examine the SVG picture for the presence of
    and corresponding values for the property AtRight, AtLeft, InFrontof,  Above, etc as deemed necessary
    in the spatial ontology. The term &ldquo;actorLocation&rdquo;, for example, has a (morphological) component
    of &ldquo;location&rdquo; in its name and the system is able to determine from the spatial ontology that
    the spatial concept &ldquo;location&rdquo; is constituted by  spatial elements whose predicates are Near,
    Far, AtRight, AtLeft, InFrontof,  Above, Below, Behind, Inside, Containz, Beside, Periphery, Center, Touches
    (in the DAXSVG spatial ontology). The knowledge to use this particular collection of predicates is
    procedurally embedded in the program actorLocation( ). 
    [An example program, uottcontext1.xsl, implements an ontology scanner (for the context
    ontology uottcontext1.xml) which identifies such items as actorLocation and indicates the corresponding 
    Java module to run and its parameters. An example of a parameter would be the range which the x value
    ranges over in spatial calculations in the module. Such ranges are defined by context.]
   </para>
    <para>The meta-programming scheduler, which acts as the system's activity dispatcher, was initially hand-coded
     with the following knowledge, and hence &ldquo;knows what to do&rdquo; in order to use the context appropriate
     to &ldquo;perceiving&rdquo; (the content of) an SVG picture. (such as anim01a.svg)</para>
    <para>A generalized meta-program for defining a scheduler sequence to run programs for perceiving an SVG picture could be
    programmatically arrived at by parsing/scanning the ontologies for spatial and temporal terms, such as
    DAXSVG, the UTContext ontology (above) and the Temporal Ontology (time and date predicates). The resulting
    plethora of predicates that could be scheduled would needs be pruned or thinned by using a measure of
    relevancy or applicability to remove some predicates from the meta-program's scheduler list.</para>
    <para>Remember actorLocation from the section above titled A Context Ontology?</para>
   
    <para>identifyActor( ) is a function which examines the SVG picture, anim01a.svg in this case, and
    finds actor 'arrowstreamer' and function getLocation( ) locates 'arrowstreamer' at x="110",
     and similarly actor 'particlestreamer' at x="120". (See the section below
    titled Partial listing of SVG animation code to see the actual SVG code that is examined by the functions
    getLocation( identifyActor( ) ).) In this purposely simplified scenario 'arrowstreamer' and 'particlestreamer'
    qualify as actors because they have motion or move. They are animated in the SVG animation anim01a.svg.
    This is explicit in the SVG picture code and easy to detect. (What is less simple to perceive programmatically
    is the difference between a moving actor and a moving direct object.)</para>
    <para>Now the system knows actor 'arrowstreamer' is actor1, and actor 'particlestreamer' is actor2. (The system
    is able to count actors found.) It can therefore assign x="110" to x1, and x="120" to x2. Using the 
    &ldquo;ontological calculation&rdquo; AtRight( ), which we just saw above, the system can "see" (determine) that 
    actor 'particlestreamer' is to the right of (AtRight) actor 'arrowstreamer'.</para>
    <para>An enlarged scenario of simplified
    (read boolean not degree or magnitude) code appears next. Following that is the code for how the DAXSVG
    Java modules can receive their parameters, such as (via) a description of the environment the relationships
    are embedded or working in. That explains, using code modules, how degree and magnitude are computed.</para>
    
    <para>Here is a further example of simplified Java code which illustrates how the system
    can perform logic using both the ontological predicates like AtRight and actual data values obtained from the
    SVG diagram or picture under discussion, 
    as in the SVG animation code shown further below.</para>
    
    <!-- 
    f(x) = 1/2 + 1/PI*arctan(x-k(1)/k(2))     
    context=what is the range of x, and what are the values of k1 and k2
	g(x) = exp-((x-k(1)/k(2))^2)              
	context=what is the range of x, and what are the values of k1 and k2
	centroidsdistance = sqrt((x2-x1)^2+(y2-y1)^2) 
	-->
  </section>
    
  <section><title>Metaphor in Science and Technology</title>
    <para>In <bibref refloc="bib1" /><bibref refloc="bib7" /><bibref refloc="bib10" /> metaphor in science is
    discussed and the role that the various kinds of metaphor play in Physics and Astronomy in representation
    and modeling of phenomena which have no simple analog in geometry or simple mathematics. Metaphor in
    science has been a means whereby the partial ordering structure of the transfer metaphor process has been
    a great lever to creative models. Some of these models are well known to the public 
    such as &ldquo;Black Hole&rdquo;, &ldquo;Event Horizon&rdquo;, &ldquo;Dark Matter&rdquo;, and
    &ldquo;Gravity Lens&rdquo;. It is because the partial structure
    transfer properties of the metaphors <bibref refloc="bib1" /><bibref refloc="bib8" /> suggest properties
    that at first were not as obvious as the metaphor seed or initial insight which provided the metaphor
    that it is a mainstay of science. Through the use of context and ontologies computers can be made
    capable of generating and recognizing these very powerful means of representation. In the next section we
    see example code and ontology data sets which illustrate how a computer can generate and 
    &ldquo;perceive&rdquo; / detect metaphors.</para>
   <para>Now we have a conceptual example, many people are familiar with the funnel diagram often used to 
    depict the concept
    of both a gravity well and of a black hole. The gravity well term is easy to understand as a scientific
    metaphor because most everybody knows what a (water) well is and what they usually look like. The metaphor
    is made whereby the (depth of the) walls of a typical generic waterwell are used to represent strength of
    gravity. By analogy depth is gravity-strength most anyone can comprehend that. Because gravity-strength
    changes analogically as one descends the well the well has its walls depicted more and more close together
    to reinforce the relationship of actual gravity-strength at a given depth. </para>
    <para>The bottom of the funnel or inverted cone is the location of
    the black hole and the top mouth part of the funnel is the event horizon. SVG can represent the cone
    diagram figure quite easily. Looking down the funnel from the mouth can be represented in SVG as 
    radial-gradient, which is displayed visually as either a continuously changing shade of grey from the
    outer circumference towards the center of the circle, or from the opposite direction. SVG can also 
    represent the same SVG 
    radial-gradient as continuously changing colour spectrum from the outside to the inside (or vice-versa).
     Either way
    the radially changing colour pattern is a metaphor for the changing gravity strength according to
    location in the (metaphorical) cone or well. See Figures 21 and 22 below for SVG illustrations of colour
    radial gradients.</para>
    <para>Also most everyone has observed the swirling pattern water makes as it empties from a sink down
     the drain. A not extra-ordinary imagination can be used to transpose this swirling water going down
     the sink drain hole onto a circular event horizon with its matter swirling around and dropping down
     into a black hole. It is this ability to visualize the correspondences such as swirling water draining
     in a sink and swirling matter draining down into a black hole that give us the ability to recognize and
     to generate metaphors. (Yes, many metaphors are inspired by visio-spatial cognition and not initially by
     words or language. The languaging is applied afterward to the visio-spatial realizations. A daily example
     of this is the ability to walk along a crowded sidewalk and not collide with others there. It is a
     cognitive visio-spatial projection of the other&rsquo;s short term path, there is no language involved. Some
     honest introspection while walking will demonstrate this to you.)</para>
     <para>Not surprisingly many metaphors are spatial and derived from the subjective experience of one&rsquo;s own
     body. (My height, my size, the reach of my arm, three paces(my steps), running quickly.)</para>
  </section>
    
  <section><title>Transfer and Corresponding Metaphor Process CMP</title>
    <para>How
    Transfer and Corresponding Metaphor Process are performed using spatial and temporal ontologies and their
    Java support code is discussed here. The ontologies will be shown and the Java source code as well.
    This section discusses what transfer is in the metaphor process. In this paper the term
    Corresponding Metaphor Process is used to refer to a means of implementing transfer. In the 
    Metaphor in Science and Technology section we saw that the metaphor of Black Hole and its Event
    Horizon can be represented as a visual using SVG radial-gradient capability as a means of producing
    instances of such visualization. Examples of SVG radial-gradients were shown. Since the SVG code which
     produces these radial-gradients is simply XML text in the SVG
    program the code is available to reading and analysis by other programs. By analyzing the values of the
    parameter settings used to set a radial-gradient statement it is possible to get a numerical sense of
    what the picture looks like to the eye. In the case of the continuous shade of gray radial-gradient
    discussed in the Metaphor in Science and Technology section a programmatic analysis of the SVG
    radial-gradient code (all three lines of it) would yield amongst other things a scalar value depicting
    the visual or picture distance across which the specified radial-gradient occurred. This is a simple
    numerical representation depicting the shade of grey varying with respect to (radial) distance. In the
    case of a conical representation of the gravity well the cone is a simple geometry to produce in SVG
    as a side view. Analysis of the SVG code which produces the cone illustration by the analysis program
    returns a number of SVG object parameters, representing the locations of the lines constituting the
    outer edge of the cone. The analysis program is able to analyze the findings of both illustrations
    and detect that one has a wall separation dependent on depth (i.e. the well) and the other has a gray
    level varying by distance from the center of the radial. The gray level and the wall separation both
    display a value according to distance (from a reference point). This is the Correspondence. A value
    represented by one can be systematically TRANSFERRED to the other. For example a given shade of grey
    in the radial model has the analog of a CORRESPONDING wall distance separation in the other (well)
    model.</para>
    <para>Another metaphor example may make the ideas clearer. This metaphor uses the spatial aspects of 
    the human body as the reference point or source of the metaphor. (Much has been written in various fields
    about The Body Percept.) This reference point is known as the tenor of a 
    metaphor. The other element which is participating in the metaphor is called the vehicle of the metaphor. The
    human body is an obvious subjective reference as it is the &ldquo;me&rdquo; who engineers/makes the 
    metaphor and &ldquo;my&rdquo; subjective body is the easiest and hence most obvious source of measure.
    My height, my arm&rsquo;s reach, my running speed, etc.</para>
    <para>The computer (program) is provided with a data set which constitutes its body. Since we are
    talking about using the human body image as a tenor (metaphor source) we provide a human body spatial
    representation. While an exact 3D model could be used, for the puposes of this illustration a simplified
    if not somewhat casual data set or spatial model is used. See Figure 25 for a rendering of the SVG data
    set used as the metaphor-tenor or source in this example.
    </para>
    
    <para>To us the rendered paths (lines) of the data set constitute a recognizable depiction of a male human,
    if not a charicature or cartoon thereof. It is not a photograph or hologram nor are they needed. A 
    texture-mapped
    X3D three-dimensional humanoid would be nice but is not necessary. At the same time that we recognize 
    instantly that the rendered SVG paths depict a man, the computer, not being able to &ldquo;see&rdquo;,
    &ldquo;perceives&rdquo;/detects a collection of SVG paths and nothing else. (Our &ldquo;seeing&rdquo;
    of the &ldquo;man&rdquo; is based on non-conscious inferencing which we call (pattern)
    &ldquo;recognition&rdquo;. If we were to look at what was actually falling on our retina it would be a 
    collection of &ldquo;lines&rdquo; and &ldquo;dots&rdquo;. It is the combination of our visual neurons and
    our visual cortex in our brain which piece together those visible elements into a &ldquo;man&rdquo;.
    &ldquo;Man&rdquo; is a mental phenomenon in our subjective mind, there is no &ldquo;man&rdquo; in the
     picture or on the screen or paper. There are only black-coloured marks.)
    </para>
    <para>The SVG path element defines a set of x,y co-ordinate pairs which describe a complex geometry.
     Simple geometries like circles, rectangles, etc have their own SVG elements such as circle, rect, etc.
     The SVG path collection which defines the Business Man Bob data set is a collection of named 
     sequences of x,y-pair co-ordinates. The frame or box that the Business Man Bob data set is seen in
     in the illustration has a standard SVG (graphics) origin of x,y = 0,0 being the upper left corner of
     the frame. (The system relies on that piece of knowledge in order to make sense of the terms found
     in the DAXSVG ontology, &ldquo;where&rdquo; up and down, left and right &ldquo;are&rdquo;.)</para>
    
    <para>The values shown for the SVG path element in the illustration above defines the actual set of x,y
     co-ordinate pairs which describe a particular geometry in the Business Man Bob data set. To our human 
     eye we easily recognize it as a foot (specifically, the foot of Business Man Bob). 
     </para>
    
   
    
    
    <para>In our human-body ontology above we see that frameRelLoc.slot(bottom:at,near), the relative 
    location in the
    visual frame (the box enclosing the drawing of Bob), has an instance slot value of &ldquo;bottom&rdquo;.
    Notice that &ldquo;bottom&rdquo; is a member of the DAXSVG ontology we saw listed earlier in the paper.
    The exact entry there was</para><para>
    <verbatim><![CDATA[  
    <rdf:Property ID="Bottom">
	<rdfs:comment>absolute marker, minimum y value in 2D reference system. SVG maxy
	</rdfs:comment>
        <rdfs:range rdf:resource="#SvgEntity" />
        <rdfs:domain rdf:resource="#SvgEntity" />
    </rdf:Property>
     ]]>
    </verbatim>Bottom, then, is a semantic term for the location in an SVG picture which corresponds to maxy.
    Maxy is a named constant which is set to the y-axis value which has the largest possible magnitude for that
    SVG frame. In the case of the data set Business Man Bob the largest y-axis value of the drawing is y=364.
    That is the y co-ordinate of the &ldquo;bottom of Bob&rsquo;s foot&rdquo; in the drawing. As shown elsewhere
    in this paper, the SVG viewBox, typically (0 0 canvasmaxx canvasmaxy), can be read by an xslt program and 
    the value, canvasmaxy in this case, of the largest extent in the y-axis direction placed into the working
    constant maxy. Since the drawing in our example case does not extend down to the very bottom of the frame
    (the SVG canvas) the program is able to scan all the SVG code, the SVG path groups in this example, and
    easily locate the path with the largest magnitude y-axis value. Here it is path g27, with a largest y-axis
    value of 364. The semantic term Bottom, in the DAXSVG ontology is then resolved to have the associated value
    of (y=) 364. That is the defined (semantic) Bottom of the picture under consideration.</para>
    <para>
    Further, the function f(x) defined earlier in the paper, which computes a curve like that of Far 
    (the Near-Far graph labelled Fig. 1.), can be applied, as f(y), applying that function to the y-axis
    values of the drawing to obtain &ldquo;shades of grey&rdquo; values for the y-axis values ranging from 0 through 364.
    In English what this means is that a y-axis value of 364 computes to be a value of 1.00 or &ldquo;white&rdquo;,
    and as 
    some given value for y is lower than 364 that y-value computes to a progressively darker shade of grey,
     until y=0
    which computes to a shade of grey equal to black. The f(y) function calculates a scalar value which is
    proportional to the nearness a given y-axis location or value is to the Bottom of the picture (which is
    y=364). Thus the function f(y) allows for the detection of things located NEAR the Bottom as well as things
    AT the Bottom. So something located at y=364 is AT the Bottom, and something located at y=347 is NEAR the
    Bottom. This allows the system to recognize things as being at the &ldquo;Bottom&rdquo;, notice the quote
    marks around Bottom in this case. People often use language this way, the Bottom with the quote marks around
    it is the figurative or colloquial Bottom. Instead of being exactly equal to one value only (i.e Bottom= y=364)
    the progam is able to perceive &ldquo;Bottom&rdquo;, being (a possible range of) location values sufficiently
    near the Bottom.
    </para>
    
  
      
  <para><highlight style="bold">&ldquo;The nature of the mapping function used to implement linguistic-variable
  quantification,
      pioneered by Zadeh and Goguen, is shown to be governed by context.&rdquo;</highlight>
      <bibref refloc="bib2" /> 
      The mechanism which implemented context
      was thoroughly explained in the paper 
      Natural Language Processing and Diagrams. Explicit computer
      programming was presented used to implement context, no verbal hand-waiving.</para>
      <para><highlight style="bold">&ldquo;Certain types of metaphorical usages in ordinary language are shown
      to be implementable
      via a spatial,
      or eidetic transfer mechanism.&rdquo;</highlight>
      <bibref refloc="bib2" />
      To further show the programmatic implementation of this mechanism
      the author presented equations and graphics of mechanism in
      <bibref refloc="bib3" />
      in an international journal on sets and mathematics. (Negoita <bibref refloc="bib9" /> shows how fuzzy set
      mathematics is used in expert system type scenarios.)
      In the WROX book
      <bibref refloc="bib4" />
      the author provided actual code listings to implement spatial 
      mechanism accompanied by a thorough explanation of how the code worked.</para>
      <para><highlight style="bold">&ldquo;...it is shown that such mechanisms can significantly expand the scope
      of construct
      representation of a computer system which is based upon a collection of spatial primitives which are
      used as 
      representation extending nucleii.&rdquo;</highlight> <bibref refloc="bib2" /></para>
      <para><highlight style="bold">&ldquo;occasionally look into some big ideas&rdquo;, &ldquo;see far into the future&rdquo;.</highlight>
       <bibref refloc="bib2" /></para>
  </section>  
     
    
  <section><title>Summary</title>
    <para>There will be an extended version of this paper available at the site http://www.open-meta.com. Implementing
    other kinds of metaphors is covered there and additions to the spatial correspondence metaphor covered here.
    The (concepts behind the) words that people use in everyday natural language have multiple 
    meanings as defined in the
    dictionary, as numbered nuances. People are able to exchange these words in conversations without
    explicitly stating a standardized nuance number as found in the dictionary. Yet people almost
    always understand the intended nuance tacitly. This is done by means of recognition and use of context. The 
    receiver infers the context building it up via recollection of previous utterances.</para>
    <para>In a similar way the computer may build or populate a context using features and their values obtained
    from its input environment. <bibref refloc="bib5" /> and this paper has shown how the context is recognized 
    or built. Context is
    represented by both ontology structures such as we have seen above, using XML structures such as Protege, 
    and also by graph structures, in this paper represented
    by XGMML. Context &ldquo;informs&rdquo; the metaphor recognition system such that the range of possible
    metaphor
    &ldquo;targets&rdquo; is constrained to one or a few at most. It is the context which detects/represents
    the &ldquo;nuance&rdquo;
    in the situation and references the correct &ldquo;meaning&rdquo;, the correct &ldquo;transfer&rdquo; 
    or &ldquo;corresponding&rdquo; of the
    metaphor. In this way
    a reference or base semantic object, such as the SVG animation in this paper may be used to allow the
    computer to &ldquo;understand&rdquo; the persistance of objects even though they are occluded from sight.
    Note that
    young babies clearly think that an occluded object becomes non-existant. Only when they are older do they
    realize that objects (continue to) exist when not in view. This is a big deal in abstract conceptualization,
    and it is a powerful addition to representation in computers that semantic object metaphors are programmatically
    constructable and recognizable. The upshot, practical use of this is a sentry robot which detects an
    intruder, who hides behind something, yet the robot &ldquo;realizes&rdquo; that the person did not dematerialize
    or
    become non-existant. The robot detects that the view of the intruder is obfuscated and tries a new location
    to continue with dealing with the intrusion. A sentry which did not have the ability to recognize
    &ldquo;persistance&rdquo;, as in (visually) occluded continuity via the metaphor capability, would simply
    roll away
    blithely forgetting about the intruder&rsquo;s existance!</para>
  </section>
  
  <section><title>The CYC footnote</title>
    <para>WHAT IS OPEN-CYC? This section is purposely placed after the summary as it was originally intended to
    be a footnote. It became too large to be a footnote and so was promoted to a section.
    &ldquo;OpenCyc is the open source version of the Cyc technology, the world&rsquo;s largest and most complete general
     knowledge base and commonsense reasoning engine.&rdquo;  Read the opencyc frequently asked questions at 
     http://www.opencyc.org/faq/opencyc_faq.</para> <para>
      An ontology is &ldquo;An explicit formal specification of how to represent the objects, concepts
      and other
     entities that are  assumed to exist in some area of interest and the relationships that hold among them.
      An ontology is the attempt to formulate an exhaustive and rigorous conceptual schema within a given domain,
       a typically hierarchical data structure containing all the relevant entities and their relationships and 
       rules (theorems, regulations) within that domain.&rdquo;</para>
      <para>&ldquo;Cyc enhances XML by providing a powerful universal semantics for modeling objects described 
      via XML. 
     [Cyc natural language processor performs] word-to-concept correspondences (e.g. the word &ldquo;eating&rdquo;
      means the same thing as the Cyc concept #$EatingEvent;
      the word &ldquo;yellow&rdquo; means the same as the Cyc concept #$YellowColor). This information is used 
      to transform
       parses [of English word strings] into CycL expressions.&rdquo; CycL is the language in which Cyc is
        programmed. Basic Cyc is modelled
       after the KIF representation. By parsing natural language strings into CycL Cyc is able to then 
       perform commonsense reasoning on it. The results of the reasoning can be translated from CycL into
        natural language (such as English) by means of the Cyc system CycL-to-string transformer. This is
        a program-capability built-into the Cyc system.</para>
        <para>Following are a few examples of the CYCSUMO ontology. The large size of this ontology
        may be appreciated by noticing that the examples represent much less than 1% of the total system.</para>
  		<para>
        	<verbatim><![CDATA[
         (#$comment #$ableToAffect "'(#$ableToAffect AGENT THING)' means that AGENT
         is capable of causing some change in THING.  This does not imply that AGENT
         ever actually does cause any change in THING, but that THING is within AGENT's
         'zone of influence'.  For instance, I am able to affect the ceiling panel 
         above my head, even though I've never done anything to it.  In contrast, I
         cannot affect the moon.  This is an inherently vague notion, since one's 
         ability to influence objects tends to diminish as they grow larger--or smaller--
         and farther away.  However, it's an important common sense concept, since we 
         must learn what we can and cannot affect in order to understand our capabilities
         and limitations and plan actions accordingly.") 
       
         (#$comment #$above-Directly "(#$above-Directly ABOVE BELOW) means either that
         (1) the volumetric center of ABOVE is directly above some point of BELOW, 
         if ABOVE is smaller than BELOW; or that (2) some point of ABOVE is directly
         above the volumetric center of BELOW, if ABOVE is larger than, or equal in
         size to, BELOW.") 

         (#$comment #$above-Generally "(#$above-Generally OBJ1 OBJ2) means that the
         #$SpatialThing-Localized OBJ1 is more or less above the #$SpatialThing-Localized 
         OBJ2. To be more precise: if OBJ1 is within a cone-shaped set of vectors within 
         about 45 degrees of #$Up-Directly pointing up from OBJ2 (see #$Up-Generally), then 
         (#$above-Generally OBJ1 OBJ2) holds. This is a more general predicate than 
         #$above-Directly (q.v.), but it is a more specialized predicate than 
         #$above-Higher (q.v.). It probably most closely conforms to the English word 
         \"above.\"") 
  
         (#$comment #$above-Higher "(#$above-Higher OBJ-A OBJ-B) means that
         OBJ-A is at a greater altitude (from some common reference point) than OBJ-B.
         In terrestrial contexts (see #$TerrestrialFrameOfReferenceMt), 
         (#$above-Higher OBJ-A OBJ-B) typically means that OBJ-A is at a greater 
         altitude above sea level (see the predicate #$altitudeAboveSeaLevel) than OBJ-B.") 
    
         (#$comment #$above-Overhead "(#$above-Overhead ABOVE BELOW) means that ABOVE
         is directly above BELOW (see the predicate #$above-Directly), all points of ABOVE 
         are higher than all points of BELOW, and ABOVE and BELOW do _not_ touch.") 
         (#$genlPreds #$above-Overhead #$above-Directly) 


         (#$comment #$above-Touching "(#$above-Touching ABOVE BELOW) means that ABOVE is
         located over BELOW and they are touching.  More precisely, it implies both 
         (#$above-Directly ABOVE BELOW) and that ABOVE #$touches BELOW.  Examples: a
         person sitting on a chair; coffee in a cup; a boat on water; a hat on a head.
         (Note that not every point of ABOVE must be higher than every point of BELOW.)") 

  			]]></verbatim>
		</para>
		<para>Note that in the above CYC predicate, (#$ableToAffect AGENT THING), the ability of AGENT to affect
		THING is modulated or constrained by relative size and separating distance of AGENT and THING.
		The system, in order to maintain this constraint, has some tests or conditionals which are automatically 
		invoked when that predicate is used in a reasoning cycle. The test would look something like :
		(cond(AND(NOT(large(difference(vol(AGENT),vol(THING))))),(NOT(large(separation(AGENT,THING))))). In English
		that conditional tests that both the difference in the relative sizes of AGENT and THING is not large
		and also that the distance separating the locations of AGENT and THING is not large. The relative sizes of
		AGENT and THING must be neither too large nor too small. That conditional performs a calculation which 
		provides
		(a test for the presence or absence of) a common-sense context or situation whereby an agent might
		 reasonably
		provide a sphere of influence upon the receiving THING. In other words the AGENT can reasonably affect
		 something
		which is near enough to it and which is neither too small nor too large to be (reasonably) manipulated 
		or affected.
		</para><para>Notice that the predicate IsNear(x), from the previously mentioned DAXSVG RDF Schema can be
		 used to
		compute &ldquo;separation(AGENT,THING)&rdquo;. While the example shown above of case 6 of relation, 
		IsNear(x1,x2) is &ldquo;crisp&rdquo;, 
		that is the returned response from it is boolean or two valued, the calculation of IsNear in the DAXSVG 
		RDF Schema
		is calculated via g1(x), which computes a scalar value which represents the fuzzy grade of membership
		 value for 
		that context. (x is the scalar value &ldquo;separation(AGENT,THING)&rdquo;). Large calculates a
		 scalar value which 		comes from a 
		comparison of the input value, the &ldquo;difference&rdquo; in this case, with the value of the extent
		 of the x-axis		 of the SVG
		canvas, which defines the &ldquo;visual world&rdquo; used here. If the canvas is 700 units in extent in the x-axis,
		 say, then 
		large() calculates a value which compares the value of &ldquo;separation(AGENT,THING)&rdquo; with 700. This measure
		 of largeness
		then is &ldquo;situated in&rdquo; the perceived world (space). It is a representation of a relative or situated 
		(concept of) &ldquo;large&rdquo;.</para>
  </section>
</body>
<rear>
  <acknowl>
    <para>The author would like to thank John Searle for an interesting and validating personal discussion
    in Berkeley about the importance and use of situated context in actions taken by intelligent systems.
    The author would also like to thank George Lakoff for producing stimulating and informative work
    on the nature of scientific and technical metaphor; to thank Edward deBono for being insightful and 
    creative and publishing the innovative work showing functional depiction and usage of spatial metaphors
    (along with some &ldquo;naive physics&rdquo;) made visible or non-tacit <bibref refloc="bib6" />, and Lotfi Zadeh for introducing fuzzy
    mathematical representation and reasoning to the world over a period of a few decades <bibref refloc="bib11" />. Berkeley certainly
    has some insightful people.</para>
  </acknowl>
<bibliog>
  <bibitem id="bib2">1
    <bib>Dodds 1981</bib>
    <pub>
    Dodds, David.
    <highlight style="ital">Fuzzy Logic Computer Implementation of Metaphor from Ordinary 
    Language</highlight>
    . 1981. AAAS Annual Meeting (American Association for the Advancement of Science) 
    [publishers of the journal Science]</pub>
  </bibitem>
  <bibitem id="bib3">2
    <bib>Dodds 1988</bib>
    <pub>
    Dodds, David.
    <highlight style="ital">Fuzziness in Knowledge-Based Robotics Systems</highlight>
    . 1988. Fuzzy Sets and Systems 26: North-Holland  179-193</pub>
  </bibitem>
  <bibitem id="bib3">
    <bib>Dodds 1989</bib>
    <pub>
    Dodds, David.
    <highlight style="ital">Fuzziness in Knowledge-Based Robotics Systems</highlight>
    . 1989. Mobile Robots IV: Volume 1195 SPIE - The International Society for Optical 
    Engineering  56-65</pub>
  </bibitem>
  <bibitem id="bib4">
    <bib>Dodds 2001</bib>
    <pub>
    Dodds, David. et al
    <highlight style="ital">WROX Professional XML Meta Data</highlight>
    . 2001. Wrox Press Inc;  ASIN: 1861004516  600 pages</pub>
  </bibitem>
  <bibitem id="bib5">
    <bib>Dodds 2004a</bib>
    <pub>
    Dodds, David.
    <highlight style="ital">Natural Language Processing and Diagrams</highlight>
    The 2004 International Conference on Machine Learning; Models, Technologies and 
    Applications.</pub>
  </bibitem>
  <bibitem id="bib6">
    <bib>Dodds 2004b</bib>
    <pub>
    Dodds, David.
    <highlight style="ital">Extending Representation Capability: Representation Extention
     Through the Corresponding Metaphor Process</highlight>
    The Extreme 2004 conference.</pub>
  </bibitem>
  <bibitem id="bib7">
    <bib>Dodds 2005</bib>
    <pub>
    Dodds, David.
    <highlight style="ital">Components of Meta-Programming, Computer Analogies and Metaphors</highlight>
    The 2005 International Conference on Programming Languages and Compilers.</pub>
  </bibitem>
  <bibitem id="bib1">6
    <bib>Bateson 1979</bib>
    <pub>
    Bateson, Gregory.
    <highlight style="ital">Mind and Nature</highlight>
    . 1979. Dutton: NY 0-525-15590-2</pub>
  </bibitem>
  <bibitem id="bib6">7
    <bib>deBono 1981</bib>
    <pub>
    deBono, Edward
    <highlight style="ital">Atlas of Management Thinking</highlight>
    . 1981. Maurice Temple Smith Ltd 0-140224610  pp200 </pub>
  </bibitem>
  
  
  <bibitem id="bib8">9
    <bib>Lakoff 1980</bib>
    <pub>
    Lakoff, George.
    <highlight style="ital">Metaphors We Live By</highlight> 
    . 1980. University of Chicago Press: 0-226-46801-1 pp242</pub>
  </bibitem>
  <bibitem id="bib9">10
    <bib>Negoita 1985</bib>
    <pub>
    Negoita, C V.
    <highlight style="ital">Expert Systems and Fuzzy Systems</highlight>
    . 1985. The Benjamin Cummings Publishing Company: Menlo Park. 0-8053-6840-X pp190</pub>
  </bibitem>
  <bibitem id="bib10">11
    <bib>Ricoeur 1978</bib>
    <pub>
    Ricoeur, Paul.
    <highlight style="ital">The Rule of Metaphor</highlight>
    . 1978. U of T Press:  0-8020-6447-7 pp384</pub>
  </bibitem>
  <bibitem id="bib11">12
    <bib>Zadeh 1975</bib>
    <pub>
    Lotfi, Zadeh.
    <highlight style="ital">Fuzzy Sets and Their Applications to Cognitive and Decision 
    Processes</highlight>
    . 1975. Academic Press: 0-12-775260-9 pp496</pub>
  </bibitem>
  <bibitem id="bib12">13
    <bib>Schmucker 1984</bib>
    <pub>
    Schmucker, Kurt.
    <highlight style="ital">Fuzzy Sets, Natural Language Computations, and Risk Ananlysis</highlight>
    . 1984. Computer Science Press: 0-914894-83-8 pp185</pub>
  </bibitem>
  <bibitem id="bib14">14
    <bib>Winston 1975</bib>
    <pub>
    Winston, Patrick.
    <highlight style="ital">The Psychology of Computer Vision</highlight>
    . 1975. McGraw-Hill: 0-07-071048-1 pp282</pub>
  </bibitem>
</bibliog>
</rear>
</paper>


