当前位置: 首页>>代码示例>>Java>>正文


Java ResolvedConceptReference类代码示例

本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference的典型用法代码示例。如果您正苦于以下问题:Java ResolvedConceptReference类的具体用法?Java ResolvedConceptReference怎么用?Java ResolvedConceptReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResolvedConceptReference类属于org.LexGrid.LexBIG.DataModel.Core包,在下文中一共展示了ResolvedConceptReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getItemText

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
/**
 * Returns the text representing the given item.  Note that in
 * general this method assumes the presentations have been constrianed
 * during the initial query by HCD qualification.
 * @param rcr Concept resolved from a query.
 * @param hcd The hierarchical code to reflect in printed output.
 * @return The first embedded text presentation, or the item
 * description if no presentation is found.
 */
protected String getItemText(ResolvedConceptReference rcr, String hcd) {
	StringBuffer sb = new StringBuffer(rcr.getConceptCode());
	boolean presFound = false;
	if (rcr.getReferencedEntry() != null) {
		Presentation[] presentations = rcr.getReferencedEntry().getPresentation();
		for (int i = 0; i < presentations.length && !presFound; i++) {
			Presentation p = presentations[i];
			PropertyQualifier[] quals = p.getPropertyQualifier();
			for (int j = 0; j < quals.length && !presFound; j++) {
				PropertyQualifier pq = quals[j];
				if (presFound = "HCD".equals(pq.getPropertyQualifierId()) && hcd.equals(pq.getContent())) {
					sb.append(':').append(p.getText().getContent());
				}
			}
		}
	}
	if (!presFound && rcr.getEntityDescription() != null)
		sb.append(':').append(rcr.getEntityDescription().getContent());
	return sb.toString();
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:30,代码来源:FindUMLSContextsForCUI.java

示例2: createStringFromResolvedConceptReferenceObject

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public static String createStringFromResolvedConceptReferenceObject(ResolvedConceptReference reference, int tabCount){
	StringBuffer results = new StringBuffer();
	String tabs = createTabs(tabCount);
	
	appendLine(results, tabs, " Code: " + reference.getCode());
	appendLine(results, tabs, " CodeNamespace: " + reference.getCodeNamespace());
	appendLine(results, tabs, " CodingSchemeName: " + reference.getCodingSchemeName());
	appendLine(results, tabs, " CodingSchemeURI: " + reference.getCodingSchemeURI());
	appendLine(results, tabs, " CodingSchemeVersion: " + reference.getCodingSchemeVersion());
	appendLine(results, tabs, " ConceptCode: " + reference.getConceptCode());

	appendLine(results, tabs, " EntityDescription: " + reference.getEntityDescription().getContent());
	appendLine(results, tabs, " Entities: \n");
	appendLine(results, "", createStringFromEntityObject(reference.getEntity(), tabCount + 1));
	appendLine(results, tabs, " SourceOf: " + reference.getSourceOf());
	appendLine(results, tabs, " TargetOf: " + reference.getTargetOf());
	
	return results.toString();
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:20,代码来源:PrintUtility.java

示例3: doPage

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
@Override
protected List<? extends ResolvedConceptReference> doPage(
		int position,
		int pageSize) {


	List<ResolvedConceptReference> returnList = new ArrayList<ResolvedConceptReference>();
	try {
		while(quickIterator.hasNext() && returnList.size() < pageSize){
			returnList.addAll(this.resolveOneHit(quickIterator.next()));
		}
	} catch (LBException e) {
		throw new RuntimeException(e);
	}
	return returnList;
}
 
开发者ID:NCIP,项目名称:nci-mapping-tool,代码行数:17,代码来源:SearchByAssociationIteratorDecorator.java

示例4: dumpResolvedValueSetCodingSchemes

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public void dumpResolvedValueSetCodingSchemes() {
	int sample_size = 5;
	Vector v = getResolvedValueSetCodingSchemes();
	System.out.println("\nNumber of Resolved Value Set coding schemes: " + v.size());
       for (int i=0; i<5; i++) {
		String t = (String) v.elementAt(i);
		int j = i+1;
		System.out.println("\n" + " (" + j + ") " + t);

		String cs_name = getValueSetCodingSchemeName(t);
		String cs_version = getValueSetCodingSchemeVersion(t);
		System.out.println("\t" + cs_name + " (" + cs_version + ")");

		ResolvedConceptReferenceList samples = generateTestCases(cs_name, cs_version, sample_size, TestCaseGenerator.TYPE_VALUE_SET);
		for (int k=0; k<samples.getResolvedConceptReferenceCount(); k++) {
			ResolvedConceptReference rcr = (ResolvedConceptReference) samples.getResolvedConceptReference(k);
			System.out.println("\t" + rcr.getEntityDescription().getContent() + " (" + rcr.getCode() + ")");
		}
	}
}
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:21,代码来源:TestUtils.java

示例5: getRandomResolvedConceptReference

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public ResolvedConceptReference getRandomResolvedConceptReference(String source) {
   SourceTreeUtils sourceTreeUtils = new SourceTreeUtils(lbSvc);
TreeItem ti = sourceTreeUtils.getSourceTree(source);
if (ti == null) return null;
if (!ti._expandable) {
	return null;
}
Vector v = new Vector();
Iterator iterator = ti._assocToChildMap.keySet().iterator();
while (iterator.hasNext()) {
	String assocText = (String) iterator.next();
	List<TreeItem> children = ti._assocToChildMap.get(assocText);
	for (int k=0; k<children.size(); k++) {
		TreeItem child_ti = (TreeItem) children.get(k);
		ResolvedConceptReference rcr = new ResolvedConceptReference();
		EntityDescription ed = new EntityDescription();
		ed.setContent(child_ti._text);
		rcr.setEntityDescription(ed);
		rcr.setCode(child_ti._code);
		v.add(rcr);
	}
}
if (v.size() == 0) return null;
int m = new RandomVariateGenerator().uniform(0, v.size()-1);
return (ResolvedConceptReference) v.elementAt(m);
  }
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:27,代码来源:NCImUITestGenerator.java

示例6: getConceptByCode

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
/**
  * Get concept Entity by code
  * @param codingScheme
  * @param code
  * @return
  */
 public ResolvedConceptReference getConceptByCode(String codingScheme, String version,
 		String code) {
     CodedNodeSet cns = null;
     ResolvedConceptReferencesIterator iterator = null;

     try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
         CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
         if (version != null) csvt.setVersion(version);

         cns = lbSvc.getCodingSchemeConcepts(codingScheme, csvt);
         ConceptReferenceList crefs =
             createConceptReferenceList(new String[] { code }, codingScheme);
         cns.restrictToCodes(crefs);
         iterator = cns.resolve(null, null, null);
         if (iterator.numberRemaining() > 0) {
             ResolvedConceptReference ref = (ResolvedConceptReference) iterator.next();
             return ref;
         }
     } catch (LBException e) {
         _logger.info("Error: " + e.getMessage());
     }

     return null;
 }
 
开发者ID:NCIP,项目名称:nci-mapping-tool,代码行数:32,代码来源:SearchCart.java

示例7: dumpMappingCodingSchemes

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public void dumpMappingCodingSchemes() {
	int sample_size = 5;
	Vector v = getMappingCodingSchemes();
       for (int i=0; i<v.size(); i++) {
		String t = (String) v.elementAt(i);
		int j = i+1;
		System.out.println("\n" + " (" + j + ") " + t);
		String cs_name = getMappingCodingSchemeName(t);
		String cs_version = getMappingCodingSchemeVersion(t);
		System.out.println("\t" + cs_name + " (" + cs_version + ")");

		ResolvedConceptReferenceList samples = generateTestCases(cs_name, cs_version, sample_size, TestCaseGenerator.TYPE_MAPPING);
		for (int k=0; k<samples.getResolvedConceptReferenceCount(); k++) {
			ResolvedConceptReference rcr = (ResolvedConceptReference) samples.getResolvedConceptReference(k);
			System.out.println("\t" + rcr.getEntityDescription().getContent() + " (" + rcr.getCode() + ")");
		}
	}
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:19,代码来源:TestUtils.java

示例8: search

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public ResolvedConceptReference	validate(String scheme, String version,
                                            String matchText,
										 String[] associationsToNavigate, String[] association_qualifier_names,
										 String[] association_qualifier_values, int search_direction,
										 String source, String matchAlgorithm, boolean designationOnly,
										 boolean ranking, int maxToReturn
                                            ) {
    ResolvedConceptReferencesIterator iterator = search(scheme, version, matchText,
										 associationsToNavigate, association_qualifier_names,
										 association_qualifier_values, search_direction,
										 source, matchAlgorithm, designationOnly,
										 ranking, maxToReturn);
	if (iterator == null) return null;
	ResolvedConceptReference rcref = null;
	try {
		while(iterator.hasNext()) {
			rcref = iterator.next();
			return rcref;
		}
	} catch (Exception ex) {
		ex.printStackTrace();
	}
	return null;
}
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:25,代码来源:TestCaseValidator.java

示例9: getConceptByCode

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
/**
  * Get concept Entity by code
  * @param codingScheme
  * @param code
  * @return
  */
 public ResolvedConceptReference getConceptByCode(String codingScheme, String code) {
     CodedNodeSet cns = null;
     ResolvedConceptReferencesIterator iterator = null;

     try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
         cns = lbSvc.getCodingSchemeConcepts(codingScheme, null);
         ConceptReferenceList crefs =
             createConceptReferenceList(new String[] { code }, codingScheme);
         cns.restrictToCodes(crefs);
         iterator = cns.resolve(null, null, null);
         if (iterator.numberRemaining() > 0) {
             ResolvedConceptReference ref = (ResolvedConceptReference) iterator.next();
             return ref;
         }
     } catch (LBException e) {
         _logger.info("Error: " + e.getMessage());
     }

     return null;
 }
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:28,代码来源:SearchCart.java

示例10: main

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    args = parse(args);
    LexBIGService lbs = RemoteServerUtil.createLexBIGService();
    
    CodedNodeSet cns =
        lbs.getCodingSchemeConcepts("NCI MetaThesaurus", null);
    cns =
        cns.restrictToMatchingDesignations("single dose",
            SearchDesignationOption.ALL, "LuceneQuery", null);

    CodedNodeGraph cng = lbs.getNodeGraph("NCI MetaThesaurus", null, null);
    cng = cng.restrictToTargetCodes(cns);
    ResolvedConceptReferenceList list =
        cng.resolveAsList(null, true, false, 0, 0, null, null, null, null,
            500);

    for (ResolvedConceptReference ref : list.getResolvedConceptReference()) {
        System.out.println("Code: " + ref.getCode());
        System.out.println(" Entity Description"
            + ref.getEntityDescription().getContent());
    }
}
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:23,代码来源:KevinTest.java

示例11: validateValueSetSearch

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public ResolvedConceptReference validateValueSetSearch(
	                                     String scheme, String version,
                                            String matchText,
                                            String target,
										 String matchAlgorithm,
										 int maxToReturn
                                            ) {
    ResolvedConceptReferencesIterator iterator = searchValueSet(
	                                     scheme, version,
                                            matchText,
                                            target,
										 matchAlgorithm,
										 maxToReturn);

	if (iterator == null) return null;
	ResolvedConceptReference rcref = null;
	try {
		while(iterator.hasNext()) {
			rcref = iterator.next();
			return rcref;
		}
	} catch (Exception ex) {
		ex.printStackTrace();
	}
	return null;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:27,代码来源:TestCaseValidator.java

示例12: selectRandomTestCases

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public ResolvedConceptReferenceList selectRandomTestCases(ResolvedConceptReferenceList list, int number) {
	ResolvedConceptReferenceList samples = new ResolvedConceptReferenceList();
	if (list.getResolvedConceptReferenceCount() == 0) return samples;
	int max_to_return = number;
	if (max_to_return > list.getResolvedConceptReferenceCount()) {
		max_to_return = list.getResolvedConceptReferenceCount();
	}

	List selected_list = rvGenerator.selectWithNoReplacement(max_to_return, list.getResolvedConceptReferenceCount()-1);
	for (int i=0; i<selected_list.size(); i++) {
		Integer int_obj = (Integer) selected_list.get(i);
		ResolvedConceptReference rcr = list.getResolvedConceptReference(int_obj.intValue());
		samples.addResolvedConceptReference(rcr);
	}
       return samples;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:17,代码来源:TestUtils.java

示例13: print

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
/**
 * Prints the.
 *
 * @param ref the ref
 * @param depth the depth
 */
private static void print(ResolvedConceptReference ref, int depth){
	String code = ref.getConceptCode();

	String description;
	if(ref.getEntityDescription() != null){
		description = ref.getEntityDescription().getContent();
	} else {
		description = "";
	}

	System.out.println(buildPrefix(depth) + "Code: " + code + ", Description: " + description + " Hash: " + ref.hashCode());
	if(ref.getSourceOf() != null){
		print(ref.getSourceOf(), depth+1);
	}
	if(ref.getTargetOf() != null){
		print(ref.getTargetOf(), depth+1);
	}
}
 
开发者ID:NCIP,项目名称:camod,代码行数:25,代码来源:PrintUtility.java

示例14: generateResolvedConceptReferences

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
public ResolvedConceptReferenceList generateResolvedConceptReferences(String codingScheme, String version, int number) {
	if (version == null) {
		version = codingSchemeDataUtils.getVocabularyVersionByTag(codingScheme, gov.nih.nci.evs.browser.common.Constants.PRODUCTION);
	}

       CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
       if (version != null) {
           csvt.setVersion(version);
	}

	ResolvedConceptReferenceList rcrl = new ResolvedConceptReferenceList();
	try {
		LocalNameList entityTypes = new LocalNameList();
		entityTypes.addEntry("concept");
		CodedNodeSet cns = lbSvc.getNodeSet(codingScheme, csvt, entityTypes);

		SortOptionList sortOptions = null;
		LocalNameList filterOptions = null;
		LocalNameList propertyNames = null;
		CodedNodeSet.PropertyType[] propertyTypes = null;
		boolean resolveObjects = false;
		int maxToReturn = number;
           ResolvedConceptReferenceList rvrlist = cns.resolveToList(sortOptions, filterOptions, propertyNames, propertyTypes, resolveObjects, maxToReturn);

           for (int i=0; i<rvrlist.getResolvedConceptReferenceCount(); i++) {
			ResolvedConceptReference rcr = rvrlist.getResolvedConceptReference(i);
			rcrl.addResolvedConceptReference(rcr);
		}
	} catch (Exception ex) {
		ex.printStackTrace();
	}
	return rcrl;
}
 
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:34,代码来源:TestCaseGenerator.java

示例15: extract

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入依赖的package包/类
@Override
public String extract(ResolvedConceptReference ref) {
	if(ref.getEntityDescription() != null) {
		return ref.getEntityDescription().getContent();
	} else {
		return "";
	}
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:9,代码来源:SearchExtensionBulkDownloader.java


注:本文中的org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。