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
! boilerpipe 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 kewin.zip
mKE for Linux kelin.zip
mKE for Mac kemac.zip
mKR/mKE tutorial

Installation Instructions

For Windows, install Windows Subsystem for Linux or the Cygwin Linux environment.
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[phone] := 707-255-3093;
    Dick McCullough[email] := rhmccullough@gmail.com;
which may also be expressed as
    Dick McCullough
        has phone = 707-255-3093,
        has email = rhmccullough@gmail.com;
Relations are sentence groups of the form
    relation[key] := [value1,value2,...];
For example:
    phonebook[Dick McCullough] := [Dick McCullough,707-255-2093,707-260-6200,rhm@pioneerca.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
        relType = [person, phone, fax, email],
        relName = [1, 2, 3, 4],
        relKey = "$1",
        relMeaning = { $1 has phone = $2, has fax = $3, has email = $4; };

    begin relation phonebook;
    rel Dick McCullough, 707-255-3093, 707-260-6200, rhm@pioneerca.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 2,           person;
    ho 3,               u:Richard H. McCullough;
    ho 2,           list;
    ho 2,           set;
    ho 2,           mset;
    ho 2,           xset;
    ho 2,           cset;
    ho 2,           array;
    ho 2,           hierarchy;
    ho 2,           relation;
    ho 1,       property;
    ho 2,           part;
    ho 2,           attribute;
    ho 3,               space;
    ho 3,               time;
    ho 3,               view;
    ho 2,           action;
    ho 3,               method;
    ho 1,       value;

    ho 1,       sentence;
    ho 2,           context;
    ho 2,           statement;
    ho 3,               definition;
    ho 2,           question;
    ho 2,           command;
    ho 2,           assignment;
    ho 2,           conditional;
    ho 2,           iteration;
    ho 2,           relation group;
    ho 2,           hierarchy group;
    ho 2,           method group;
    end hierarchy mkr.ho;
Values 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 KornShell:
    simple English semantics of subject, verb, object, modifying phrases;
    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

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
od is a new preposition which precedes the direct object of an English verb

when necessary to avoid ambiguity:
         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

The verbs of mKR include:

is	(identity)	
def	(definition)
syn	(synonym)
isa	(hierarchy)
do	(action)
has	(attribute)
part	(part)
aa	(associative array)
ho	(hierarchy)
rel	(relation)

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
     execution 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

mKR grammar
mKR keywords
mKE options
mKE commands
mKE variables
Screenshots, Applications, Tools
Unicon programming language
KornShell programming language
Redland RDF Libraries

Last update Nov/14/2018