my Knowledge Explorer

my Knowledge Explorer

Context Knowledge Systems is also a research and development company specializing in the representation and use of context. All products are developed in an open-source environment and are made available to the public AS-IS and FREE.
After the mKR (my Knowledge Representation) language was designed, mKR was implemented in the mKE (my Knowledge Explorer) program. mKE reads statements, commands and questions and stores the resulting knowledge in mKB (my Knowledge Base). mKE can translate other languages (e.g. RDF, OWL, CycL, Turtle, SPARQL) to mKR and interact with knowledge bases of other languages.

Some Practical mKE Applications

Search Address Book
do read from address book.csv;
do find od steve in address book;

Create Expense Report
do read from expense.rel;
do read from summary.mkr; # create report

Create Family Tree
do read from aka.rel, birth.rel, marriage.rel, child.rel;
do ged; # create standard GEDCOM file;
person := John Doe;
$person isa* ?; # display all ancestors of John Doe
$person isc* ?; # display all descendants of John Doe

Process Text in Web Page
cks := http://ContextKnowledgeSystems.org/CKS.html;
! toc od $cks to cks.toc; # extract table of contents
! html2text od $cks to cks.txt; # extract text
! wordbag od $cks to cks.words; # count words
! email od cks.toc, cks.txt, cks.words to drbobmcc@comcast.net; # email all results

Search OpenCyc Knowledge Base
guid := do find od Torvalds with value in cyclabel;
! firefox od http://sw.opencyc.org/concept/$guid;

Products

mKE for Windows Subsystem for Linux kewsl.zip
mKE for Windows Cygwin kecyg.zip
mKE for Windows Msys kemsys.zip
mKE for Linux kelin.zip
mKE for Mac kemac.zip
mKR/mKE tutorial

Installation Instructions

For Windows, first:
install Windows Subsystem for Linux or the Cygwin Linux environment.
For all systems:
Install Unicon.
Create new directories $HOME/KE and $HOME/db.
Unzip download file in $HOME/KE directory.
Add the following statements to your .profile:
export DBDIR="$HOME/db"
export KEHOME="$HOME/KE"
export PATH="$KEHOME/bin:$PATH"

For comments and/or support, email   rhmccullough@gmail.com

Overview of mKB

A knowledge base is a collection of views. Each view is a list of sentences. Knowledge is stored in mKB using associative arrays, relations and hierarchies.
The most basic sentence is an assignment of the form
entity[property] := value;
For example:
Dick McCullough[has phone] := 707-255-3093;
Dick McCullough[has email] := rhmccullough@gmail.com;
Dick McCullough[rel brother] := Bob McCullough;
which may also be expressed as
Dick McCullough has phone := 707-255-3093;
  has email := rhmccullough@gmail.com;
  rel brother := Bob McCullough;

N-ary relations are sentence groups of the form
relation[key] := [value1,value2,...];
For example:
phonebook[Dick McCullough] := [Dick McCullough,707-255-2093,707-260-6200,rhmccullough@gmail.com];

Complete relations may be expressed as rows of comma-separated-values, which can be edited using programs like Excel or Scalc.
For example:
phonebook def relation with
  colName := [person, phone, fax, email],
  colValue := [1, 2, 3, 4],
  relKey := "$1",
  relAction := { $1 has phone := $2; has fax := $3; has email := $4; };

begin relation phonebook;
rel Dick McCullough, 707-255-3093, 707-260-6200, rhmccullough@gmail.com;
rel John Doe, 209-123-4567, 209-123-4568, johnd@pioneerca.com;
rel Jane Doe, 209-123-4567, 209-123-4568, janed@pioneerca.com;
end relation phonebook;

Hierarchies use the "isa" relation
For example:
  cat, dog isa animal;
  animal, person isa entity;

Complete hierarchies may be expressed in a table-of-contents format,
for example:

begin hierarchy mkr.ho;
ho 0, universe;
ho 1,   entity;
ho 2,    program;
ho 3,     u:mKE;
ho 3,     u:sh;
ho 2,    person;
ho 3,     u:Richard H. McCullough;
ho 2,    data structure;
ho 3,     list;
ho 3,     set;
ho 3,     file;
ho 3,     table;
ho 3,     hierarchy;
ho 2,    variable;
ho 1,   property;
ho 2,    attribute; # has
ho 3,     space;
ho 3,     time;
ho 3,     view;
ho 2,    action; # do
ho 3,     method;
ho 2,    binary relation; # rel
ho 1,   relation;
ho 2,    context;
ho 2,    statement;
ho 3,     definition; # def
ho 2,    command;
ho 2,    assignment;
ho 2,    conditional;
ho 2,    iteration;
ho 2,    relation group;
ho 2,    hierarchy group;
ho 2,    question; # ?variable
end hierarchy mkr.ho;

Variables can be used in other sentences
For example:
  pi := 3.14159265;
  do print od $pi;

Overview of mKR

mKR is a useful mixture of English and Unicon and KornShell:
simple English semantics of subject, verb, object, modifying phrases;
Unicon variables, procedures, control structures;
KornShell variables, functions, control structures.

Every sentence has a context of definitions and assumptions:
  in context { sentence; ... };
context is a named sentence list with space,time,view attributes
  space = s, time = t, view = v
  s may use any convenient units, e.g.: home,office
  t may use any convenient units, e.g.: past,present,future
  v is the name of the concept hierarchy of the context


Sentence types in mKR include:

The verbs of mKR include:

The prepositions of mKR include:

mKR style

syntax: English phrases separated by keywords and special characters,
  terminated by semicolon
comment is anything preceded by sharp sign,
  continuing to end of line

phrase may take any of these forms:
  name
  name[index]
  name := value
  name preposition phrase
  comma-separated-phrase list

when necessary to avoid ambiguity:
  phrases are enclosed in " "
  phrase lists are enclosed in [ ]
  phrase sets are enclosed in set( )
  sentence lists are enclosed in { }

names are defined by the context -- explicit or implicit

Overview of mKE

mKE may execute offline on local computer, or online on host computer

mKE reads statements, commands and questions from standard input file
mKE writes command and question output to standard output file
mKE writes error output to standard error file
mKE writes debug output to log file
mKE stores new knowledge in mKB knowledge base

Features include:
  xecution of shell commands
  translate mode for other languages
  syntax check mode to debug input scripts
  error check mode to find ambiguities and contradictions
  read/write knowledge from/to file
  load/save knowledge from/to database

More details


Copyright 1996-2019 Richard H. McCullough
Last update May/11/2019