本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Core.ConceptReference类的典型用法代码示例。如果您正苦于以下问题:Java ConceptReference类的具体用法?Java ConceptReference怎么用?Java ConceptReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConceptReference类属于org.LexGrid.LexBIG.DataModel.Core包,在下文中一共展示了ConceptReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: codedNodeGraph2CodedNodeSetIterator
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
* Return Iterator for codedNodeGraph
*
* @param cng
* @param graphFocus
* @param resolveForward
* @param resolveBackward
* @param resolveAssociationDepth
* @param maxToReturn
* @return
*/
public ResolvedConceptReferencesIterator codedNodeGraph2CodedNodeSetIterator(
CodedNodeGraph cng, ConceptReference graphFocus,
boolean resolveForward, boolean resolveBackward,
int resolveAssociationDepth, int maxToReturn) {
CodedNodeSet cns = null;
try {
cns = cng.toNodeList(graphFocus, resolveForward, resolveBackward,
resolveAssociationDepth, maxToReturn);
if (cns == null) return null;
return cns.resolve(null, null, null);
} catch (Exception ex) {
_logger.warn(ex.getMessage());
}
return null;
}
示例2: createConceptReferenceList
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public ConceptReferenceList createConceptReferenceList(
String[] codes, String codingSchemeName, String ns) {
if (codes == null) {
return null;
}
ConceptReferenceList list = new ConceptReferenceList();
for (int i = 0; i < codes.length; i++) {
ConceptReference cr = new ConceptReference();
cr.setCodingSchemeName(codingSchemeName);
cr.setConceptCode(codes[i]);
if (ns != null) {
cr.setCodeNamespace(ns);
}
list.addConceptReference(cr);
}
return list;
}
示例3: createConceptReferenceList
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static ConceptReferenceList createConceptReferenceList(String[] codes, String codingSchemeName)
{
if (codes == null)
{
return null;
}
ConceptReferenceList list = new ConceptReferenceList();
for (int i = 0; i < codes.length; i++)
{
ConceptReference cr = new ConceptReference();
cr.setCodingScheme(codingSchemeName);
cr.setConceptCode(codes[i]);
list.addConceptReference(cr);
}
return list;
}
示例4: createConceptReferenceList
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static ConceptReferenceList createConceptReferenceList(String[] codes, String codingSchemeName)
{
if (codes == null)
{
return null;
}
ConceptReferenceList list = new ConceptReferenceList();
for (int i = 0; i < codes.length; i++)
{
ConceptReference cr = new ConceptReference();
cr.setCodingSchemeName(codingSchemeName);
cr.setConceptCode(codes[i]);
list.addConceptReference(cr);
}
return list;
}
示例5: createConceptReferenceList
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
* @param codes
* @param codingSchemeName
* @return
*/
private ConceptReferenceList createConceptReferenceList(String[] codes,
String codingSchemeName) {
if (codes == null)
return null;
ConceptReferenceList list = new ConceptReferenceList();
for (int i = 0; i < codes.length; i++) {
ConceptReference cr = new ConceptReference();
cr.setCodingSchemeName(codingSchemeName);
cr.setConceptCode(codes[i]);
list.addConceptReference(cr);
}
return list;
}
示例6: createConceptReferenceList
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static ConceptReferenceList createConceptReferenceList(
Vector codes, String codingSchemeName) {
if (codes == null) {
return null;
}
ConceptReferenceList list = new ConceptReferenceList();
for (int i = 0; i < codes.size(); i++) {
String code = (String) codes.elementAt(i);
ConceptReference cr = new ConceptReference();
if (codingSchemeName != null) cr.setCodingSchemeName(codingSchemeName);
cr.setConceptCode(code);
list.addConceptReference(cr);
}
return list;
}
示例7: createConceptReferenceList
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public ConceptReferenceList createConceptReferenceList(
String[] codes, String codingSchemeName) {
if (codes == null) {
return null;
}
ConceptReferenceList list = new ConceptReferenceList();
for (int i = 0; i < codes.length; i++) {
ConceptReference cr = new ConceptReference();
cr.setCodingSchemeName(codingSchemeName);
cr.setConceptCode(codes[i]);
list.addConceptReference(cr);
}
return list;
}
示例8: getAssociationSources
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public Vector getAssociationSources(String scheme, String version, String code, String assocName)
{
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) csvt.setVersion(version);
ResolvedConceptReferenceList matches = null;
Vector v = new Vector();
try {
//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
NameAndValueList nameAndValueList =
createNameAndValueList(
new String[] {assocName}, null);
NameAndValueList nameAndValueList_qualifier = null;
cng = cng.restrictToAssociations(nameAndValueList, nameAndValueList_qualifier);
ConceptReference graphFocus = ConvenienceMethods.createConceptReference(code, scheme);
boolean resolveForward = false;
boolean resolveBackward = true;
int resolveAssociationDepth = 1;
int maxToReturn = 1000;
ResolvedConceptReferencesIterator iterator = codedNodeGraph2CodedNodeSetIterator(
cng,
graphFocus,
resolveForward,
resolveBackward,
resolveAssociationDepth,
maxToReturn);
v = resolveIterator(iterator, maxToReturn, code);
} catch (Exception ex) {
ex.printStackTrace();
}
return v;
}
示例9: getAssociationTargets
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public Vector getAssociationTargets(String scheme, String version, String code, String assocName)
{
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) csvt.setVersion(version);
ResolvedConceptReferenceList matches = null;
Vector v = new Vector();
try {
//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
NameAndValueList nameAndValueList =
createNameAndValueList(
new String[] {assocName}, null);
NameAndValueList nameAndValueList_qualifier = null;
cng = cng.restrictToAssociations(nameAndValueList, nameAndValueList_qualifier);
ConceptReference graphFocus = ConvenienceMethods.createConceptReference(code, scheme);
boolean resolveForward = true;
boolean resolveBackward = false;
int resolveAssociationDepth = 1;
int maxToReturn = 1000;
ResolvedConceptReferencesIterator iterator = codedNodeGraph2CodedNodeSetIterator(
cng,
graphFocus,
resolveForward,
resolveBackward,
resolveAssociationDepth,
maxToReturn);
v = resolveIterator(iterator, maxToReturn, code);
} catch (Exception ex) {
ex.printStackTrace();
}
return v;
}
示例10: isCodeInValueSet
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public static Boolean isCodeInValueSet(String code, String codingScheme, String vsd_uri) {
try {
String URL = "http://ncias-q541-v.nci.nih.gov:29080/lexevsapi60";
URL = "http://localhost:19280/lexevsapi60";
LexEVSDistributed distributed =
(LexEVSDistributed)
ApplicationServiceProvider.getApplicationServiceFromUrl(URL, "EvsServiceInfo");
LexEVSValueSetDefinitionServices vds = distributed.getLexEVSValueSetDefinitionServices();
java.lang.String valueSetDefinitionRevisionId = null;
AbsoluteCodingSchemeVersionReferenceList csVersionList = getEntireAbsoluteCodingSchemeVersionReferenceList();
java.lang.String csVersionTag = null;
ResolvedValueSetCodedNodeSet rvs_cns = vds.getCodedNodeSetForValueSetDefinition(
new URI(vsd_uri),
valueSetDefinitionRevisionId,
csVersionList,
csVersionTag);
if (rvs_cns == null) return false;
CodedNodeSet cns = rvs_cns.getCodedNodeSet();
ConceptReference conceptReference = new ConceptReference();
conceptReference.setConceptCode(code);
if (codingScheme != null) {
conceptReference.setCodingSchemeName(codingScheme);
}
java.lang.Boolean bool_obj = cns.isCodeInSet(conceptReference);
return bool_obj;
} catch (Exception ex) {
ex.printStackTrace();
}
Boolean retval = null;
return retval;
}
示例11: matchesEntities
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public boolean matchesEntities(CodingScheme cs,
Set<EntityNameOrURI> entities) throws LBException {
if (entities == null || entities.isEmpty()) {
return true;
}
ConceptReferenceList conceptReferenceList = new ConceptReferenceList();
for (EntityNameOrURI entity : entities) {
if (entity.getEntityName() != null) {
ConceptReference conceptRef = new ConceptReference();
conceptRef.setCode(entity.getEntityName().getName());
conceptRef.setCodeNamespace(entity.getEntityName()
.getNamespace());
conceptReferenceList.addConceptReference(conceptRef);
}
}
CodingSchemeVersionOrTag version = Constructors
.createCodingSchemeVersionOrTagFromVersion(cs
.getRepresentsVersion());
CodedNodeSet cns = lexBIGService.getNodeSet(cs.getCodingSchemeURI(),
version, null).restrictToCodes(conceptReferenceList);
ResolvedConceptReferenceList rcrl = cns.resolveToList(null, null, null,
null, false, -1);
if (rcrl.getResolvedConceptReferenceCount() < 1) {
return false;
} else {
return true;
}
}
示例12: codes2CodedNodeSet
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public CodedNodeSet codes2CodedNodeSet() {
if (_codes == null) return null;
CodedNodeSet cns = null;
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (this._version != null)
csvt.setVersion(this._version);
try {
LexBIGService lbSvc = null;
lbSvc = new RemoteServerUtil().createLexBIGService();
LocalNameList entityTypes = new LocalNameList();
entityTypes.addEntry("concept");
cns = lbSvc.getNodeSet(this._vocabulary, csvt, entityTypes);
//ResolvedConceptReferencesIterator iterator = toIterator();
ConceptReferenceList codeList = new ConceptReferenceList();
String codes = _codes;
codes = codes.trim();
if (codes.compareTo("") == 0) {
return null;
}
String lines[] = codes.split("\\n");
for(int i = 0; i < lines.length; i++) {
String t = lines[i];
ConceptReference cr = new ConceptReference();
cr.setConceptCode(t);
codeList.addConceptReference(cr);
}
cns.restrictToCodes(codeList);
} catch (Exception ex) {
}
return cns;
}
示例13: getAssociatedConcepts
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
/**
* Returns Associated Concepts
*
* @param scheme
* @param version
* @param code
* @param assocName
* @param forward
* @return
*/
public Vector<Entity> getAssociatedConcepts(String scheme, String version,
String code, Vector<String> assocNames, boolean forward) {
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) csvt.setVersion(version);
boolean resolveForward = true;
boolean resolveBackward = false;
// Set backward direction
if (!forward) {
resolveForward = false;
resolveBackward = true;
}
Vector<Entity> v = new Vector<Entity>();
try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
// Restrict coded node graph to the given association
NameAndValueList nameAndValueList = createNameAndValueList(
assocNames, null);
cng = cng.restrictToAssociations(nameAndValueList, null);
ConceptReference graphFocus =
ConvenienceMethods.createConceptReference(code, scheme);
ResolvedConceptReferencesIterator iterator =
codedNodeGraph2CodedNodeSetIterator(cng, graphFocus,
resolveForward, resolveBackward, RESOLVEASSOCIATIONDEPTH,
MAXTORETURN);
v = resolveIterator(iterator, MAXTORETURN, code);
} catch (Exception ex) {
_logger.warn(ex.getMessage());
}
return v;
}
示例14: resolveOneHit
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
protected List<? extends ResolvedConceptReference> resolveOneHit(ResolvedConceptReference hit) throws LBException{
List<ResolvedConceptReference> returnList = new ArrayList<ResolvedConceptReference>();
CodingSchemeVersionOrTag tagOrVersion = new CodingSchemeVersionOrTag();
if (hit.getCodingSchemeVersion() != null) tagOrVersion.setVersion(hit.getCodingSchemeVersion());
CodedNodeGraph cng = null;
if (lbSvc == null) {
return null;
}
cng = lbSvc.getNodeGraph(
hit.getCodingSchemeName(),
tagOrVersion,
null);
Boolean restrictToAnonymous = Boolean.FALSE;
cng = cng.restrictToAnonymous(restrictToAnonymous);
LocalNameList localNameList = new LocalNameList();
localNameList.addEntry("concept");
cng = cng.restrictToEntityTypes(localNameList);
if (_associationNameAndValueList != null) {
cng =
cng.restrictToAssociations(
_associationNameAndValueList,
_associationQualifierNameAndValueList);
}
else {
String scheme = hit.getCodingSchemeName();
SimpleDataUtils simpleDataUtils = new SimpleDataUtils(lbSvc);
boolean isMapping = simpleDataUtils.isMapping(scheme, null);
if (isMapping) {
NameAndValueList navl = simpleDataUtils.getMappingAssociationNames(scheme, null);
if (navl != null) {
cng = cng.restrictToAssociations(navl, null);
}
}
}
ConceptReference focus = new ConceptReference();
focus.setCode(hit.getCode());
focus.setCodingSchemeName(hit.getCodingSchemeName());
focus.setCodeNamespace(hit.getCodeNamespace());
LocalNameList propertyNames = new LocalNameList();
CodedNodeSet.PropertyType[] propertyTypes = null;
SortOptionList sortCriteria = null;
ResolvedConceptReferenceList list =
cng.resolveAsList(focus,
_resolveForward, _resolveBackward, 0,
_resolveAssociationDepth, propertyNames, propertyTypes, sortCriteria,
_maxToReturn);
for(ResolvedConceptReference ref : list.getResolvedConceptReference()){
if (ref.getSourceOf() != null && this.getAssociations(ref.getSourceOf()).size() > 0) {
returnList.addAll(this.getAssociations(ref.getSourceOf()));
}
//if(ref.getSourceOf() != null){
// returnList.addAll(this.getAssociations(ref.getSourceOf()));
//}
if (ref.getTargetOf() != null && this.getAssociations(ref.getTargetOf()).size() > 0) {
returnList.addAll(this.getAssociations(ref.getTargetOf()));
}
//if(ref.getTargetOf() != null){
//returnList.addAll(this.getAssociations(ref.getTargetOf()));
//}
}
return returnList;
}
示例15: codedNodeGraph2CodedNodeSetIterator
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference; //导入依赖的package包/类
public ResolvedConceptReferencesIterator codedNodeGraph2CodedNodeSetIterator(
CodedNodeGraph cng,
ConceptReference graphFocus,
boolean resolveForward,
boolean resolveBackward,
int resolveAssociationDepth,
int maxToReturn) {
CodedNodeSet cns = null;
try {
cns = cng.toNodeList(graphFocus,
resolveForward,
resolveBackward,
resolveAssociationDepth,
maxToReturn);
if (cns == null)
{
_logger.warn("cng.toNodeList returns null???");
return null;
}
SortOptionList sortCriteria = null;
//Constructors.createSortOptionList(new String[]{"matchToQuery", "code"});
LocalNameList propertyNames = null;
CodedNodeSet.PropertyType[] propertyTypes = null;
ResolvedConceptReferencesIterator iterator = null;
try {
iterator = cns.resolve(sortCriteria, propertyNames, propertyTypes);
} catch (Exception e) {
e.printStackTrace();
}
if(iterator == null)
{
_logger.warn("cns.resolve returns null???");
}
return iterator;
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
}