#
# KEHOME/kb/ke.def
# Richard H. McCullough Sep/23/2005 Jan/26/2007 May/9/2009 Sep/18/2014 Mar/8/2015

#at view = mke;

# context
#========#
attribute isg
	ctype,gtype,utype,ptype,
	ktype,
	formattype,formatverb,meaningtype,
	subject,verb,object;

#===========#
# ke action #
#===========#
COMMAND is action with subject = ke,predefined;
method  is action with subject = ke,user defined;

cd	is COMMAND with purpose = "change directory",
	format = {do cd od directory:1 done;};
check	is COMMAND with purpose = "check for error",
	format = {do check od item:1,... done;};
clock	is COMMAND with purpose = "print date,time,message",
	format = {do clock od message:1 done;};
clist	is COMMAND with purpose = "list concepts in subhierarchy",
	format = {do clist od concept:1 done;};
csize	is COMMAND with purpose = "count concepts in subhierarchy",
	format = {do csize od concept:1 done;};
dbclose	is COMMAND with purpose = "close GDBM database files",
	format = {do dbclose od dbname:1 done;};
dbopen	is COMMAND with purpose = "open GDBM database files",
	format = {do dbopen od dbname:1 done;};
dbprint	is COMMAND with purpose = "print contents of GDBM database files",
	format = {do dbprint od dbname:1 done;};
delete	is COMMAND with purpose = "delete unit from concept",
	format = {do delete od concept:1,... from concept:2 done;};
dir	is COMMAND with purpose = "list files in directory (DOS)",
	format = {do dir od directory:1 done;};
	# also {! dir done;}
dump	is COMMAND with purpose = "print concept record",
	format = {do dump od concept:1,... done;};
dump/ged is COMMAND with purpose = "print standard GED genealogy file",
	format = {do dump/ged to file:1 done;};
dump/hidden is COMMAND with purpose = "print hidden concept record",
	format = {do dump/hidden od concept:1 done;};
entropy	is COMMAND with purpose = "count words in file and calculate entropy",
	format = {do entropy od file:1,... done;};
#"exit"	is statement with purpose = "finish processing and exit ke",
#	format = {exit;};
explorer is COMMAND with purpose = "edit file system",
	format = {do explorer od fsdirectory:1 done;};
factsize is COMMAND with purpose = "display number of facts",
	format = {do factsize od concept:1,... done;};
find	is COMMAND with purpose = "find concepts matching wildcard pattern in subhierarchy",
	format = {do find od pattern:1 fron concept:2 done;};
find topic is COMMAND with purpose = "find dmoz directory Topics containing phrase",
	format = {do find topic od phrase:1 done;};
find title is COMMAND with purpose = "find dmoz directory Topics with Title",
	format = {do find title od Title:1 done;};
find term is COMMAND with purpose = "find dmoz directory Topics with term",
	format = {do find term od term:1 done;};
factlist is COMMAND with purpose = "list facts",
	format = {do factlist od concept:1,... done;};
fsize	is COMMAND with purpose = "count bytes in file",
	format = {do fsize od file:1,... done;};
fstatus is COMMAND with purpose = "display type and rwx permissions of file",
	format = {do fstatus od file:1,... done;};
ftype   is COMMAND with purpose = "display type of file",
	format = {do ftype od file:1,... done;};
getenv	is COMMAND with purpose = "get value of environment variable",
	format = {do getenv od variable:1 done;};
glb	is COMMAND with purpose = "display greatest lower bound of concepts",
	format = {do glb od concept:1,... done;};
gpath	is COMMAND with purpose = "display genus path to top of hierarchy",
	format = {do gpath od concept:1 done;};
help	is COMMAND with purpose = "display help topic",
	format = {do help od topic:1,... done;};
hdepth	is COMMAND with purpose = "display distance to bottom of hierarchy",
	format = {do hdepth od concept:1,... done;};
'hdo'	is COMMAND with purpose = "execute action on path in hierarchy",
	format = {hdo action:1 with path:2 from concept:3 done;};
hlevel	is COMMAND with purpose = "display distance to top of hierarchy",
	format = {do hlevel od concept:1,... done;};
hwalk	is COMMAND with purpose = "execute action on path in hierarchy",
	format = {do hwalk od concept:1, action:2, path:3 done;};
import ontology is COMMAND with purpose = "import ontology context",
	format = {do import ontology od qualifier:1 from url:2 done;};
interpret_line is COMMAND with purpose = "process knit",
	format = {do interpret_line od {proposition list:1;} done;};
kdepth	is COMMAND with
	purpose = "display distance from concept to bottom of view",
	format = {do kdepth od concept:1,... done;};
klevel	is COMMAND with
	purpose = "display distance from concept to top of view",
	format = {do klevel od concept:1,... done;};
klist	is COMMAND with purpose = "display list of all concepts in knit",
	format = {do klist done;};
ksize	is COMMAND with purpose = "display number of concepts in knit",
	format = {do ksize done;};
ls	is COMMAND with purpose = "list files in directory (UNIX)",
	format = {do ls done;};
	# also format = {do ls with option:1,... od file:2,... done;};
	# also {! ls done;}
lub	is COMMAND with purpose = "display least upper bound of concepts",
	format = {do lub od concept:1,... done;};
max	is COMMAND with purpose = "calculate maximum of numeric list",
	format = {do max od number:1,... done;};
menu	is COMMAND with purpose = "generate correct sentence syntax for user",
	format = {do menu done;};
merge	is COMMAND with purpose = "merge unit|species into concept",
	format = {do merge od concept:1,... to concept:2 done;};
min	is COMMAND with purpose = "calculate minimum of numeric list",
	format = {do min od number:1,... done;};
mkdir	is COMMAND with purpose = "create new directory",
	format = {do mkdir od fsdirectory:1 done;};
nvsub	is COMMAND with purpose = "substitute using pattern-replacement table",
	label = [subject,pattern-replacement table],
	format = {do nvsub od string:2 with table:1 done;};
plist	is COMMAND with purpose = "list primitive concepts in hierarchy",
	format = {do plist od concept:1,... done;};
print	is COMMAND with purpose = "display concept",
	format = {do print od concept:1,... done;};
psize	is COMMAND with purpose = "count primitive concepts in hierarchy",
	format = {do psize od concept:1,... done;};
pwd	is COMMAND with purpose = "display current directory name (UNIX)",
	format = {do pwd done;};
	# also {! pwd done;}
random	is COMMAND with purpose = "choose random element of list",
	format = {do random od concept:1,... done;};
	# also format = {do random od concept:1 done;}
read	is COMMAND with purpose = "read knowledge from file",
	format = {do read from file:1,... done;};
read directory is COMMAND with purpose = "read filesystem directory hierarchy",
	format = {do read hierarchy from fsdirectory:1 to concept:2 done;};
read dmoz is COMMAND with purpose = "read dmoz directory RDF file",
	format = {do read dmoz from file:1,... done;};
read input is COMMAND with purpose = "read line from standard input",
	format = {do read input done;};
read tap is COMMAND with purpose = "read TAP KB file",
	format = {do read tap from file:1,... done;};
	# also {do read tap from file:1,... with tapformat = mcf done;}
	# also {do read tap from file:1,... with tapformat = daml done;}
replace	is COMMAND with purpose = "substitute replacement string for pattern",
	label = [subject,pattern,replacement],
	format = {do replace od string:1 from string:2 to string:3 done;};
rmdir	is COMMAND with purpose = "remove empty directory",
	format = {do rmdir od directory:1,... done;};
	# also {! rmdir od directory:1,... done;}
simplify lattice is COMMAND with purpose = "simplify context lattice",
	format = {do simplify lattice od concept:1 done;};
slist	is COMMAND with purpose = "list species concepts in subhierarchy",
	format = {do plist od concept:1,... done;};
ssize	is COMMAND with purpose = "count species concepts in subhierarchy",
	format = {do psize od concept:1,... done;};
sum	is COMMAND with purpose = "calculate sum of numeric list",
	format = {do sum od number:1,... done;};
	# also format = {do sum od ingroup:1 done:};  # Set,list,...
unique	is COMMAND with purpose = "create unique name",
	format = {do unique od name:1 done;};  # name_nnn
ulist	is COMMAND with purpose = "list units in subhierarchy",
	format = {do ulist od concept:1 done;};
upath	is COMMAND with purpose = "display unit path to bottom of subhierarchy",
	format = {do upath od concept:1 done;};
usize	is COMMAND with purpose = "count units in subhierarchy",
	format = {do usize od concept:1 done;};
vdump	is COMMAND with purpose = "dump view to persistent database",
	format = {do vdump od view:1 to dbdirectory:2 done;};
vload	is COMMAND with purpose = "load view from persistent database",
	format = {do vload od view:1 from dbdirectory:2 done;};
vpop	is COMMAND with purpose = "pop current view name off view stack",
	format = {view:1 :=  do vpop done;};
vpush	is COMMAND with purpose = "push current view name on view stack",
	format = {do vpush done;};
write	is COMMAND with purpose = "write knowledge to file",
	format = {do write od concept:1,... to file:2 done;};
write directory is COMMAND with purpose = "write filesystem directory hierarchy",
	format = {do write directory od concept:1 to fsdirectory:2 done;};


#==============#
# ke attribute #
#==============#
variable  is attribute	with subject = ke;
pattern   is variable	with wildcard;
pronoun   is variable	with antecedent subject;
automatic is attribute	with subject = [relation,method,group],
			     purpose = "change automatic declarations";

Assignment is variable with purpose = "record output of last assignment";
Command    is variable with purpose = "record output of last command";
If         is variable with purpose = "record output of last conditional";
Question   is variable with purpose = "record output of last question";
Sentence   is variable with purpose = "record output of last sentence";
Product    is variable with purpose = "record value  of last product";

DisplayName is variable with purpose = "change concept output   name";
UniqueName  is variable with purpose = "change concept internal name";

CheckComment is variable with purpose = "uncomment check output";
TypeComment  is variable with purpose = "uncomment type output";

charformat	is variable with purpose = "change characteristic output format";
cname		is variable with purpose = "change concept name for input file";
debug		is variable with purpose = "change debug output";
echo		is variable with purpose = "change echo of ke input";
hchar		is variable with purpose = "change characteristic processing";
hcheck		is variable with purpose = "change error check processing";
hformat		is variable with purpose = "change hierarchy output format";
hmaxlevel	is variable with purpose = "change hierarchy maximum level up/down";
hmethod		is variable with purpose = "change method processing";
hminfactid	is variable with purpose = "change hierarchy output minimum fact id";
hop		is variable with purpose = "change hierarchy verb processing";
hoseparator	is variable with purpose = "change hierarchy separator",
				default = "/";
hreduce		is variable with purpose = "change reduce processing";
hrelation	is variable with purpose = "change relation processing";
hpad		is variable with purpose = "change hierarchy output name pad";
htab		is variable with purpose = "change hierarchy output indent";
kbmode		is variable with purpose = "change knowledg base type";
kbdata		is variable with purpose = "change knowledge base web data directory";
kbfile		is variable with purpose = "change knowledge base local file";
kcase		is variable with purpose = "change lower case input option";
kehome		is variable with purpose = "change location of ke files";
keview		is variable with purpose = "change location of ke file systems";
kerror		is variable with purpose = "count input file errors";
kformat		is variable with purpose = "change input format";
klastid		is variable with purpose = "record last new id number (readonly)";
kmapword	is variable with purpose = "change mapping of rdf words";
nameformat	is variable with purpose = "change output format of concept name";
mseparator	is variable with purpose = "change method separator",
				default = ",",readonly;
nvseparator	is variable with purpose = "change name value separator",
				default = " = ";
pseparator	is variable with purpose = "change phrase separator",
				default = " ",readonly;
relseparator	is variable with purpose = "change relation separator",
				default = ";";
removehtml	is variable with purpose = "change remove HTML commands option";
roleseparator	is variable with purpose = "change role separator",
				default = ":";


#===========#
# statement #
#===========#
#context		is attribute	with meaning = {at space = space:1,time = time:2,view = view:3;};
#s_action	is statement	with meaning = {entity:1 do action:2  =  event:3 od aobject:4 done;};
#s_attribute	is statement	with meaning = {concept:1 has attribute:2  =  value:3;};
#s_causality	is statement	with meaning = {sentence:1 ido cause od sentence:2 done; event:1 ido cause od event:2 done;};
#s_class		is s_hierarchy	with meaning = {concept:1 isa* existent:2;};
#s_conditional	is statement	with meaning = "if sentence:1 then sentence:2 else sentence:3 fi";
#s_definition	is statement	with meaning = {concept:1 is genus:2 with differentia:3;};
s_differentiation is s_action	with meaning = {concept:1 isd genus:2;};
#s_event		is statement	with meaning = {event:1 ido cause od {eobject:2 do change from attribute:3 = initial:4 to attribute:3 = final:5 done;} done;};
#s_group		is statement	with meaning = {unit:1 ismem group:2; group:3 isany unit:4;};
#s_hierarchy	is statement	with meaning = {concept:1 isa genus:2; concept:1 isc species:3;};
#s_identification is s_action	with meaning = {knowledge:1 : =  man:2 do identify:3 od existent:4 done;};
#s_identity	is statement	with meaning = {alias:1 is concept:2;};
#s_integration	is s_action	with meaning = {concept:1 isi unit:2;};
#s_iteration	is statement	with meaning = "every sentence:1 {proposition list:2;}";
#s_kaction	is statement	with meaning = {entity:1 do kaction:2  =  event:3 od aobject:4 done;};
#s_part		is statement	with meaning = "existent:1 haspart existent:2 pplist:3";
#s_relation	is statement	with meaning = {existent:1 isin relation:2  =  infon:3;};
#s_meaning	is statement	with meaning = {symbol:1 means referent:2;};


#===========================#
#  miscellaneous "unknowns" #
#===========================#
differentia is group of characteristic;


#