public class UnionGraph extends AbstractMultiGraph
Constructor and Description |
---|
UnionGraph() |
UnionGraph(CodedNodeGraph graph1,
CodedNodeGraph graph2)
Instantiates a new union graph.
|
Modifier and Type | Method and Description |
---|---|
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.
|
ResolvedConceptReferenceList |
doResolveAsList(ConceptReference graphFocus,
boolean resolveForward,
boolean resolveBackward,
int resolveCodedEntryDepth,
int resolveAssociationDepth,
LocalNameList propertyNames,
CodedNodeSet.PropertyType[] propertyTypes,
SortOptionList sortOptions,
LocalNameList filterOptions,
int maxToReturn,
boolean keepLastAssociationLevelUnresolved)
Do resolve as list.
|
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.
|
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.
|
protected ResolvedConceptReferenceList |
unionReferenceList(boolean nullFocus,
ResolvedConceptReferenceList list1,
ResolvedConceptReferenceList list2) |
getGraph1, getGraph2, restrictToAnonymous, restrictToAssociations, restrictToCodes, restrictToCodeSystem, restrictToDirectionalNames, restrictToEntityTypes, restrictToSourceCodes, restrictToSourceCodeSystem, restrictToTargetCodes, restrictToTargetCodeSystem, setGraph1, setGraph2
getLogger, intersect, isCodeInGraph, listCodeRelationships, resolveAsList, resolveAsList, resolveAsList, union
public UnionGraph()
public UnionGraph(CodedNodeGraph graph1, CodedNodeGraph graph2)
graph1
- the graph1graph2
- the graph2public java.util.List<java.lang.String> listCodeRelationships(ConceptReference sourceCode, ConceptReference targetCode, boolean directOnly) throws LBInvocationException, LBParameterException
CodedNodeGraph
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.
LBInvocationException
LBParameterException
public java.lang.Boolean areCodesRelated(NameAndValue association, ConceptReference sourceCode, ConceptReference targetCode, boolean directOnly) throws LBInvocationException, LBParameterException
CodedNodeGraph
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.LBInvocationException
LBParameterException
public ResolvedConceptReferenceList doResolveAsList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveCodedEntryDepth, int resolveAssociationDepth, LocalNameList propertyNames, CodedNodeSet.PropertyType[] propertyTypes, SortOptionList sortOptions, LocalNameList filterOptions, int maxToReturn, boolean keepLastAssociationLevelUnresolved) throws LBInvocationException, LBParameterException
AbstractCodedNodeGraph
doResolveAsList
in class AbstractCodedNodeGraph
graphFocus
- the graph focusresolveForward
- the resolve forwardresolveBackward
- the resolve backwardresolveCodedEntryDepth
- the resolve coded entry depthresolveAssociationDepth
- the resolve association depthpropertyNames
- the property namespropertyTypes
- the property typessortOptions
- the sort optionsfilterOptions
- the filter optionsmaxToReturn
- the max to returnkeepLastAssociationLevelUnresolved
- the keep last association level unresolvedLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic CodedNodeSet toNodeList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveAssociationDepth, int maxToReturn) throws LBInvocationException, LBParameterException
CodedNodeGraph
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) associationsresolveAssociationDepth
- 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).LBInvocationException
LBParameterException
protected ResolvedConceptReferenceList unionReferenceList(boolean nullFocus, ResolvedConceptReferenceList list1, ResolvedConceptReferenceList list2)