NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{scrollbar:icons=false}
h1. {page-info:title}
{section}
{column:width=75%}
{panel:title=Contents of this Page}
{toc:minLevel=2}
{panel}
{column}
{column}
{align:right}{include:Menu LexEVS 6.0 CTS2 to Include}{align}
{column}
{section}

h2. Introduction
LexEVS CTS2 Association Query Operation API provides capability to query Associations available in the system.

h2. Interface
{{org.lexevs.cts2.query.AssociationQueryOperation}} is the main interface for all the queries against Associations. This interface can be accessed using main LexEVSCTS2 interface:

{code}
org.lexevs.cts2.query.AssociationQueryOperation associationQueryOp = new org.lexevs.cts2.LexEvsCTS2Impl().getQueryOperation().getAssociationQueryOperation();
{code}

h2. Query Functions
Here are the major query functions available using AssociationQueryOperation interface:


h3. listAssociations
This function returns the resolved concept reference (which contains the associations) according to given node.

{{listAssociations(String codingSystemName CodingSchemeVersionOrTag versionOrTag String namespace String code String associationName boolean isBackward int depth int maxToReturn)}}

|| *Description:* | Returns the resolved concept reference (which contains the associations) according to given node. |
|| *Input:* | * *_java.lang.String codingSystemName_* - The code system of the Associations to be returned.
* *_org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag versionOrTag_* - (Optional) Version identifier of the code system (defaults to 'PRODUCTION' tagged code systems)
* *_java.lang.String namespace_* - The namespace of the Entity focus.
* *_java.lang.String code_* - The code of the Entity focus.
* *_java.lang.String associationName_* - (Optional) The Association to restrict to (if null, all Associations will be returned)
* *_boolean isBackward_* - The code system of the Associations to be returned.
* *_integer depth_* - The Association depth to traverse
* *_integer maxToReturn_* - The max number of results to return (use '-1' for 'no limit') |
|| *Output:* | *_org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList_* - List of Associations |
|| *Sample Call:* | * _Step 1:_ Instantiate CodeSystemQueryOperation if it is not done yet:
{code}
org.lexevs.cts2.query.AssociationQueryOperation associationQueryOp = new org.lexevs.cts2.LexEvsCTS2Impl().getQueryOperation().getAssociationQueryOperation();
{code}
* _Step 2:_ To get all the Associations for a given code and namespace:
{code}
 org.LexGrid.LexBIG.DataModel.Collections.CodingSchemeRenderingList csrList = associationQueryOp.listAssociations("CodeSystem",null,"ns","code",null,false,1,-1);{code} |

h3. determineTransitiveConceptRelationship
Returns the path according to given two nodes.

{{determineTransitiveConceptRelationship(String codingSystemName CodingSchemeVersionOrTag versionOrTag String relationContainerName String associationName String sourceCode String sourceNamespace String targetCode String targetNamespace)}}

|| *Description:* | Returns the path according to given two nodes. |
|| *Input:* | * *_java.lang.String codingSystemName_* - The code system of the Associations to be returned.
* *_org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag versionOrTag_* - (Optional) Version identifier of the code system (defaults to 'PRODUCTION' tagged code systems)
* *_java.lang.String relationContainerName_* - (Optional) The Relations Container name.
* *_java.lang.String associationName_* - (Optional) The Association to restrict to (if null, all Associations will be used)
* *_java.lang.String sourceCode_* - The source Entity code.
* *_java.lang.String sourceNamespace_* - The source Entity namespace.
* *_java.lang.String targetCode_* - The target Entity code.
* *_java.lang.String targetNamespace_* - The target Entity namespace. |
|| *Output:* | *_org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference_* - The path between the two nodes. |
|| *Sample Call:* | * _Step 1:_ Instantiate CodeSystemQueryOperation if it is not done yet:
{code}
org.lexevs.cts2.query.AssociationQueryOperation associationQueryOp = new org.lexevs.cts2.LexEvsCTS2Impl().getQueryOperation().getAssociationQueryOperation();{code}
* _Step 2:_ To get all the Associations for a given code and namespace:
{code}
org.LexGrid.LexBIG.DataModel.Collections.CodingSchemeRenderingList csrList = associationQueryOp.determineTransitiveConceptRelationship("CodeSystem",null,"r1","hasSubtype","sc","sns","tc","tns");{code} |

h3. computeSubsumptionRelationship
Return whether the two nodes has a transitive closure path.

{{determineTransitiveConceptRelationship(String codingSystemName CodingSchemeVersionOrTag versionOrTag String associationType ConceptReference sourceCode, ConceptReference targetCode)}}

|| *Description:* | Return whether the two nodes has a transitive closure path. |
|| *Input:* | * *_java.lang.String codingSystemName_* - The code system of the Associations to be returned.
* *_org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag versionOrTag_* - (Optional) Version identifier of the code system (defaults to 'PRODUCTION' tagged code systems)
* *_java.lang.String associationType_* - (Optional) The Association to restrict to (if null, all Associations will be used)
* *_org.LexGrid.LexBIG.DataModel.Core.ConceptReference sourceCode_* - The source Entity.
* *_org.LexGrid.LexBIG.DataModel.Core.ConceptReference sourceNamespace_* - The target Entity. |
|| *Output:* | *_boolean_* - 'true' if the two nodes have a transitive closure path, 'false' if not. |
|| *Sample Call:* | * _Step 1:_ Instantiate CodeSystemQueryOperation if it is not done yet:
{code}
org.lexevs.cts2.query.AssociationQueryOperation associationQueryOp = new org.lexevs.cts2.LexEvsCTS2Impl().getQueryOperation().getAssociationQueryOperation();
{code}
* _Step 2a:_ Create Concept References:
{code}
ConceptReference source = new ConceptReference();
source.setCode = "sourceCode";
ConceptReference target= new ConceptReference();
target.setCode = "targetCode";
{code}
* _Step 2b:_ To check the ConceptReferences for subsumption:
{code}
boolean isSubsumed = associationQueryOp.computeSubsumptionRelationship("CodeSystem",null,"hasSubtype",source,target");{code} |

h3. getAssociationDetails
Return association triple according to association instance id.

{{getAssociationDetails(String codingSchemeName, CodingSchemeVersionOrTag versionOrTag, String associationInstanceId)}}

|| *Description:* | Return association triple according to association instance id. |
|| *Input:* | * *_java.lang.String codingSchemeName_* - (*Mandatory*) Name of the code system.
* *_org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag versionOrTag_* - (Optional) Version or tag (like 'dev', 'production' etc) of the code system.
* *_java.lang.String associationInstanceId_* - (*Mandatory*) The unique id of the triple. |
|| *Output:* | *_org.lexevs.dao.database.service.association.AssociationService.AssociationTriple_* - Detailed Association Triple object |
|| *Sample Call:* | * _Step 1:_ Instantiate CodeSystemQueryOperation if it is not done yet:
{code}
org.lexevs.cts2.query.AssociationQueryOperation associationQueryOp = new org.lexevs.cts2.LexEvsCTS2Impl().getQueryOperation().getAssociationQueryOperation();
{code}
* _Step 2:_ Populate CodeSystemVersionOrTag object:
{code}
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
versionOrTag.setVersion("1.0");
{code}
* _Step 3:_ Call getAssociationDetails method by providing code system version and association instance id:
{code}
AssociationTriple triple = csQueryOp.getAssociationDetails ("Automobiles", versionOrTag, "id12345");
{code} |

{scrollbar:icons=false}