本文整理汇总了Java中org.LexGrid.codingSchemes.CodingScheme类的典型用法代码示例。如果您正苦于以下问题:Java CodingScheme类的具体用法?Java CodingScheme怎么用?Java CodingScheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodingScheme类属于org.LexGrid.codingSchemes包,在下文中一共展示了CodingScheme类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAssociationNames
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
/**
* Return a list of Association names
*
* @param scheme
* @param version
* @return
*/
public Vector<String> getAssociationNames(String scheme, String version) {
Vector<String> association_vec = new Vector<String>();
try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
if (version != null) {
versionOrTag.setVersion(version);
}
CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag);
SupportedHierarchy[] hierarchies = cs.getMappings().getSupportedHierarchy();
String[] ids = hierarchies[0].getAssociationNames();
for (int i = 0; i < ids.length; i++) {
if (!association_vec.contains(ids[i])) {
association_vec.add(ids[i]);
_logger.debug("AssociationName: " + ids[i]);
}
}
} catch (Exception ex) {
_logger.warn(ex.getMessage());
}
return association_vec;
}
示例2: getAssociationNames
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
/**
* Return a list of Association names
*
* @param scheme
* @param version
* @return
*/
public Vector<String> getAssociationNames(String scheme, String version) {
Vector<String> association_vec = new Vector<String>();
try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
versionOrTag.setVersion(version);
CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag);
SupportedHierarchy[] hierarchies = cs.getMappings().getSupportedHierarchy();
String[] ids = hierarchies[0].getAssociationNames();
for (int i = 0; i < ids.length; i++) {
if (!association_vec.contains(ids[i])) {
association_vec.add(ids[i]);
_logger.debug("AssociationName: " + ids[i]);
}
}
} catch (Exception ex) {
_logger.warn(ex.getMessage());
}
return association_vec;
}
示例3: getResovedValueSetVersions
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public Vector getResovedValueSetVersions(String selected_vocabulary) {
Vector v = new Vector();
try {
List<CodingScheme> schemes = lrvs.listAllResolvedValueSets();
for (int i = 0; i < schemes.size(); i++) {
CodingScheme cs = schemes.get(i);
int j = i+1;
String key = cs.getCodingSchemeURI();
String cs_name = cs.getCodingSchemeName();
String name = cs.getFormalName();
String value = cs.getRepresentsVersion();
if (key.compareTo(selected_vocabulary) == 0 || cs_name.compareTo(selected_vocabulary) == 0 || name.compareTo(selected_vocabulary) == 0) {
v.add(value);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
return v;
}
示例4: getRVSCSName2VersionHashMap
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public HashMap getRVSCSName2VersionHashMap() {
HashMap hmap = new HashMap();
try {
List<CodingScheme> schemes = lrvs.listAllResolvedValueSets();
for (int i = 0; i < schemes.size(); i++) {
CodingScheme cs = schemes.get(i);
String uri = cs.getCodingSchemeURI();
String name = cs.getCodingSchemeName();
hmap.put(uri, cs.getRepresentsVersion());
hmap.put(name, cs.getRepresentsVersion());
}
} catch (Exception ex) {
ex.printStackTrace();
}
return hmap;
}
示例5: getSupportedPropertyNames
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public Vector<String> getSupportedPropertyNames(CodingScheme cs) {
Vector w = getSupportedProperties(cs);
if (w == null) return null;
Vector<String> v = new Vector<String>();
for (int i=0; i<w.size(); i++)
{
SupportedProperty sp = (SupportedProperty) w.elementAt(i);
if (sp.getUri() != null && isAnnotationPropertyPCode(sp.getLocalId())) {
if (!sp.getUri().endsWith(sp.getLocalId())) {
v.add(sp.getLocalId());
}
} else {
v.add(sp.getLocalId());
}
}
return SortUtils.quickSort(v);
}
示例6: getResolvedValueSetCodingSchemes
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public Vector getResolvedValueSetCodingSchemes() {
Vector w = new Vector();
try {
//List<CodingScheme> choices = new ArrayList<CodingScheme>();
LexEVSResolvedValueSetService lrvs = new LexEVSResolvedValueSetServiceImpl(lbSvc);
if (lrvs == null) {
System.out.println("WARNING: lrvs == null???");
return null;
}
List<CodingScheme> schemes = lrvs.listAllResolvedValueSets();
if (schemes == null) {
System.out.println("WARNING: lrvs.listAllResolvedValueSets() returns null.");
return null;
}
for (int i = 0; i < schemes.size(); i++) {
CodingScheme cs = schemes.get(i);
w.add(cs.getCodingSchemeName() + "|" + cs.getRepresentsVersion() + "|" + cs.getFormalName() + "|" + cs.getCodingSchemeURI());
}
} catch (Exception ex) {
ex.printStackTrace();
}
return w;
}
示例7: getResolvedValueSetHashMap
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public HashMap getResolvedValueSetHashMap() {
if (resovedValueSetHashMap != null) return resovedValueSetHashMap;
HashMap hmap = new HashMap();
try {
//List<CodingScheme> choices = new ArrayList<CodingScheme>();
LexEVSResolvedValueSetService lrvs = new LexEVSResolvedValueSetServiceImpl(lbSvc);
List<CodingScheme> schemes = lrvs.listAllResolvedValueSets();
for (int i = 0; i < schemes.size(); i++) {
CodingScheme cs = schemes.get(i);
int j = i+1;
String key = cs.getCodingSchemeURI();
String name = cs.getCodingSchemeName();
String value = cs.getRepresentsVersion();
Vector v = new Vector();
if (hmap.containsKey(key)) {
v = (Vector) hmap.get(key);
}
v.add(value);
hmap.put(key, v);
}
} catch (Exception ex) {
ex.printStackTrace();
}
return hmap;
}
示例8: getSupportedHierarchies
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
protected SupportedHierarchy[] getSupportedHierarchies(
String codingScheme, CodingSchemeVersionOrTag versionOrTag)
throws LBException {
CodingScheme cs = null;
try {
cs = getCodingScheme(codingScheme, versionOrTag);
} catch (Exception ex) {
}
if (cs == null) {
throw new LBResourceUnavailableException(
"Coding scheme not found -- " + codingScheme);
}
Mappings mappings = cs.getMappings();
return mappings.getSupportedHierarchy();
}
示例9: 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)
);
}
示例10: getPropertyQualifierListData
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public Vector<String> getPropertyQualifierListData(
String codingSchemeName, String version) {
CodingSchemeVersionOrTag vt = new CodingSchemeVersionOrTag();
if (version != null) {
vt.setVersion(version);
}
CodingScheme scheme = null;
try {
scheme = lbSvc.resolveCodingScheme(codingSchemeName, vt);
if (scheme == null)
return null;
Vector<String> propertyQualifierListData = new Vector<String>();
SupportedPropertyQualifier[] qualifiers =
scheme.getMappings().getSupportedPropertyQualifier();
for (int i = 0; i < qualifiers.length; i++) {
SupportedPropertyQualifier qualifier = qualifiers[i];
propertyQualifierListData.add(qualifier.getLocalId());
}
return propertyQualifierListData;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例11: getRepresentationalFormListData
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public Vector<String> getRepresentationalFormListData(
String codingSchemeName, String version) {
CodingSchemeVersionOrTag vt = new CodingSchemeVersionOrTag();
if (version != null) {
vt.setVersion(version);
}
CodingScheme scheme = null;
try {
scheme = lbSvc.resolveCodingScheme(codingSchemeName, vt);
if (scheme == null)
return null;
Vector<String> propertyNameListData = new Vector<String>();
SupportedRepresentationalForm[] forms =
scheme.getMappings().getSupportedRepresentationalForm();
if (forms != null) {
for (int i = 0; i < forms.length; i++) {
SupportedRepresentationalForm form = forms[i];
propertyNameListData.add(form.getLocalId());
}
}
return propertyNameListData;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例12: getByVersionIdOrTag
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
/**
* Gets the code system by version id or tag.
*
* @param codeSystem the code system
* @param versionIdOrTag the version id or tag
* @return the code system by version id or tag
*/
protected T getByVersionIdOrTag(
NameVersionPair namePair){
if(namePair == null){
return null;
}
CodingScheme codingScheme = this.resolve(namePair.getName(),
Constructors.createCodingSchemeVersionOrTagFromVersion(namePair.getVersion()));
if(codingScheme != null && this.isValidCodingScheme(codingScheme)){
return this.transform(codingScheme);
} else {
return null;
}
}
示例13: getHierarchyAssociationId
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public Vector getHierarchyAssociationId(String scheme, String version) {
Vector association_vec = new Vector();
try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
// Will handle secured ontologies later.
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
versionOrTag.setVersion(version);
CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag);
Mappings mappings = cs.getMappings();
SupportedHierarchy[] hierarchies = mappings.getSupportedHierarchy();
java.lang.String[] ids = hierarchies[0].getAssociationIds();
for (int i=0; i<ids.length; i++)
{
if (!association_vec.contains(ids[i])) {
association_vec.add(ids[i]);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
return association_vec;
}
示例14: getCodingScheme
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
/**
* @param codingScheme
* @param version
* @return
*/
@SuppressWarnings("unused")
private static CodingScheme getCodingScheme(String codingScheme,
String version) {
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
if (version != null)
versionOrTag.setVersion(version);
CodingScheme cs = null;
LexBIGService lbSvc =null;
try {
lbSvc = RemoteServerUtil.createLexBIGService();
cs = lbSvc.resolveCodingScheme(codingScheme, versionOrTag);
} catch (Exception e) {
_logger.error(e.getStackTrace());
return null;
}
return cs;
}
示例15: createDirectoryResultWithEntryFullVersionDescriptions
import org.LexGrid.codingSchemes.CodingScheme; //导入依赖的package包/类
public static <T> DirectoryResult<T> createDirectoryResultWithEntryFullVersionDescriptions(
LexBIGService lexBigService,
LexEvsToCTS2Transformer<T,CodingScheme,?,?> transformer,
CodingSchemeRendering[] lexCodeSchemeRenderings,
boolean atEnd2){
List<T> cts2EntryList = new ArrayList<T>();
boolean atEnd = true;
DirectoryResult<T> cts2DirectoryResult = new DirectoryResult<T>(cts2EntryList, atEnd);
if(lexCodeSchemeRenderings != null){
for (CodingSchemeRendering lexCodingSchemeRendering : lexCodeSchemeRenderings) {
String lexCodingSchemeName = lexCodingSchemeRendering.getCodingSchemeSummary().getCodingSchemeURI();
String lexCodingSchemeVersion = lexCodingSchemeRendering.getCodingSchemeSummary().getRepresentsVersion();
CodingSchemeVersionOrTag lexTagOrVersion = Constructors.createCodingSchemeVersionOrTagFromVersion(lexCodingSchemeVersion);
try {
CodingScheme lexCodingScheme = lexBigService.resolveCodingScheme(lexCodingSchemeName, lexTagOrVersion);
cts2EntryList.add(transformer.transformFullDescription(lexCodingScheme));
} catch (LBException e) {
throw new RuntimeException(e);
}
}
cts2DirectoryResult = new DirectoryResult<T>(cts2EntryList, atEnd);
}
return cts2DirectoryResult;
}