org.LexGrid.LexBIG.Impl
Class CodedNodeGraphImpl

java.lang.Object
  extended by org.LexGrid.LexBIG.Impl.CodedNodeGraphImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CodedNodeGraph

public class CodedNodeGraphImpl
extends java.lang.Object
implements CodedNodeGraph, java.lang.Cloneable

This class implements the CodedNodeGraph interface.

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust, Thomas Johnson, Konrad Rokicki, Jesse Erdmann
See Also:
Serialized Form

Field Summary
protected  java.lang.String internalCodingSchemeName
           
protected  java.lang.String internalVersion
           
protected  java.util.ArrayList<Operation> pendingOperations_
           
protected  java.lang.String[] relationContainerNames_
           
 
Constructor Summary
CodedNodeGraphImpl()
          This constructor is only here for Apache Axis to work correctly.
CodedNodeGraphImpl(java.lang.String codingScheme, java.lang.String version, java.lang.String relationsName)
           
 
Method Summary
 java.lang.Boolean areCodesRelated(NameAndValue association, ConceptReference sourceCode, ConceptReference targetCode, boolean directOnly)
          Determine whether there is an directed edge (or transitive closure of an edge) from the source code to the target code in this graph.
 CodedNodeGraphImpl clone()
           
protected  GHolder getHolder(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveAssociationDepth, int maxToReturn, boolean keepLastAssociationLevelUnresolved)
           
protected  LgLoggerIF getLogger()
           
 CodedNodeGraph intersect(CodedNodeGraph graph)
          Return the set of nodes and associations that are present in both graphs.
 java.lang.Boolean isCodeInGraph(ConceptReference code)
          Determine whether the supplied code is in the graph.
 java.util.List<java.lang.String> listCodeRelationships(ConceptReference sourceCode, ConceptReference targetCode, boolean directOnly)
          Return a list of all of the associations in the graph that have the supplied source and target codes or, if directOnly is false, all associations whose transitive closure has the supplied associations.
 java.util.List<java.lang.String> listCodeRelationships(ConceptReference sourceCode, ConceptReference targetCode, int distance)
          Return a list of all of the associations in the graph that have the supplied source and target codes based on distance between them.
protected  void optimizePendingOpsOrder()
           
 ResolvedConceptReferenceList resolveAsList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveCodedEntryDepth, int resolveAssociationDepth, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, SortOptionList sortOptions, int maxToReturn)
          Resolve all of the coded nodes in the list, sorting by the supplied property (if any), resolving the supplied properties, resolving coded entries to the supplied depth and resolving associations to the supplied depth.
 ResolvedConceptReferenceList resolveAsList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveCodedEntryDepth, int resolveAssociationDepth, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, SortOptionList sortOptions, LocalNameList filterOptions, int maxToReturn)
          Resolve all of the coded nodes in the list, sorting by the supplied property (if any), resolving the supplied properties, resolving coded entries to the supplied depth, resolving associations to the supplied depth, and allowing for additional filters to be applied against the returned items.
 ResolvedConceptReferenceList resolveAsList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveCodedEntryDepth, int resolveAssociationDepth, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, SortOptionList sortOptions, LocalNameList filterOptions, int maxToReturn, boolean keepLastAssociationLevelUnresolved)
          Resolve all of the coded nodes in the list, sorting by the supplied property (if any), resolving the supplied properties, resolving coded entries to the supplied depth, resolving associations to the supplied depth, and allowing for additional filters to be applied against the returned items.
 CodedNodeGraph restrictToAnonymous(java.lang.Boolean restrictToAnonymous)
          Return a graph that contains only the codes that are either Anonymous, Non-Anonymous, or Not Specified in the supplied list, and all edges that still have a source and target code remaining.
 CodedNodeGraph restrictToAssociations(NameAndValueList associations, NameAndValueList associationQualifiers)
          Restrict the graph to the nodes that participate as a source or target of the named association and, if supplied, the named association qualifiers.
 CodedNodeGraph restrictToCodes(CodedNodeSet codes)
          Return a graph that contains only the codes that are present in the supplied list, and all edges that still have a source and target code remaining.
 CodedNodeGraph restrictToCodeSystem(java.lang.String codeSystem)
          Restrict the graph to codes (source and target) that originate from the supplied code system.
 CodedNodeGraph restrictToDirectionalNames(NameAndValueList directionalNames, NameAndValueList associationQualifiers)
          Restrict the graph to the nodes that participate as a source or target of an association whose directional name matches the one provided and, if supplied, the named association qualifiers.
 CodedNodeGraph restrictToEntityTypes(LocalNameList localNameList)
          Return a graph that contains only the codes that contain an Entity Type in the supplied list, and all edges that still have a source and target code remaining.
 CodedNodeGraph restrictToSourceCodes(CodedNodeSet sourceCodes)
          Restrict the graph to associations that have one of the codes in the supplied list as source codes.
 CodedNodeGraph restrictToSourceCodeSystem(java.lang.String sourceCodeSystem)
          Restrict the graph to edges that have codes from the specified code system as a source.
 CodedNodeGraph restrictToTargetCodes(CodedNodeSet targetCodes)
          Restrict the graph to associations that have one of the codes in the supplied list as target codes.
 CodedNodeGraph restrictToTargetCodeSystem(java.lang.String targetCodeSystem)
          Restrict the graph to edges that have codes from the specified code system as a target.
 CodedNodeSet toNodeList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveAssociationDepth, int maxToReturn)
          Transform the graph into a simple of list of code references, removing all association information.
 CodedNodeGraph union(CodedNodeGraph graph)
          Return the union of the two graphs.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

internalCodingSchemeName

protected java.lang.String internalCodingSchemeName

internalVersion

protected java.lang.String internalVersion

relationContainerNames_

protected java.lang.String[] relationContainerNames_

pendingOperations_

protected java.util.ArrayList<Operation> pendingOperations_
Constructor Detail

CodedNodeGraphImpl

public CodedNodeGraphImpl()
This constructor is only here for Apache Axis to work correctly. It should not be used by anyone.


CodedNodeGraphImpl

public CodedNodeGraphImpl(java.lang.String codingScheme,
                          java.lang.String version,
                          java.lang.String relationsName)
                   throws LBParameterException,
                          LBInvocationException,
                          LBResourceUnavailableException
Throws:
LBParameterException
LBInvocationException
LBResourceUnavailableException
Method Detail

getLogger

protected LgLoggerIF getLogger()

union

public CodedNodeGraph union(CodedNodeGraph graph)
                     throws LBInvocationException
Description copied from interface: CodedNodeGraph
Return the union of the two graphs. Union, in this context, means that the resulting graph contains the unique set of coded entries (String independent) that are present in one or both of the graphs, and the unique combination of edges (associations) present in one or both of the graphs.

Specified by:
union in interface CodedNodeGraph
Parameters:
graph - Identifies the CodedNodeGraph to merge with.
Returns:
A new CodedNodeGraph representing the merged result.
Throws:
LBInvocationException

intersect

public CodedNodeGraph intersect(CodedNodeGraph graph)
                         throws LBInvocationException
Description copied from interface: CodedNodeGraph
Return the set of nodes and associations that are present in both graphs.

Specified by:
intersect in interface CodedNodeGraph
Parameters:
graph - Identifies the CodedNodeGraph to be intersected with.
Returns:
A new CodedNodeGraph representing the intersection result.
Throws:
LBInvocationException

restrictToCodes

public CodedNodeGraph restrictToCodes(CodedNodeSet codes)
                               throws LBInvocationException,
                                      LBParameterException
Description copied from interface: CodedNodeGraph
Return a graph that contains only the codes that are present in the supplied list, and all edges that still have a source and target code remaining.

Specified by:
restrictToCodes in interface CodedNodeGraph
Parameters:
codes - Codes to filter on.
Returns:
A new CodedNodeGraph representing the filtered result.
Throws:
LBInvocationException
LBParameterException

restrictToAssociations

public CodedNodeGraph restrictToAssociations(NameAndValueList associations,
                                             NameAndValueList associationQualifiers)
                                      throws LBInvocationException
Description copied from interface: CodedNodeGraph
Restrict the graph to the nodes that participate as a source or target of the named association and, if supplied, the named association qualifiers.

Specified by:
restrictToAssociations in interface CodedNodeGraph
Parameters:
associations - List of associations used to restrict the graph. The name and value for each item in the list will be compared against the id and URI of supported associations for participating coding schemes.
associationQualifiers - If supplied, restriction only applies to associations that are qualified by one or more of the supplied qualifiers. The name and value for each item in the list will be compared against the id and URI of supported association qualifiers for participating coding schemes.
Returns:
A new CodedNodeGraph representing the filtered result.
Throws:
LBInvocationException

restrictToDirectionalNames

public CodedNodeGraph restrictToDirectionalNames(NameAndValueList directionalNames,
                                                 NameAndValueList associationQualifiers)
Description copied from interface: CodedNodeGraph
Restrict the graph to the nodes that participate as a source or target of an association whose directional name matches the one provided and, if supplied, the named association qualifiers. A directional name is considered to be either the forward or reverse label registered to an association defined by the ontology. Forward and reverse names are optionally assigned to each association. For example, an association 'lineage' may have a forward name 'ancestorOf' and reverse name 'descendantOf'.

Specified by:
restrictToDirectionalNames in interface CodedNodeGraph
Parameters:
directionalNames - List of directionalNames used to restrict the graph. A directional name is compared against the forward and reverse names for defined associations. If a given name matches more than one forward or reverse label, all corresponding associations are included in the restriction.
associationQualifiers - If supplied, restriction only applies to associations that are qualified by one or more of the supplied qualifiers. The name and value for each item in the list will be compared against the id and URI of supported association qualifiers for participating coding schemes.
Returns:
A new CodedNodeGraph representing the filtered result.

restrictToSourceCodes

public CodedNodeGraph restrictToSourceCodes(CodedNodeSet sourceCodes)
                                     throws LBInvocationException
Description copied from interface: CodedNodeGraph
Restrict the graph to associations that have one of the codes in the supplied list as source codes.

Specified by:
restrictToSourceCodes in interface CodedNodeGraph
Parameters:
sourceCodes - Codes to filter on.
Returns:
A new CodedNodeGraph representing the filtered result.
Throws:
LBInvocationException

restrictToTargetCodes

public CodedNodeGraph restrictToTargetCodes(CodedNodeSet targetCodes)
                                     throws LBInvocationException
Description copied from interface: CodedNodeGraph
Restrict the graph to associations that have one of the codes in the supplied list as target codes.

Specified by:
restrictToTargetCodes in interface CodedNodeGraph
Parameters:
targetCodes - Codes to filter on.
Returns:
A new CodedNodeGraph representing the filtered result.
Throws:
LBInvocationException

restrictToCodeSystem

public CodedNodeGraph restrictToCodeSystem(java.lang.String codeSystem)
                                    throws LBParameterException
Description copied from interface: CodedNodeGraph
Restrict the graph to codes (source and target) that originate from the supplied code system. Note: edges defined by other code systems will still be resolved if associated with both source and target nodes for the restricted code system.

Specified by:
restrictToCodeSystem in interface CodedNodeGraph
Parameters:
codeSystem - The local name or URI of the coding scheme to filter on.
Returns:
A new CodedNodeGraph representing the filtered result.
Throws:
LBParameterException

restrictToSourceCodeSystem

public CodedNodeGraph restrictToSourceCodeSystem(java.lang.String sourceCodeSystem)
                                          throws LBParameterException
Description copied from interface: CodedNodeGraph
Restrict the graph to edges that have codes from the specified code system as a source.

Specified by:
restrictToSourceCodeSystem in interface CodedNodeGraph
Parameters:
sourceCodeSystem - The local name or URI of the coding scheme to filter on.
Returns:
A new CodedNodeGraph representing the filtered result.
Throws:
LBParameterException

restrictToTargetCodeSystem

public CodedNodeGraph restrictToTargetCodeSystem(java.lang.String targetCodeSystem)
                                          throws LBParameterException
Description copied from interface: CodedNodeGraph
Restrict the graph to edges that have codes from the specified code system as a target.

Specified by:
restrictToTargetCodeSystem in interface CodedNodeGraph
Parameters:
targetCodeSystem - The local name or URI of the coding scheme to filter on.
Returns:
A new CodedNodeGraph representing the filtered result.
Throws:
LBParameterException

restrictToAnonymous

public CodedNodeGraph restrictToAnonymous(java.lang.Boolean restrictToAnonymous)
                                   throws LBInvocationException,
                                          LBParameterException
Description copied from interface: CodedNodeGraph
Return a graph that contains only the codes that are either Anonymous, Non-Anonymous, or Not Specified in the supplied list, and all edges that still have a source and target code remaining. A True value signifies Anonymous codes only A False value signifies Non-Anonymous only A Null value signifies all codes will matched

Specified by:
restrictToAnonymous in interface CodedNodeGraph
Returns:
the coded node graph
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

restrictToEntityTypes

public CodedNodeGraph restrictToEntityTypes(LocalNameList localNameList)
                                     throws LBInvocationException,
                                            LBParameterException
Description copied from interface: CodedNodeGraph
Return a graph that contains only the codes that contain an Entity Type in the supplied list, and all edges that still have a source and target code remaining.

Specified by:
restrictToEntityTypes in interface CodedNodeGraph
Parameters:
localNameList - the local name list
Returns:
the coded node graph
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

isCodeInGraph

public java.lang.Boolean isCodeInGraph(ConceptReference code)
                                throws LBInvocationException,
                                       LBParameterException
Description copied from interface: CodedNodeGraph
Determine whether the supplied code is in the graph.

Specified by:
isCodeInGraph in interface CodedNodeGraph
Parameters:
code - Identifies the coding scheme and code to test.
Returns:
True if the code is present; otherwise False.
Throws:
LBInvocationException
LBParameterException

areCodesRelated

public java.lang.Boolean areCodesRelated(NameAndValue association,
                                         ConceptReference sourceCode,
                                         ConceptReference targetCode,
                                         boolean directOnly)
                                  throws LBInvocationException,
                                         LBParameterException
Description copied from interface: CodedNodeGraph
Determine whether there is an directed edge (or transitive closure of an edge) from the source code to the target code in this graph. The last parameter determines whether only direct associations are considered or whether the transitive closure of the edge is used.

Specified by:
areCodesRelated in interface CodedNodeGraph
Parameters:
association - Identifies the association to be tested. The name and value will be compared against the id and URI of supported associations for participating coding schemes.
sourceCode - Source code system/code to be tested.
targetCode - Target code system/code to be tested.
directOnly - True means only asserted association instances are tested. False means that, if the association is defined as transitive, the transitive closure of the association instances are tested.
Returns:
True if a directed edge exists; otherwise False.
Throws:
LBInvocationException
LBParameterException

listCodeRelationships

public java.util.List<java.lang.String> listCodeRelationships(ConceptReference sourceCode,
                                                              ConceptReference targetCode,
                                                              boolean directOnly)
                                                       throws LBInvocationException,
                                                              LBParameterException
Description copied from interface: CodedNodeGraph
Return a list of all of the associations in the graph that have the supplied source and target codes or, if directOnly is false, all associations whose transitive closure has the supplied associations.

Specified by:
listCodeRelationships in interface CodedNodeGraph
Parameters:
sourceCode - Source end of the association. If null, all sources for the specified target are included.
targetCode - Target end of the association. If null, all targets for the specified source are included.
directOnly - True means only direct associations are tested. False means that the transitive closure of transitive (and undefined) associations are tested for membership.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the graph.

Returns:
The list of matching associations.
Throws:
LBInvocationException
LBParameterException

toNodeList

public CodedNodeSet toNodeList(ConceptReference graphFocus,
                               boolean resolveForward,
                               boolean resolveBackward,
                               int resolveAssociationDepth,
                               int maxToReturn)
                        throws LBInvocationException,
                               LBParameterException
Description copied from interface: CodedNodeGraph
Transform the graph into a simple of list of code references, removing all association information.

Specified by:
toNodeList in interface CodedNodeGraph
Parameters:
graphFocus - Set the top or "focus" node of the graph. If present, only the nodes that are reachable via this node will be returned. If null, nodes with no incoming or outgoing associations are used as starting points for navigation of forward and reverse relationships, respectively.
resolveForward - True means include all "forward" (source->target) associations.
resolveBackward - True means render all "reverse" (target->source) associations
resolveAssociationDepth - Number of hops to resolve associations. 0 means leave all associations unresolved, 1 means immediate neighbors, etc. -1 means follow the entire closure of the graph.
maxToReturn - Maximum number of entries to return; a value less than 1 indicates to return unlimited entries (to the limit specified in the runtime configuration file).
Returns:
A set with matching items, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are returned, there is currently no flag or notification provided to indicate whether all available items were returned.
Throws:
LBInvocationException
LBParameterException

resolveAsList

public ResolvedConceptReferenceList resolveAsList(ConceptReference graphFocus,
                                                  boolean resolveForward,
                                                  boolean resolveBackward,
                                                  int resolveCodedEntryDepth,
                                                  int resolveAssociationDepth,
                                                  LocalNameList restrictToProperties,
                                                  CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                  SortOptionList sortOptions,
                                                  int maxToReturn)
                                           throws LBInvocationException,
                                                  LBParameterException
Description copied from interface: CodedNodeGraph
Resolve all of the coded nodes in the list, sorting by the supplied property (if any), resolving the supplied properties, resolving coded entries to the supplied depth and resolving associations to the supplied depth.

Specified by:
resolveAsList in interface CodedNodeGraph
Parameters:
graphFocus - Set the top or "focus" node of the graph. If present, only the nodes that are reachable via this node will be returned. If null, nodes with no incoming or outgoing associations are used as starting points for navigation of forward and reverse relationships, respectively.
resolveForward - True means resolve in the direction of source to target.
resolveBackward - True means resolve in the direction of target to source.
resolveCodedEntryDepth - Depth in the graph to resolve coded entries. - 1 means don't resolve anything - just return code references, 0 means resolve just the root nodes, 1 means resolve 1 deep, etc.
resolveAssociationDepth - Number of hops to resolve associations. 0 means leave all associations unresolved, 1 means immediate neighbors, etc. -1 means follow the entire closure of the graph.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
sortOptions - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
maxToReturn - Maximum number of entries to return; a value less than 1 indicates to return unlimited entries (to the limit specified in the runtime configuration file).
Returns:
A list of code references, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are returned, there is currently no flag or notification provided to indicate whether all available items were returned.

Each entry will include basic information for the node along with an embedded object (e.g. concept) populated with requested properties.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the graph.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeGraph#resolveAsList(org.LexGrid.LexBIG.DataModel.Core.ConceptReference, boolean, boolean, int, int, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, org.LexGrid.LexBIG.DataModel.Collections.SortOptionList, int)

resolveAsList

public ResolvedConceptReferenceList resolveAsList(ConceptReference graphFocus,
                                                  boolean resolveForward,
                                                  boolean resolveBackward,
                                                  int resolveCodedEntryDepth,
                                                  int resolveAssociationDepth,
                                                  LocalNameList restrictToProperties,
                                                  CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                  SortOptionList sortOptions,
                                                  LocalNameList filterOptions,
                                                  int maxToReturn)
                                           throws LBInvocationException,
                                                  LBParameterException
Description copied from interface: CodedNodeGraph
Resolve all of the coded nodes in the list, sorting by the supplied property (if any), resolving the supplied properties, resolving coded entries to the supplied depth, resolving associations to the supplied depth, and allowing for additional filters to be applied against the returned items.

Specified by:
resolveAsList in interface CodedNodeGraph
Parameters:
graphFocus - Set the top or "focus" node of the graph. If present, only the nodes that are reachable via this node will be returned. If null, nodes with no incoming or outgoing associations are used as starting points for navigation of forward and reverse relationships, respectively.
resolveForward - True means resolve in the direction of source to target.
resolveBackward - True means resolve in the direction of target to source.
resolveCodedEntryDepth - Depth in the graph to resolve coded entries. - 1 means don't resolve anything - just return the code references, 0 means resolve just the root nodes, 1 means resolve 1 deep, etc.
resolveAssociationDepth - Number of hops to resolve associations. 0 means leave all associations unresolved, 1 means immediate neighbors, etc. -1 means follow the entire closure of the graph.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
sortOptions - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
filterOptions - List of Filter extensions to apply during resolution. If supplied, filters are applied in the order provided. Each name in the list must correspond to the name of a Filter description as registered to the associated service. Available Filter descriptions can be retrieved through the LexBIGService getFilterExtensions() method after being defined to the LexBIGServiceManager extension registry.
maxToReturn - Maximum number of entries to return; a value less than 1 indicates to return unlimited entries (to the limit specified in the runtime configuration file).
Returns:
A list of node references, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are returned, there is currently no flag or notification provided to indicate whether all available items were returned.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the graph.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeGraph#resolveAsList(org.LexGrid.LexBIG.DataModel.Core.ConceptReference, boolean, boolean, int, int, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, org.LexGrid.LexBIG.DataModel.Collections.SortOptionList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, int)

resolveAsList

public ResolvedConceptReferenceList resolveAsList(ConceptReference graphFocus,
                                                  boolean resolveForward,
                                                  boolean resolveBackward,
                                                  int resolveCodedEntryDepth,
                                                  int resolveAssociationDepth,
                                                  LocalNameList restrictToProperties,
                                                  CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                  SortOptionList sortOptions,
                                                  LocalNameList filterOptions,
                                                  int maxToReturn,
                                                  boolean keepLastAssociationLevelUnresolved)
                                           throws LBInvocationException,
                                                  LBParameterException
Description copied from interface: CodedNodeGraph
Resolve all of the coded nodes in the list, sorting by the supplied property (if any), resolving the supplied properties, resolving coded entries to the supplied depth, resolving associations to the supplied depth, and allowing for additional filters to be applied against the returned items.

Specified by:
resolveAsList in interface CodedNodeGraph
Parameters:
graphFocus - Set the top or "focus" node of the graph. If present, only the nodes that are reachable via this node will be returned. If null, nodes with no incoming or outgoing associations are used as starting points for navigation of forward and reverse relationships, respectively.
resolveForward - True means resolve in the direction of source to target.
resolveBackward - True means resolve in the direction of target to source.
resolveCodedEntryDepth - Depth in the graph to resolve coded entries. - 1 means don't resolve anything - just return the code references, 0 means resolve just the root nodes, 1 means resolve 1 deep, etc.
resolveAssociationDepth - Number of hops to resolve associations. 0 means leave all associations unresolved, 1 means immediate neighbors, etc. -1 means follow the entire closure of the graph.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
sortOptions - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
filterOptions - List of Filter extensions to apply during resolution. If supplied, filters are applied in the order provided. Each name in the list must correspond to the name of a Filter description as registered to the associated service. Available Filter descriptions can be retrieved through the LexBIGService getFilterExtensions() method after being defined to the LexBIGServiceManager extension registry.
maxToReturn - Maximum number of entries to return; a value less than 1 indicates to return unlimited entries (to the limit specified in the runtime configuration file).
keepLastAssociationLevelUnresolved - Keep the last hop while resolving associations to the resolveAssociationDepth unresolved. This is useful while drawing trees of an ontology and we need a quick way to tell if the tree can be expanded further.
Returns:
A list of coded node references, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are returned, there is currently no flag or notification provided to indicate whether all available items were returned.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the graph.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeGraph#resolveAsList(org.LexGrid.LexBIG.DataModel.Core.ConceptReference, boolean, boolean, int, int, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, org.LexGrid.LexBIG.DataModel.Collections.SortOptionList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, int, boolean)

getHolder

protected GHolder getHolder(ConceptReference graphFocus,
                            boolean resolveForward,
                            boolean resolveBackward,
                            int resolveAssociationDepth,
                            int maxToReturn,
                            boolean keepLastAssociationLevelUnresolved)
                     throws java.lang.Exception
Throws:
java.lang.Exception

clone

public CodedNodeGraphImpl clone()
                         throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

optimizePendingOpsOrder

protected void optimizePendingOpsOrder()

listCodeRelationships

public java.util.List<java.lang.String> listCodeRelationships(ConceptReference sourceCode,
                                                              ConceptReference targetCode,
                                                              int distance)
                                                       throws LBInvocationException,
                                                              LBParameterException
Description copied from interface: CodedNodeGraph
Return a list of all of the associations in the graph that have the supplied source and target codes based on distance between them. Distance (or the No. of edges) for a direct association between a source and target codes is 1. Values if distance should be equal or greater than 1, otherwise exception is thrown. Resulting list is not based on associations source & target have, but on distance only.

Specified by:
listCodeRelationships in interface CodedNodeGraph
Parameters:
sourceCode - Source end of the association. If null, all sources for the specified target are included.
targetCode - Target end of the association. If null, all targets for the specified source are included.
distance - Distance (# of edges) source and target codes must have in between. Must be positive & greater than zero.
Returns:
The list of matching associations.
Throws:
LBInvocationException
LBParameterException

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.