Knowledge Base Function Reference

 

This document describes the functions supported by the Knowledge Base Server. These functions are to be called from an application that has the netseval library (currently written for C, SLISP, and Java).


Index


Accessor Functions

(KB-GET-ATTRIBUTE <term> <attrib-name>)

Returns a single named attribute for the specified term. No synonym resolution is done at this time. The result is a string enclosed in a list.
Example:

  (KB-GET-ATTRIBUTE "brain" "Glossary")  ==>  ("The brain is...")
  

(KB-GET-ATTRIBUTES <term>)

Returns all the attributes for the given term in a single text string, appended together.

(KB-FIND-TERM <str>)

Returns a flat list containing all the terms which matched the specification, which may contain SQL wildcards. The comparison is case-insensitive.

(KB-GET-TERM-INFO <term>)

Returns the 'Role' and 'Authority' for the given term. The first of these is usually "Preferred Name" or "Synonym", the latter indicates who is the authority on that term.

The term name given is used in a case-insensitive comparison.

(KB-GET-HIERARCHIES)

Returns a flat list indicating the names of the hierarchies present in the knowledge base.

(KB-GET-MASTER-TERM <term>)

Returns the "Preferred Name" of this term. Case is ignored on the input string, wildcards are not allowed on the input string.

(KB-GET-SYNONYMS <term>)

Returns a flat list of al terms synonymous with the term named term. The term itself will be in the list.

(KB-GET-PARENTS <term> <link>)

Returns a flat list of the names of the parents (in preferred form) of the term named term, in the hierarchy named link.

(KB-GET-CHILDREN <term> <link>)

Returns a flat list containing the names of all the terms that are children of the term named term in the hierarchy named link.

(KB-GET-ANCESTORS <term> <link> [max-depth])

Returns a flat list of all terms inthe hierarchy link that are found in any path from the root level terms, leading the term named term. The max-depth parameter is an optional integer that default to the value 10, and controls how many level of the hierarchy should be searched. A value of zero turns off this limit.

(KB-GET-DESCENDANTS <term> <link> [max-depth])

Returns a flat list of all the terms that are found in the subtree below the term named term in the hierarchy named link. The max-depth paramater is an optional integer that default to the value 10, and controls how many levels of the hierarchy should be searched. A value of zero turns off this limit.

(KB-GET-SIBLINGS <term> <link>)

Returns a flat list of the names of all the terms that are children of term's immediate parents. The specified term will be present in the list, once for for each parent it has.

(KB-SYNONYMP <term>)

Used to decide if a term is a non-preferred synonym of some other term. The result comes in the form of an integer which is either 0 (the term is not a synonym) or 1 (it is a synonym)

(KB-CONTAINSP) <term> <link>)

Returns a count of the number of times the term named term occurs in the hierarchy name link. 0 indicates the term is not present there at all.

(KB-DESCENDANTP <term> <ancestor> <link> [max-depth])

Returns T if the term named term is in the descendant subtree of the the term named ancestor, in the hierarchy named link. The max-depth parameter is an optional integer that contols how many levels of the hierarchy to search. It's default value it 10, and the value 0 turns off this limit.


Modifier Functions

Most of these are either not fully implemented, or not implemented at all.

(KB-NEW-TERM <term> <source> <moddate>)

Creates a new term with given name, set it's Authority to source and marks the modification date as moddate. It's Role defaults to 'Preferred Name'. This will probably crash something if you try to do it on a term that already exists.

(KB-SET-TERM-NAME <oldname> <newname>)

Changes the name of an existing term from oldname to newname, and sets the modification date to moddate.

(KB-SET-UMLS-ID <term> <umlsid> <moddate>)

Changes the UMLS ID of an existing term to umlsid and sets the modification date to moddate.

(KB-SET-SNOMED-ID <term> <snomedid> <moddate>)

Changes the SNOMED ID of an existing term to snomedid and sets the modification date to moddate.

(KB-SET-AUTHORITY <term> <source> <moddate>)

Changes the Authority of an existing term to source and sets the modification date to moddate.

(KB-SET-AUTHOR <term> <author> <moddate>)

Changes the Author of an existing term to author and sets the modification date to moddate.

(KB-SET-STYPE <term> <stype> <moddate>)

Changes the NLM-S-TYPE flag of an existing term to the integer stype and sets the modification date to moddate.

(KB-DELETE-TERM <term>)

Deletes the corresponding term from the database. If the term is a 'Preferred Name', all of it's synonyms are deleted, and all of the links it has to other terms are deleted too.

(KB-ADD-SYNONYM <term> <syn> <source> <moddate>)

Creates a new term named syn, that is a 'Synonym' of the term named term. The Authority is set to source and the modification date to moddate. There must already exists a term named term in the knowledge base, and it must be a 'Preferred Name'.

(KB-MAKE-SYNONYM <term> <master>)

Makes the term named term a 'Synonym' of the term named master. Both terms must already exists in the database, and the master must already be a 'Preferred Name'. If term is a 'Preferred Name', it's synonyms are removed, and all links to it are removed.

(KB-MAKE-PREFERRED <term>)

Makes a the term name term a 'Preferred Name'. This term must already exist. If is is already a 'Preferred Name', nothing happends. If it is a 'Synonym', it trades places with it's master term.

(KB-MAKE-UNIQUE <term>)

Make a new 'Preferred Name' out of the given term. The term must already exists. If it is a 'Synonym', it becomes it's own new concept. If it is already a 'Preferred Name', nothing happens.

(KB-ADD-LINK <parent> <child> <link>)

Adds a parent-to-child link between the terms named parent and child in the hierarchy named link. All three must already exist in the knowledge base.

(KB-REMOVE-LINK <parent> <child> <link>)

Removes the parent-to-child link(s) between the terms named parent and child in the hierarchy named link. All three must exist in the knowledge base.

(KB-CREATE-HIERARCHY <link>)

Creates a new hierarchy with the name link.

(KB-DELETE-HIERARCHY <link>)

Removes all links that are of this hierarchy, and then removes the hierarchy itself. It also removes any terms that are left "orphaned" by the removal of this hierarchy.


Last Updated: 24 Mar 1997
Scott W. Bradley