本文整理汇总了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();
}
示例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)
);
}
示例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;
}
示例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;
}
示例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)
);
}