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


Java CodingScheme.getRelations方法代码示例

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


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

示例1: getMappingSourceAndTarget

import org.LexGrid.codingSchemes.CodingScheme; //导入方法依赖的package包/类
public String getMappingSourceAndTarget(String scheme, String version) {
	CodingScheme cs = resolveCodingScheme(scheme, version);
	if (cs == null) return null;
	Relations[] relations = cs.getRelations();
	if (relations == null) return null;
	Relations relation = cs.getRelations(0);

	Boolean bool_obj = relation.isIsMapping();
	if (bool_obj == null || bool_obj.equals(Boolean.FALSE)) {
		return null;
	}

	return relation.getSourceCodingScheme() + "|"
	      + relation.getSourceCodingSchemeVersion() + "|"
	      + relation.getTargetCodingScheme() + "|"
	      + relation.getTargetCodingSchemeVersion();
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:18,代码来源:CodingSchemeDataUtils.java

示例2: getFromToCodingSchemes

import org.LexGrid.codingSchemes.CodingScheme; //导入方法依赖的package包/类
protected Tuple<CodeSystemVersionReference> getFromToCodingSchemes(CodingScheme codingScheme){
	Assert.isTrue(
		codingScheme.getRelationsCount() == 1,
		"Only ONE Relations container is allowed in a Mapping Coding Scheme.");
	
	Relations relations = codingScheme.getRelations(0);
	String source = relations.getSourceCodingScheme();
	String sourceVersion = relations.getSourceCodingSchemeVersion();
	String target = relations.getTargetCodingScheme();
	String targetVersion = relations.getTargetCodingSchemeVersion();
	
	//TODO
	return new Tuple<CodeSystemVersionReference>(
			this.getTransformUtils().toCodeSystemVersionReference(source, sourceVersion, null),
			this.getTransformUtils().toCodeSystemVersionReference(target, targetVersion, null)
	);
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:18,代码来源:CodingSchemeToMapVersionTransform.java

示例3: getSupportedRoleNames

import org.LexGrid.codingSchemes.CodingScheme; //导入方法依赖的package包/类
public List getSupportedRoleNames(String scheme, String version) {
      CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
      if (version != null) {
          csvt.setVersion(version);
}

      List list = new ArrayList();
      try {
          CodingScheme cs = lbSvc.resolveCodingScheme(scheme, csvt);
          Relations[] relations = cs.getRelations();
          for (int i = 0; i < relations.length; i++) {
              Relations relation = relations[i];
              if (relation.getContainerName().compareToIgnoreCase("roles") == 0
                  || relation.getContainerName().compareToIgnoreCase(
                      "relations") == 0) {
                  org.LexGrid.relations.AssociationPredicate[] asso_array =
                      relation.getAssociationPredicate();
                  for (int j = 0; j < asso_array.length; j++) {
                      org.LexGrid.relations.AssociationPredicate association =
                          (org.LexGrid.relations.AssociationPredicate) asso_array[j];
                      list.add(association.getAssociationName());
                  }
              }
          }
      } catch (Exception ex) {
          ex.printStackTrace();
      }
      return list;
  }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:30,代码来源:CodingSchemeDataUtils.java

示例4: checkIfCts2MapExists

import org.LexGrid.codingSchemes.CodingScheme; //导入方法依赖的package包/类
public static boolean checkIfCts2MapExists(
		CodingScheme lexCodingScheme, 
		Set<NameOrURI> cts2RestrictedCodeSystemSet, 
		String cts2MapRoleValue) {

	boolean codingSchemeExistsInSet = false;

	// Assuming format of Map has only has 1 relations section/1 relations element in xml file
	if (lexCodingScheme.getRelationsCount() != 1) {
		throw new UnsupportedOperationException("Invalid format for Map. Expecting only one metadata section for Relations.");
	}
	Relations lexRelations = lexCodingScheme.getRelations(0);
	String lexSourceCodingScheme = lexRelations.getSourceCodingScheme();
	String lexTargetCodingScheme = lexRelations.getTargetCodingScheme();
	
	if (cts2MapRoleValue.equals(Constants.MAP_TO_ROLE) && CommonCodingSchemeUtils.lexCodingSchemeExistsInCts2CodeSystemSet(lexTargetCodingScheme, null, cts2RestrictedCodeSystemSet)) {
		codingSchemeExistsInSet = true;
	}
	
	if (cts2MapRoleValue.equals(Constants.MAP_FROM_ROLE) && CommonCodingSchemeUtils.lexCodingSchemeExistsInCts2CodeSystemSet(lexSourceCodingScheme, null, cts2RestrictedCodeSystemSet)) { 
		codingSchemeExistsInSet = true;
	}
	
	if (cts2MapRoleValue.equals(Constants.BOTH_MAP_ROLES) && 
			CommonCodingSchemeUtils.lexCodingSchemeExistsInCts2CodeSystemSet(lexTargetCodingScheme, lexSourceCodingScheme, cts2RestrictedCodeSystemSet)) {
		codingSchemeExistsInSet = true;
	}
	
	return codingSchemeExistsInSet;
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:31,代码来源:CommonCodingSchemeUtils.java

示例5: getFromToCodingSchemes

import org.LexGrid.codingSchemes.CodingScheme; //导入方法依赖的package包/类
protected Tuple<CodeSystemReference> getFromToCodingSchemes(CodingScheme codingScheme){
	Assert.isTrue(
		codingScheme.getRelationsCount() == 1,
		"Only ONE Relations container is allowed in a Mapping Coding Scheme.");
	
	Relations relations = codingScheme.getRelations(0);
	String source = relations.getSourceCodingScheme();
	String target = relations.getTargetCodingScheme();
	
	//TODO:
	return new Tuple<CodeSystemReference>(
			this.getTransformUtils().toCodeSystemReference(source, null),
			this.getTransformUtils().toCodeSystemReference(target, null)
	);
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:16,代码来源:CodingSchemeToMapTransform.java


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