software/test/performance/src/org/LexGrid/LexBIG/example/ProfileScheme.java
/**
     * @param lbs - service context
     * @param lbscm - convenience methods
     * @param csVorT - coding scheme version or tag (version in this case)
     * @throws LBException
     */
@param lbs - service context
@param lbscm - convenience methods
@param csVorT - coding scheme version or tag (version in this case)
@throws LBException
@param lbs - service context @param lbscm - convenience methods @param csVorT - coding scheme version or tag ( version in this case ) @throws LBException
protected void profileAssociations(LexBIGService lbs, LexBIGServiceConvenienceMethods lbscm, String schemeName, CodingSchemeVersionOrTag csVorT) throws LBException {
        CodingScheme scheme = lbs.resolveCodingScheme(schemeName, csVorT);
        Set<String> assocNames = new TreeSet<String>();
        for (SupportedAssociation supported : scheme.getMappings().getSupportedAssociation()) {
            assocNames.add(supported.getLocalId());
            assoc2srcFreq.put(supported.getLocalId(), 0);
            assoc2tgtFreq.put(supported.getLocalId(), 0);
        }
        int count = 0;
        try {
            CodedNodeSet allCodes = lbs.getCodingSchemeConcepts(schemeName, csVorT);
            LocalNameList noProps = Constructors.createLocalNameList("--no-property--");
            ResolvedConceptReferencesIterator potentialSources =
                allCodes.resolve(null, noProps, null);
            while (potentialSources.hasNext()) {
                ResolvedConceptReference potentialSource = potentialSources.next();
                CodedNodeGraph cng = lbs.getNodeGraph(schemeName, csVorT, null);
                ResolvedConceptReferenceList rcrList =
                    cng.resolveAsList(potentialSource, true, false, -1, 1, noProps, null, null, null, -1);
                for (ResolvedConceptReference rcr : rcrList.getResolvedConceptReference()) {
                    AssociationList assocList = rcr.getSourceOf();
                    for (Association assoc : assocList.getAssociation()) {
                        String assocName = assoc.getAssociationName();
                        Integer freq = assoc2srcFreq.get(assocName);
                        assoc2srcFreq.put(assocName, (freq == null ? 1 : freq + 1));
                        freq = assoc2tgtFreq.get(assocName);
                        int targetCount = assoc.getAssociatedConcepts().getAssociatedConceptCount();
                        assoc2tgtFreq.put(assocName, (freq == null ? targetCount : freq + targetCount));
                    }
                    if (count++ % 100 == 0) System.out.print('.');
                    if (count % 7800 == 0) System.out.println();
                }
            }
        } catch (Exception e) {
            Util.displayMessage(e.getMessage());
        }
    }
protected void profileAssociations ( LexBIGService lbs , LexBIGServiceConvenienceMethods lbscm , String schemeName , CodingSchemeVersionOrTag csVorT ) throws LBException { CodingScheme scheme = lbs . resolveCodingScheme ( schemeName , csVorT ) ; Set < String > assocNames = new TreeSet < String > ( ) ; for ( SupportedAssociation supported : scheme . getMappings ( ) . getSupportedAssociation ( ) ) { assocNames . add ( supported . getLocalId ( ) ) ; assoc2srcFreq . put ( supported . getLocalId ( ) , 0 ) ; assoc2tgtFreq . put ( supported . getLocalId ( ) , 0 ) ; } int count = 0 ; try { CodedNodeSet allCodes = lbs . getCodingSchemeConcepts ( schemeName , csVorT ) ; LocalNameList noProps = Constructors . createLocalNameList ( "--no-property--" ) ; ResolvedConceptReferencesIterator potentialSources = allCodes . resolve ( null , noProps , null ) ; while ( potentialSources . hasNext ( ) ) { ResolvedConceptReference potentialSource = potentialSources . next ( ) ; CodedNodeGraph cng = lbs . getNodeGraph ( schemeName , csVorT , null ) ; ResolvedConceptReferenceList rcrList = cng . resolveAsList ( potentialSource , true , false , - 1 , 1 , noProps , null , null , null , - 1 ) ; for ( ResolvedConceptReference rcr : rcrList . getResolvedConceptReference ( ) ) { AssociationList assocList = rcr . getSourceOf ( ) ; for ( Association assoc : assocList . getAssociation ( ) ) { String assocName = assoc . getAssociationName ( ) ; Integer freq = assoc2srcFreq . get ( assocName ) ; assoc2srcFreq . put ( assocName , ( freq == null ? 1 : freq + 1 ) ) ; freq = assoc2tgtFreq . get ( assocName ) ; int targetCount = assoc . getAssociatedConcepts ( ) . getAssociatedConceptCount ( ) ; assoc2tgtFreq . put ( assocName , ( freq == null ? targetCount : freq + targetCount ) ) ; } if ( count ++ % 100 == 0 ) System . out . print ( '.' ) ; if ( count % 7800 == 0 ) System . out . println ( ) ; } } } catch ( Exception e ) { Util . displayMessage ( e . getMessage ( ) ) ; } }
@param lbs - service context
 @param lbscm - convenience methods
 @param csVorT - coding scheme version or tag (version in this case)
 @throws LBException
@param lbs - service context @param lbscm - convenience methods @param csVorT - coding scheme version or tag ( version in this case ) @throws LBException
// Init frequency for supported properties and qualifiers.  This way
 // we will know if property or qualifier was registered but not used.
 // For each association, determine frequencies ...
 // Resolve and evaluate all source to target relationships.
 // Since this step can be extensive provide periodic feedback to the user
 // to indicate the process is still active ...
 // Brute force approach to evaluate each possible source, concept by concept.
 // Time intensive, but scales better and helps avoid possible bottlenecks related
 // to exceeding system-defined search limits.
 // Bump source count ...
 // Bump target count ...
