8.3 Getting started with your own application
The most fundamental element in API calls is MEOop. This
stands for an object, graph etc., and is the only way of referring to these in
the API. There would be no way of returning whole objects or graphs, since these
would be of a different class for each object type. Also there would be no way
of knowing where to break the chain of objects: asking for a single graph could
return the entire contents of the repository. For these reasons MEOop is used
instead: answers are returned to you as MEOops, and you make your next query
using some of those MEOops.
There are two ways to create MEOops: one is to build them
from numeric values for their areaID and objectID, obtained for example by
parsing the output of the oid command of the MERL generator language. The other,
easier, way is to use API methods that return an MEOop (return type MEOop or
MEOopArray, also often MEAny contains an MEOop).
When you are using the API, the first thing is generally
to find a graph. This is often done on the basis of type.
 | If
you just want all graphs of a given type, use
allGoodInstances(myType), where myType
is an METype with 'name' equal to the graph type’s name.
|
 | If
you want all graphs regardless of type, you can use
allSimilarInstances (graphMetaType),
where graphMetaType is an METype with name "Graph".
|
 | If
you want to search for a specific graph by name, use
instancesNamed (graphMetaType, instanceName,
typeName), again with graphMetaType being an METype with name
"Graph". |
In response to these, you will receive an
MEOopArray containing several graphs of the type you specified. You can find the
one you want by using the
userPrintString command, which returns
the name of the graph. Once you have a graph you want, you can find its contents
using the 'Graph contents read' messages, e.g.
objectSet. Note the handy
findString(graphOop, objectName), which
returns all elements in the graph matching the wildcard string,
objectName.