Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site

NAME

fms / Foundational Model Server - Interface to retrieve and store terms and their symbolic relationships


SYNOPSIS

fms invokes the server; (fms-help) will list the commands; (fms-quit) exits


DESCRIPTION

The Foundationsl Model Server is designed to act as a middle layer between the persistent store and FM clients. These term clients can be other information servers or end user interaction tools. All clients must speak to the server using the FMS API.


FMS API

Note that if a parameter is not an integer, t, or nil, it must be enclosed in quotes.

(fms-existsp lttermgt)

Returns t if the term exists, nil otherwise.

(fms-containsp lttermgt lthierarchygt)

Returns a count of the number of times the term occurs in the specified hierarchy. Returns 0 if the term is not present at all.

(fms-synonymp lttermgt)

Returns t if the term is a Synonym. nil if the term is the Preferred Form.

(fms-get-attribute lttermgt ltattribute-namegt)

Returns a single named attribute for the specified term. Note that the best way to get the attributes for a term is with kb-get-attributes since that will also give you the correct case.

(fms-get-attributes lttermgt)

Returns a list of all the attributes for the given term

(fms-find-term ltterm-specgt [regex-p] [limit])

Returns a list containing all the terms which match the term-spec.

Matches can either be:

Wildcard

thora*nerve matches anything with containing ``thora'' followed by ``nerve'' (with regex-p == nil/false/0) (default)

Regex

thora|abdom matches anything containing ``thora'' or ``abdom'' (with regex-p == t/true/1)

If limit is specified, then it must be one of:

preferred name
synonym

If it is specified but invalid, an error value will be returned.

(fms-get-hierarchies [term])

Returns a list indicating the names of the hierarchies present in the knowledge base. If a term is supplied, only hierarchies for that term are returned. If a term is supplied that doesn't exist in any hierarchy, an error is returned.

(fms-get-parents lttermgt lthierarchygt)

Returns a list of the names of the parents (in Preferred Form) of the specified term in the specified hierarchy

(fms-get-children lttermgt lthierarchygt)

Returns a list contain all the immediate children (in Preferred Form) of the specified term in the specified hierarchy.

(fms-num-hierarchies [term]

Returns the number of hierarchies present in the knowledge base. If a term is supplied, only hierarchies for that term are counted.

(fms-num-parents lttermgt lthierarchygt)

Returns the number of parents the specified term has in the specified hierarchy.

(fms-num-children lttermgt lthierarchygt)

Returns the number of children the specified term has in the specified hierarchy.

(fms-num-siblings lttermgt lthierarchygt)

Returns as a list the number of immediate children of each of the immediate parents. The specified term will be counted in each set.

(fms-has-hierarchy lttermgt lthierarchygt)

Returns hierarchy if term is contained in it; nil otherwise.

(fms-has-link ltparentgt ltchildgt lthierarchygt)

Returns the parent term if parent has child as a child; nil otherwise.

(fms-has-sibling lttermgt ltsibgt lthierarchygt)

Returns the term if term and sib share a parent; nil otherwise.

(fms-get-term-info lttermgt)

Returns the ``Role'' and ``Authority'' attributes for the given term. The first of these is usually 'Preferred Name' or 'Synonym', and the latter indicates where the term originated and/or authorship.

(fms-get-master-term lttermgt)

Returns the Preferred Form of the term.

(fms-get-synonyms lttermgt)

Returns a list of all the Synonyms of the term. This will work whether you pass in the Preferred Form or one of its Synonyms. The term itself will be present in the list.

(fms-get-ancestors lttermgt lthierarchygt [max-height])

Returns a nested list of all the terms in the hierarchy to be found on any path leading to the given term. This is a recursive kb-get-parents.

max-height is optional and defaults to 10. Specify a height of 0 to retrieve all ancestors. A branch is stopped when it can't go any further or a term is duplicated in the branch.

Note that currently this only shows the first parent of each term. This is to speed development. It will be fixed later.

(fms-get-descendants lttermgt lthierarchygt [max-depth])

Returns a nested list of all the terms in the hierarchy to be found below the given term. This is a recursive kb-get-children.

max-depth is optional and defaults to 10. Specify a depth of 0 to retrieve all descendants. A branch is stopped when it can't go any further or a term is duplicated in the branch.

(fms-get-leaf-nodes lttermgt lthierarchygt)

Returns a flat list of only the leaves of all the descendents of that term in that hierarchy.

Editing APIs

These commands may be restricted based on your login or host of origin.

(fms-new-term lttermgt ltmoddategt)

Creates a new term with the specified moddate. Sets it's role to be 'Preferred Name'. If the new term exists already, it signals an error, otherwise, it returns the UWDA ID of the new term.

(fms-update-term lttermgt ltnewnamegt ltmoddategt)

Updates the specified term to have the newname. If the term doesn't exist, it returns nil; otherwise the new term.

(fms-set-attribute lttermgt ltattributegt ltvaluegt)

Sets the attribute to be value. If the attribute didn't or term doesn't exist, it returns nil; otherwise the term.

(fms-delete-concept lttermgt)

Deletes the corresponding concept from the database. The term must be the Preferred Name of the concept. All of the concepts Synonyms are deleted as well as all the links and attributes for this term. If the term doesn't exist it returns nil; otherwise it returns the term deleted.

Note that if you just want to remove an item from displaying in a hierarchy but want to keep the term around, you don't want to use this function. Use remove_link instead.

(fms-add-synonym lttermgt ltsyngt ltmoddategt)

Creates a new term named syn that is a Synonym of the specified term. If the Preferred Name term doesn't exist, it returns nil; otherwise the Synonym.

(fms-make-preferred lttermgt ltmoddategt)

Makes the given term a Preferred Name. The old Preferred Name becomes a Synonym of the new Preferred Name. If the term doesn't exist, the Preferred Name retains its role and nil is returned. Otherwise the term is returned.

(fms-rename-synonym ltold-namegt ltnew-namegt ltmoddategt)

Rename the synonym 'old-name' to 'new-name'. Returns the new synonym name. Returns nil if 'old-name' isn't a synonym or if 'new-name' already exists.

(fms-delete-synonym ltsynonymgt)

Deletes the synonym. Returns the synonym or nil if the synonym doesn't exist.

(fms-add-link ltparentgt ltchildgt lthierarchygt)

Adds a link between the two terms in the specified hierarchy. If either of the terms or the hierarchy don't exist, returns nil; otherwise returns the parent.

(fms-remove-link ltparentgt ltchildgt lthierarchygt)

Removes the link between the two terms in the specified hierarchy. If either of the terms or the hierarchy doesn't exist, returns nil; otherwise returns the parent.

(fms-insert-child ltparentgt lthierarchygt ltsiblinggt lttermgt)

Makes term be inserted after sibling. To make the term appear at the top of the children, use ``'' for sibling. Returns nil unless both the sibling and the term are children of parent. Otherwise term is returned.

(fms-commit)

Immediately write all changes to persistent storage and don't returnuntil this is complete. The entire knowledge base is kept in memory and writes occur in idle cycles while waiting for commands. This ensures that all data is in persistent storage.

Note that currently to maintain high consistency during debugging stages, the server attaches and detaches to the SQL server for every transaction and so this function does nothing.

(fms-set-author ltauthorgt ltpasswordgt)

Set the current author who is making changes to the knowledge base.

(fms-lpr lttermgt lthiergt [to-string])

Print all the descendents of term in hier.

If to-string is specified and non-nil, then the tree will be returned to the caller as a string rather than printed on the printer.

SEE ALSO

Server(3pm), DBI_if(3pm)