next up previous contents
Next: The TieWeavable Interface and Up: The Weavable Interface and Previous: Straw Modifiers

Straw Accessors

The Straw class provides numerous functions to traverse the HDM graph space. forwardLinksOf() and backLinksOf() return all edges propograting from the current Straw in the forward and backward directions respectively. Similarly getForwardLinks(label) and getBackLinks(label) return the links with a given label (i.e. of a specific type). For example, in Figure gif, invoking forwardLinksOf() on the topmost bale.HaystackDocument, the set: {tie.Body, tie.Text, tie.Author, tie.Title, tie.Location, tie.Filetype} is returned, or more specifically, the set of pointers to these objects is returned.

The functions getAllForwardObjects() and getAllBackObjects() skip the intermediate Tie objects between the current Straw and what is attached to it and returns all the ``destination objects.'' getAllBackFilteredObjects(label) and getAllForwardFilteredObjects(label), filter the getAll...Objects() function and return only objects with the given label. getLastForwardObject(label) and getLastBackObject(label) filter the edge names and return most recent (i.e. the last) edge with the given label. The function depthFirstSearch() returns a list of objects traversed in a depth first search originating at the current Straw up to a given depth. In Figure gif, getAllBackObjects() invoked on the needle.filetype.Postscript node will return the set: {bale.HaystackDocument,needle.Text}.

Straws also provide methods to access the ID of the object, get the ``supertypes'' of the Straw, and to get the ``type'' of the current Straw: getID(), getSupertypes(), and getTypeString() respectively.

Finally, Straws provide functions to generate a string representation of the object (toString()), as well as a method of generating a text representation (toText()) that we will index in the Information Retrieval System. So for a needle.mailfield.Tofield containing ``eytan@mit.edu,'' toText() will simply return ``eytan@mit.edu.'' On bale.HaystackDocument objects we don't necessarily have text of their own we can call getIndexable() which will get the text of objects in the ``collection'' (i.e. the document cluster).



Copyright 1998, Eytan Adar (eytan@alum.mit.edu)