RefGuide Ontology Examples

 

Document Ontology

Here is an example of a Document Ontology Object.

	
		<html><head></head><body>
		
		
		<?xml version="1.0" encoding="UTF-8"?>
		<Document>
			<KnowledgeBase>
			    <Title>Vector Machines</Title>
				<Topic>Lisp</Topic>
				<SubTopic>Machine Learning</SubTopic>
				<HumanKeywords>Vector Machine Learning Programming</HumanKeywords>
			</KnowledgeBase>          
			<Essay>Essay_Vector_Machines</Essay>
			<Essay>Essay_Vector_Machine_Functions</Essay>
		 
		</Document>
		 
		</body></html>
		
		

Essay Ontology

Here is an example of an Essay Ontology Object.

	
<html><head></head><body>


<?xml version="1.0" encoding="UTF-8"?>
<Essay>
	<KnowledgeBase>
	    <Title>Vector Machines</Title>
		<Topic>Lisp</Topic>
		<SubTopic>Machine Learning</SubTopic>
		<HumanKeywords>Vector Machine Learning Programming</HumanKeywords>
	</KnowledgeBase>
	<Section>
	    <Heading>Overview</Heading>
		<Description>		
		    <div class="h2section" id="Overview">
		    <p>There are numerous modern machine learning algorithms and techniques which rely primarily 
		     on number vectors. The most famous vector learning method is Gaussian least squares linear regression. 
		     Until modern times, Gaussian linear regression was the only rigorous vector-based modeling technique. 
		     More recently, non-linear regression techniques have surfaced based upon the Gram matrix. The most 
		     famous of these modern techniques is Support Vector Regression.</p> 		     
		  </div>
	    </Description>
	<Section>       
 
 
</Essay>
 
</body></html>
 

Datatype Ontology

Here is an example of a Datatype Ontology Object.

	
<html><head></head><body>

<?xml version="1.0" encoding="UTF-8"?>
<Datatype>
	<KnowledgeBase>
        <Title>Error</Title>
		<Type>Object</Type>
		<RelatedTypes>Void Boolean Character Integer Number Money Percent String 
		             Text Character</RelatedTypes>
		<HumanKeywords>Native Error  </HumanKeywords>
	</KnowledgeBase>
 
	<Section>                
	    <Heading>Error Overview</Heading>
		<Description>
		 <p class=MsoBodyText>Analytic Information Server has a heap or object data type named Error to distinguish errors 
		 from other data types.  The Error is a container which may hold  text and is case-sensitive, may include 
		 blanks but not special characters, may be up to 32767 characters in length, and <b>must</b>  begin and end 
		 with an exclamation mark <b>(!)</b>.</p>   
		  <p class=MsoBodyText>The Error type does not behave like the other Analytic Information Server types. If an 
		  Error value is reference, the function referencing the Error value immediately terminates and calls the 
		  <b>onError</b> function which displays the Error value. Therefore, the <b>setq</b> function will not work, 
		  (nor will the <b>ref</b> function).  It is not possible to compare Error  values nor is it possible to 
		  add methods to the Error type.</p>
        </Description>
    <Section>                
    
    
	<Section>                
	    <Heading>When to Use</Heading>
		<Description>
          <p>The Error native data type is ideal for returning text describing an error condition.  
          Having  the Error data type eliminates the need to overload other data types to handle error conditions. </p>          
        </Description>
    <Section>  
    
    <Section>
	    <Heading>Constant Form</Heading>
		<Description>
          <p>An Error constant may hold  text and is case-sensitive, may include blanks but not special 
          characters, may be up to 12 characters in length, and <b>must</b> begin and end with an exclamation mark <b<(!)</b<.   
          Some examples:     
          <p><b>!bad argument!  </b></p> 
          <p><b>!illegal syntax! </b></p>  
          <p><b>!out of memory!</b></p>    
        </Description>
    <Section>
    
    </Datatype>
 
</body></html>         
    

Function Ontology

Here is an example of a Function Ontology Object.

	
<html><head></head><body> 
 
<?xml version="1.0" encoding="UTF-8"?> 
<Function> 
	<KnowledgeBase> 
        <Title>inside</Title> 
		<FunctionName>inside</FunctionName> 
		<FunctionType>Builtin</FunctionType> 
        <DataType>   Dictionary  Vector BitVector ShortVector IntVector NumVector  </DataType> 
 	    <ArgumentTypes-Dictionary>Structure Dictionary Directory Integer Boolean Symbol</ArgumentTypes-Dictionary>      
        <ArgumentTypes>Character String Symbol Vector BitVector ByteVector IntVector ShortVector
                       FltVector ObjVector Structure Dictionary Directory Boolean
                       Matrix NumMatrix Integer Float Number Complex </ArgumentTypes>        
	    <RelatedFunctions>member isMember member isInside isIdentical</RelatedFunctions> 
        <RelatedVMInstructions> vmregObjPointer </RelatedVMInstructions> 
		<HumanKeywords>inside key value index</HumanKeywords> 
	</KnowledgeBase> 
          
         <Brief-Dictionary> 
             <p> The <b>inside</b>  function takes a key as an argument and a  Dictionary as 
                a second argument and returns either the index where the key was found or the 
                Boolean value false if the key is not found.   </p>
          </Brief-Dictionary>
          
          <Brief> 
             <p> The <b>inside</b> function searches the Vector argument for the match of the 
                 search object argument  and returns  the index  where the object was found. 
                 If the  was not found, false is returned.  </p>
          </Brief>
         
         
	<Description>     
          
	   <Overview-Dictionary>
		<p>The <b>inside</b> function takes a key as an argument and a Dictionary as a second 
           argument and returns the index where the key was found.  If the key was not found, 
           the inside function returns false. The <b>inside</b> function uses the <b>isIdentical</b> 
           predicate.</p>
        </Overview-Dictionary>
	   
        <Overview>
		<p>The <b>inside</b> function searches the Vector argument <b>{vector}</b>  for the match 
           of the search object argument <b>{obj}</b> and returns  the index  where <b>{obj}</b> 
           was found. If the <b>{obj}</b> was not found, false is returned. The <b>inside</b> 
           function uses the <b>isIdentical</b> predicate.</p>
        </Overview>

       
      
        <Usage-Dictionary>
        <p>The <b>inside</b> function if you want to locate the position of a certain key 
           in a  Dictionary.  If you just want to know if a member is in the Directory but do not 
           care where it is located if it is found, use the <b>isInside</b> function, which returns a 
           Boolean true or false.
		</p>
        </Usage-Dictionary>
        
        <Usage>
        <p>The <b>inside</b> Function is used to find an object <b>{obj}</b> in a Vector 
           <b>{vector}</b>. Since the <b>inside</b> function returns the location of the  
           <b>{obj}</b>, the <b>inside</b> function makes it convenient to perform some operation 
           on the <b>{obj}</b> .  An alternate function, the <b>isInside</b> function, is used 
           when a Boolean value of either true or false is sufficient.
		</p>
        </Usage>

       
    </Description> 
	 

	<Syntax-Dictionary>
	    <Expression><p> (inside  key   dictionary)</p></Expression>
		<Argument> 
		  <Name>key</Name>
		  <Note>
		  <p> The key (member) you wish to locate. </p>
          </Note>
		  <AISTypes>String or Text </AISTypes>
		</Argument>
	    <Argument> 
		  <Name>dictionary</Name>
		  <Note>
		  <p> The Dictionary to be searched. </p>
          </Note>
		  <AISTypes>Dictionary </AISTypes>
		</Argument>
        
		<Return> 
	    <p>Returns the index of the member if it is found, otherwise it returns false
        </p>
	    </Return>   
	</Syntax-Dictionary>

	 
	<Syntax>
	    <Expression><p> (inside obj vector)</p></Expression>
		<Argument> 
		  <Name>obj</Name>
		  <Note>
		  <p> The search object. </p>
          </Note>
		  <AISTypes>Character String Symbol Vector BitVector ByteVector IntVector
                       FltVector ObjVector Structure Dictionary Directory
                       Matrix NumMatrix Integer Float Number Complex</AISTypes>
		</Argument>
	    <Argument> 
		  <Name>vector</Name>
		  <Note>
		  <p>The Vector to be searched.</p>
          </Note>
		  <AISTypes>Vector BitVector ShortVector IntVector NumVector </AISTypes>
		</Argument>        
		<Return> 
	    <p>Returns false if the object is not present. If the object is present, returns an integer representing the 
           index into the vector where the object was found.
        </p>
	    </Return>   
	</Syntax>

 
</Function> 
 
</body></html>
  
 

Note: This Function Ontology shows the inside function working only on the Dictionary and Vector Data types. Although not shown in this ontology example, the inside function also works on the BitVector, Directory, FltVector, IntVector, List, Matrix, NumMatrix, NumVector, ObjVector, Pair, PcodeVector, Brick and Structure datatypes.

Example Ontology

Here is an example of an Example Ontology Object.

	
<html><head></head><body> 

<?xml version="1.0" encoding="UTF-8"?> 
<Example> 
	<KnowledgeBase>   
		<Title>Example Lambda isLambda 001</Title>   
		<Template>Example</Template>  
		<FunctionKeywords>isLambda</FunctionKeywords> 
		<TypeKeywords>Lambda Symbol</TypeKeywords>	 
		<RelatedFunctions>  </RelatedFunctions> 
		<Language>Lisp</Language> 
		<HumanKeywords>Type Analytic Object Boolean</HumanKeywords> 
	</KnowledgeBase>  
	 
	<Description> <p>This example defines both an Integer and an Lambda and uses the
                   <b>isLambda</b> function to check the data type.</p>
     </Description>
	<Syntax>  
  	    <Expression> <b>(define x  26)  </b></Expression>   
        <Note>An Integer x is defined.</Note>  
        <Returns>26 </Returns> 
  	    <Expression><b>(define (foo sym)  (getGlobalValue  sym))  </b></Expression>   
        <Note>none</Note>  
        <Returns>#<Lambda 123456> </Returns> 
  	    <Expression><b>(isLambda foo)     </b></Expression>  
        <Note>none</Note> 
        <Returns>true </Returns>
  	    <Expression><b>(isLambda x)     </b></Expression>  
        <Note>none</Note> 
        <Returns>false </Returns>
 
        <Hints> none</Hints> 
   </Syntax> 
 
</Example> 
</body></html>

VMInstruction Ontology

Here is an example of a VMInstruction Ontology Object.

	
<html><head></head><body>


<?xml version="1.0" encoding="UTF-8"?>
<VMInstruction>
	<KnowledgeBase>
	    <Title>vmargcount</Title>
		<InstructionName>vmargcount</InstructionName>
		<InstructionType>Generic</InstructionType>
		<ArgumentTypes> Integer Word </ArgumentTypes>
		<RelatedVMInstructions> vmapply vmargfetch vmcall vmsend</RelatedVMInstructions>
		<HumanKeywords> count arguments fetch call send apply  </HumanKeywords>
	</KnowledgeBase>
	<Description>
		<p> When evaluated, this vm instruction places the number 
		of arguments received by the current Lambda into the 
		<b>target</b> word, as an Integer type. 
		There are no conversions made between different types. 
		The result will be returned as an Integer data type. 
		This instruction will never return an Error value. 
		After the operation, the Instruction Pointer is promoted. 
		The operation of this vm instruction is expressed in the following C expression:
        </p>
        <ul><li><b>(word:int)target = 
       ((char*)Tv - (char*)Av)/sizeof(word); </b></li></ul>
    </Description>
	<Syntax>
	    <Expression> (vmargcount target)</Expression>
		 <Argument> 
		  <Name>target</Name>
		  <Format>regoff</Format>
		  <AISTypes>(word:integer)</AISTypes>
		</Argument>
	</Syntax>
</VMInstruction>
 
</body></html>