org.LexGrid.LexBIG.Impl.pagedgraph.query
Class DefaultGraphQueryBuilder

java.lang.Object
  extended by org.LexGrid.LexBIG.Impl.pagedgraph.query.DefaultGraphQueryBuilder
All Implemented Interfaces:
java.io.Serializable, GraphQueryBuilder

public class DefaultGraphQueryBuilder
extends java.lang.Object
implements GraphQueryBuilder

The Class DefaultGraphQueryBuilder.

Author:
Kevin Peterson
See Also:
Serialized Form

Nested Class Summary
static class DefaultGraphQueryBuilder.InvalidMatchCodeNamspacePair
           
 
Field Summary
static ConceptReference INVALID_MATCH_CONCEPT_REFERENCE
           
 
Constructor Summary
DefaultGraphQueryBuilder(java.lang.String codingSchemeUri, java.lang.String version)
          Instantiates a new default graph query builder.
DefaultGraphQueryBuilder(java.lang.String codingSchemeUri, java.lang.String version, GraphQuery query)
           
 
Method Summary
protected  java.util.List<ConceptReference> getCodesFromCodedNodeSet(CodedNodeSet codes)
           
 GraphQuery getQuery()
          Gets the query.
 void restrictToAnonymous(java.lang.Boolean restrictToAnonymous)
           
 void restrictToAssociations(NameAndValueList association, 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.
 void 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.
 void restrictToCodeSystem(java.lang.String codingScheme)
          Restrict the graph to codes (source and target) that originate from the supplied code system.
 void 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.
 void restrictToEntityTypes(LocalNameList localNameList)
           
 void restrictToSourceCodes(CodedNodeSet codes)
          Restrict the graph to associations that have one of the codes in the supplied list as source codes.
 void restrictToSourceCodeSystem(java.lang.String codingScheme)
          Restrict the graph to edges that have codes from the specified code system as a source.
 void restrictToTargetCodes(CodedNodeSet codes)
          Restrict the graph to associations that have one of the codes in the supplied list as target codes.
 void restrictToTargetCodeSystem(java.lang.String codingScheme)
          Restrict the graph to edges that have codes from the specified code system as a target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_MATCH_CONCEPT_REFERENCE

public static ConceptReference INVALID_MATCH_CONCEPT_REFERENCE
Constructor Detail

DefaultGraphQueryBuilder

public DefaultGraphQueryBuilder(java.lang.String codingSchemeUri,
                                java.lang.String version,
                                GraphQuery query)

DefaultGraphQueryBuilder

public DefaultGraphQueryBuilder(java.lang.String codingSchemeUri,
                                java.lang.String version)
Instantiates a new default graph query builder.

Method Detail

getQuery

public GraphQuery getQuery()
Description copied from interface: GraphQueryBuilder
Gets the query.

Specified by:
getQuery in interface GraphQueryBuilder
Returns:
the query

restrictToAssociations

public void restrictToAssociations(NameAndValueList association,
                                   NameAndValueList associationQualifiers)
                            throws LBInvocationException,
                                   LBParameterException
Description copied from interface: GraphQueryBuilder
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 GraphQueryBuilder
Parameters:
association - 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.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

restrictToCodeSystem

public void restrictToCodeSystem(java.lang.String codingScheme)
                          throws LBInvocationException,
                                 LBParameterException
Description copied from interface: GraphQueryBuilder
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 GraphQueryBuilder
Parameters:
codingScheme - The local name or URI of the coding scheme to filter on.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

restrictToCodes

public void restrictToCodes(CodedNodeSet codes)
                     throws LBInvocationException,
                            LBParameterException
Description copied from interface: GraphQueryBuilder
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 GraphQueryBuilder
Parameters:
codes - Codes to filter on.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

getCodesFromCodedNodeSet

protected java.util.List<ConceptReference> getCodesFromCodedNodeSet(CodedNodeSet codes)
                                                             throws LBInvocationException,
                                                                    LBParameterException
Throws:
LBInvocationException
LBParameterException

restrictToDirectionalNames

public void restrictToDirectionalNames(NameAndValueList directionalNames,
                                       NameAndValueList associationQualifiers)
                                throws LBInvocationException,
                                       LBParameterException
Description copied from interface: GraphQueryBuilder
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 GraphQueryBuilder
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.
Throws:
LBInvocationException - ,LBParameterException
LBParameterException - the LB parameter exception

restrictToSourceCodeSystem

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

Specified by:
restrictToSourceCodeSystem in interface GraphQueryBuilder
Parameters:
codingScheme - The local name or URI of the coding scheme to filter on.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

restrictToSourceCodes

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

Specified by:
restrictToSourceCodes in interface GraphQueryBuilder
Parameters:
codes - Codes to filter on.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

restrictToTargetCodeSystem

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

Specified by:
restrictToTargetCodeSystem in interface GraphQueryBuilder
Parameters:
codingScheme - The local name or URI of the coding scheme to filter on.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

restrictToTargetCodes

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

Specified by:
restrictToTargetCodes in interface GraphQueryBuilder
Parameters:
codes - Codes to filter on.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

restrictToAnonymous

public void restrictToAnonymous(java.lang.Boolean restrictToAnonymous)
                         throws LBInvocationException,
                                LBParameterException
Specified by:
restrictToAnonymous in interface GraphQueryBuilder
Throws:
LBInvocationException
LBParameterException

restrictToEntityTypes

public void restrictToEntityTypes(LocalNameList localNameList)
                           throws LBInvocationException,
                                  LBParameterException
Specified by:
restrictToEntityTypes in interface GraphQueryBuilder
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.