Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active November 27, 2017 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/7f27a443315d60457a5e8ec17e46699d to your computer and use it in GitHub Desktop.
Save kenwebb/7f27a443315d60457a5e8ec17e46699d to your computer and use it in GitHub Desktop.
olog - Arginine
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Mon Nov 27 2017 12:22:21 GMT-0500 (EST)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: olog - Arginine
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 7f27a443315d60457a5e8ec17e46699d
Keywords:
My Notes
--------
November 27, 2017
In this workbook, I implement olog(1) in reference[1] (page 2), "a simple olog about an amino acid called arginine"
For this model, it's cumbersome using class inheritance to represent "is" and composite structure to represent "has".
Instead, the olog objects (types of things) should all be regular IXholon nodes, and the olog arrows should be regular Xholon JavaScript ports.
Ideally, I would specify the model using text such as the following:
<Xholon_String>
D an amino acide found in dairy
A arginine
E an electrically charged side chain
X an amino acid
R a side chain
N an amino group
C a carboxylic acid
A is D
A has E
A is X
D is X
X has N
X has R
X has C
E is R
</Xholon_String>
References
----------
(1) Spivak and Kent (2012) "Ologs: A Categorical Framework for Knowledge Representation"
]]></Notes>
<_-.XholonClass>
<PhysicalSystem/>
<AminoAcid>
<Arginine/>
</AminoAcid>
<!-- A -> X "arginine is an amino acid" -->
<X>
<A/>
</X>
<!-- E -> R "an electrically charged side chain is a side chain" -->
<R>
<E/>
</R>
</_-.XholonClass>
<xholonClassDetails>
<!--<Block>
<port name="height" connector="Height"/>
</Block>-->
</xholonClassDetails>
<PhysicalSystem>
<A roleName="arginine">
<E roleName="an electrically charged side chain"/>
</A>
</PhysicalSystem>
<Blockbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var a = 123;
var b = 456;
var c = a * b;
if (console) {
console.log(c);
}
]]></Blockbehavior>
<Heightbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var myHeight, testing;
var beh = {
postConfigure: function() {
testing = Math.floor(Math.random() * 10);
myHeight = this.cnode.parent();
},
act: function() {
myHeight.println(this.toString());
},
toString: function() {
return "testing:" + testing;
}
}
]]></Heightbehavior>
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
$wnd.xh.Brickbehavior = function Brickbehavior() {}
$wnd.xh.Brickbehavior.prototype.postConfigure = function() {
this.brick = this.cnode.parent();
this.iam = " red brick";
};
$wnd.xh.Brickbehavior.prototype.act = function() {
this.brick.println("I am a" + this.iam);
};
]]></Brickbehavior>
<Brickbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
console.log("I'm another brick behavior");
]]></Brickbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Block</title>
<rect id="PhysicalSystem/Block" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Height</title>
<rect id="PhysicalSystem/Block/Height" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
</g>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment