Hello,
Indeed, the method getclassall_subs returns all subclasses of a given class. Unfortunately, there is no explicit PythonCyc function to get the direct subclasses and no parent or children attribute exists. Depending on the specific problem you are trying to solve, perhaps there is no need to use a general method to get the subclasses. Also, if you are running in a secure and closed environment you can run the PythonCyc server such that any Lisp expression is accepted and bypassed this limitation by starting Pathway Tools with the option -python-local-only-non-strict. The Lisp fn get-class-direct-subs returns the direct subclasses. For example, evaluating
(get-class-direct-subs '|Reactions|)
returns the list
(#<"Unclassified-Reactions" class frame in METABASE[F] @ #x10035ddebf2>
#<"Reactions-Classified-By-Substrate" class frame in METABASE[F] @ #x10035ddebc2>
#<"Reactions-Classified-By-Conversion-Type" class frame in METABASE[F] @ #x10035ddeb92>)
You could return the names only by applying the get-frame-name fn as in
(mapcar '#get-frame-name (get-class-direct-subs '|Reactions|))
Such Lisp expression would need to be sent using the PythonCyc method sendQueryToPTools defined in module PTools. For the documentation and source of that fn, please see:
http://pythoncyc.readthedocs.io/en/la...
Let us know if that answers your question.
-- Mario Latendresse