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


Java ResolvedConceptReference.getEntity方法代码示例

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


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

示例1: getNCImCodes

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
public Vector getNCImCodes(String scheme, String version, String code) {
      Vector w = new Vector();
      CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
      if (version != null) {
	csvt.setVersion(version);
}
try {

	ConceptReferenceList crefs = ConvenienceMethods.createConceptReferenceList(new String[] { code }, scheme);
	CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);

	if (cns == null) {
		return null;
	}
	cns = cns.restrictToStatus(ActiveOption.ALL, null);
	cns = cns.restrictToCodes(crefs);
	ResolvedConceptReferenceList matches = cns.resolveToList(null, null, null, 1);
	if (matches.getResolvedConceptReferenceCount() > 0) {
		ResolvedConceptReference ref = (ResolvedConceptReference) matches.enumerateResolvedConceptReference()
				.nextElement();
		Entity node = ref.getEntity();
		return getNCImCodes(node);
	}

} catch (Exception ex) {
	ex.printStackTrace();
}
return w;
  }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:30,代码来源:TestConceptDetails.java

示例2: printProps

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
/**
   * Display properties for the given code.
   *
   * @param code
   * @param lbSvc
   * @param scheme
   * @param csvt
   * @return
   * @throws LBException
   */
  protected boolean printProps(PrintWriter pw, String scheme, CodingSchemeVersionOrTag csvt, String code)
          throws LBException {
      // Perform the query ...
      pw.println("Coding scheme|" + scheme);
      pw.println("Version|" + csvt.getVersion());
      List<String> namespaces = getDistinctNamespacesOfCode(scheme, csvt.getVersion(), code);
      String namespace = namespaces.get(0);
      pw.println("Namespace|" + namespace);
      pw.println("code|" + code);

      ConceptReferenceList crefs = ConvenienceMethods.createConceptReferenceList(new String[] { code }, scheme);
       CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);

if (cns == null) {
	pw.println("CNS == NULL???");
	return false;
}

      cns = cns.restrictToStatus(ActiveOption.ALL, null);
      cns = cns.restrictToCodes(crefs);
      ResolvedConceptReferenceList matches = cns.resolveToList(null, null, null, 1);

      // Analyze the result ...
      if (matches.getResolvedConceptReferenceCount() > 0) {
          ResolvedConceptReference ref = (ResolvedConceptReference) matches.enumerateResolvedConceptReference()
                  .nextElement();
          Entity node = ref.getEntity();
           printProperties(pw, node);
      }
      return true;
  }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:42,代码来源:EntityExporter.java

示例3: getNCImCodes

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
public Vector getNCImCodes(String scheme, String version, String code) {
      Vector w = new Vector();
      CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
      if (version != null) {
	csvt.setVersion(version);
}
try {
	ConceptReferenceList crefs = ConvenienceMethods.createConceptReferenceList(new String[] { code }, scheme);
	CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);

	if (cns == null) {
		return null;
	}
	cns = cns.restrictToStatus(ActiveOption.ALL, null);
	cns = cns.restrictToCodes(crefs);
	ResolvedConceptReferenceList matches = cns.resolveToList(null, null, null, 1);
	if (matches.getResolvedConceptReferenceCount() > 0) {
		ResolvedConceptReference ref = (ResolvedConceptReference) matches.enumerateResolvedConceptReference()
				.nextElement();
		Entity node = ref.getEntity();
		return getNCImCodes(node);
	}

} catch (Exception ex) {
	ex.printStackTrace();
}
return w;
  }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:29,代码来源:ConceptDetails.java

示例4: getPropertyValues

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
public HashMap getPropertyValues(String scheme, String version, String propertyType, String propertyName) {
	HashMap hmap = new HashMap();
	CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
	if (version != null) versionOrTag.setVersion(version);
	try {
		CodedNodeSet cns = getNodeSet(scheme, versionOrTag);
		SortOptionList sortOptions = null;
		LocalNameList filterOptions = null;
		LocalNameList propertyNames = Constructors.createLocalNameList(propertyName);
		CodedNodeSet.PropertyType[] propertyTypes = null;
		boolean resolveObjects = true;

		ResolvedConceptReferencesIterator iterator = cns.resolve(sortOptions, filterOptions, propertyNames,
			propertyTypes, resolveObjects);
		while (iterator != null && iterator.hasNext()) {
			ResolvedConceptReference rcr = iterator.next();
			Entity concept = rcr.getEntity();
   			Vector v = getPropertyValues(concept, propertyType, propertyName);
   			if (v != null) {
				if (v.size() > 0) {
					String key = concept.getEntityCode();
					String value = (String) v.elementAt(0);
					hmap.put(key, value);
				}
			}
		}
	} catch (Exception ex) {
		ex.printStackTrace();
	}
	return hmap;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:32,代码来源:ConceptDetails.java

示例5: getEVSConcept

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
private EVSConcept getEVSConcept(ResolvedConceptReference rcRef) {
	EVSConcept evsConcept = new EVSConcept();
	evsConcept.setCode(rcRef.getCode());
	
	Entity entity = rcRef.getEntity();
	evsConcept.setDefinitions(getEntityDefinitions(entity));
	evsConcept = setProperties(evsConcept, entity);
	
	return evsConcept;
}
 
开发者ID:NCIP,项目名称:cadsr-semantic-tools,代码行数:11,代码来源:LexEVSQueryServiceImpl.java

示例6: transformFullDescription

import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference; //导入方法依赖的package包/类
@Override
public EntityListEntry transformFullDescription(ResolvedConceptReference reference) {
	Assert.isTrue(reference.getEntity() != null, 
			"The Entity is null. Please resolve the CodedNodeSet with Resolve = true");

	Entity entity = reference.getEntity();
	
	NamedEntityDescription namedEntity = new NamedEntityDescription();
	namedEntity.setAbout(this.getUriHandler().getEntityUri(reference));
	
	namedEntity.setEntityID(
			ModelUtils.createScopedEntityName(
					entity.getEntityCode(), 
					this.sanitizeNamespace(entity.getEntityCodeNamespace())));
	
	String codingSchemeName = 
		this.getCodingSchemeNameTranslator().translateFromLexGrid(reference.getCodingSchemeName());
	
	namedEntity.setDescribingCodeSystemVersion(
		this.getTransformUtils().toCodeSystemVersionReference(
			codingSchemeName, 
			reference.getCodingSchemeVersion(),
			reference.getCodingSchemeURI()));
	
	namedEntity.setDesignation(this.toDesignation(entity.getPresentation()));
	namedEntity.setProperty(this.toProperty(
			codingSchemeName,
			reference.getCodingSchemeURI(),
			reference.getCodingSchemeVersion(),
			entity.getAllProperties()));
	namedEntity.setDefinition(this.toDefinition(entity.getDefinition()));
	namedEntity.setNote(this.toNote(entity.getComment()));
	
	namedEntity.setChildren(
		this.getUrlConstructor().createChildrenUrl(
				codingSchemeName, 
				reference.getCodingSchemeVersion(), 
				entity.getEntityCode()));
	
	try {
		namedEntity.setParent(this.getParents(reference));
	} catch (Exception e) {
		log.warn("Error resolving Parents for: " + reference.getCode());
		if(log.isDebugEnabled()){
			log.debug(e);
		}
	}
	
	URIAndEntityName entityType = new URIAndEntityName();
    entityType.setName("Class");
    entityType.setNamespace("owl");
    entityType.setUri("http://www.w3.org/2002/07/owl#Class");

    namedEntity.addEntityType(entityType);
    
    String entityHref = this.getTransformUtils().createEntityHref(reference);
    
    //NOTE: We probably want to check this with the CodedNodeGraph to
    //see if there actually are associations to link to. That's added
    //expense that I'm not sure if we want.
    namedEntity.setSubjectOf(
    	entityHref + "/" + URIHelperInterface.SUBJECTOF);

 	namedEntity.setTargetOf(
		entityHref + "/" + URIHelperInterface.TARGETOF);
	
	EntityDescription ed = new EntityDescription();
	ed.setNamedEntity(namedEntity);
	
	EntityListEntry listEntry = new EntityListEntry();
	listEntry.setEntry(ed);
	listEntry.setResourceName(
		EncodingUtils.encodeScopedEntityName(
			ModelUtils.createScopedEntityName(
				reference.getCode(), 
				this.sanitizeNamespace(reference.getCodeNamespace()))));
	
	listEntry.setHref(this.getTransformUtils().createEntityHref(reference));
	
	return listEntry;
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:82,代码来源:EntityTransform.java


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