本文整理汇总了Java中org.LexGrid.commonTypes.EntityDescription类的典型用法代码示例。如果您正苦于以下问题:Java EntityDescription类的具体用法?Java EntityDescription怎么用?Java EntityDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityDescription类属于org.LexGrid.commonTypes包,在下文中一共展示了EntityDescription类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getCodeDescription
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
protected String getCodeDescription(String scheme,
CodingSchemeVersionOrTag csvt, String code) throws LBException {
CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);
cns =
cns.restrictToCodes(Constructors.createConceptReferenceList(code,
scheme));
ResolvedConceptReferenceList rcrl =
cns.resolveToList(null, _noopList, null, 1);
if (rcrl.getResolvedConceptReferenceCount() > 0) {
EntityDescription desc =
rcrl.getResolvedConceptReference(0).getEntityDescription();
if (desc != null)
return desc.getContent();
}
return "<Not assigned>";
}
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:18,代码来源:SourceTreeUtils.java
示例2: getTopNodes
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
public void getTopNodes(TreeItem ti, List list, int currLevel, int maxLevel) {
if (list == null)
list = new ArrayList();
if (currLevel > maxLevel)
return;
if (ti._assocToChildMap.keySet().size() > 0) {
if (ti._text.compareTo("Root node") != 0) {
ResolvedConceptReference rcr = new ResolvedConceptReference();
rcr.setConceptCode(ti._code);
EntityDescription entityDescription = new EntityDescription();
entityDescription.setContent(ti._text);
rcr.setEntityDescription(entityDescription);
list.add(rcr);
}
}
for (String association : ti._assocToChildMap.keySet()) {
List<TreeItem> children = ti._assocToChildMap.get(association);
Collections.sort(children);
for (TreeItem childItem : children) {
getTopNodes(childItem, list, currLevel + 1, maxLevel);
}
}
}
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:25,代码来源:SourceTreeUtils.java
示例3: getRandomResolvedConceptReference
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
public ResolvedConceptReference getRandomResolvedConceptReference(String source) {
SourceTreeUtils sourceTreeUtils = new SourceTreeUtils(lbSvc);
TreeItem ti = sourceTreeUtils.getSourceTree(source);
if (ti == null) return null;
if (!ti._expandable) {
return null;
}
Vector v = new Vector();
Iterator iterator = ti._assocToChildMap.keySet().iterator();
while (iterator.hasNext()) {
String assocText = (String) iterator.next();
List<TreeItem> children = ti._assocToChildMap.get(assocText);
for (int k=0; k<children.size(); k++) {
TreeItem child_ti = (TreeItem) children.get(k);
ResolvedConceptReference rcr = new ResolvedConceptReference();
EntityDescription ed = new EntityDescription();
ed.setContent(child_ti._text);
rcr.setEntityDescription(ed);
rcr.setCode(child_ti._code);
v.add(rcr);
}
}
if (v.size() == 0) return null;
int m = new RandomVariateGenerator().uniform(0, v.size()-1);
return (ResolvedConceptReference) v.elementAt(m);
}
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:27,代码来源:NCImUITestGenerator.java
示例4: getPathsFromRoot
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Resolves one or more paths from the hierarchy root to the given code
* through a list of connected associations defined by the hierarchy.
*/
protected AssociationList getPathsFromRoot(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
String scheme, CodingSchemeVersionOrTag csvt, String hierarchyID, String focusCode,
Map<String, EntityDescription> codesToDescriptions) throws LBException {
// Get paths from the focus code to the root from the
// convenience method. All paths are resolved. If only
// one path is required, it would be possible to use
// HierarchyPathResolveOption.ONE to reduce processing
// and improve overall performance.
AssociationList pathToRoot = lbscm.getHierarchyPathToRoot(scheme, csvt, null, focusCode, false,
HierarchyPathResolveOption.ALL, null);
// But for purposes of this example we need to display info
// in order coming from root direction. Process the paths to root
// recursively to reverse the order for processing ...
AssociationList pathFromRoot = new AssociationList();
for (int i = pathToRoot.getAssociationCount() - 1; i >= 0; i--)
reverseAssoc(lbsvc, lbscm, scheme, csvt, pathToRoot.getAssociation(i), pathFromRoot, codesToDescriptions);
return pathFromRoot;
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:26,代码来源:TreeUtils.java
示例5: testSimpleSearchUtilsByCode
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
@Test
public void testSimpleSearchUtilsByCode() throws Exception {
int m = 0;
String scheme = "HL7";
String version = "V3 R2.36";
System.out.println(scheme + " (" + version + ")");
String code = "10458:BRTH";
System.out.println("search by code: " + code);
int searchOption = SimpleSearchUtils.BY_CODE;
String matchText = code;
String matchAlgorithm = "exactMatch";
try {
ResolvedConceptReferencesIterator iterator = new SimpleSearchUtils(lbSvc).search(scheme, version,
matchText, searchOption, matchAlgorithm);
int numberRemaining = iterator.numberRemaining();
while (iterator.hasNext()) {
ResolvedConceptReference rcr = (ResolvedConceptReference) iterator.next();
if (rcr == null) {
System.out.println("rcr == null..");
} else {
EntityDescription ed = rcr.getEntityDescription();
String pt = "";
if (ed == null) {
System.out.println("EntityDescription is null");
} else {
pt = rcr.getEntityDescription().getContent();
}
System.out.println(pt + "(code: " + rcr.getCode() + ")");
}
}
} catch (Exception ex) {
ex.printStackTrace();
m++;
}
assertTrue(m == 0);
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:40,代码来源:TestSimpleSearchUtils.java
示例6: printFrom
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Display relations to the given code from other concepts.
*
* @param code
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
@SuppressWarnings("unchecked")
protected void printFrom(PrintWriter pw, String scheme, CodingSchemeVersionOrTag csvt, String code)
throws LBException {
pw.println("Pointed at by ...");
// Perform the query ...
ResolvedConceptReferenceList matches = lbSvc.getNodeGraph(scheme, csvt, null).resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme), false, true, 1, 1, new LocalNameList(), null,
null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
Enumeration<? extends ResolvedConceptReference> refEnum = matches.enumerateResolvedConceptReference();
while (refEnum.hasMoreElements()) {
ResolvedConceptReference ref = refEnum.nextElement();
AssociationList targetof = ref.getTargetOf();
if (targetof != null) {
Association[] associations = targetof.getAssociation();
for (int i = 0; i < associations.length; i++) {
Association assoc = associations[i];
pw.println("\t" + assoc.getAssociationName());
AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
for (int j = 0; j < acl.length; j++) {
AssociatedConcept ac = acl[j];
String rela = replaceAssociationNameByRela(ac, assoc.getAssociationName());
EntityDescription ed = ac.getEntityDescription();
pw.println("\t\t" + ac.getConceptCode() + "/"
+ (ed == null ? "**No Description**" : ed.getContent()) + " --> (" + rela + ") --> " + code);
}
}
}
}
}
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:49,代码来源:EntityExporter.java
示例7: printTo
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Display relations from the given code to other concepts.
*
* @param code
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
@SuppressWarnings("unchecked")
protected void printTo(PrintWriter pw, String scheme, CodingSchemeVersionOrTag csvt, String code)
throws LBException {
pw.println("Points to ...");
// Perform the query ...
ResolvedConceptReferenceList matches = lbSvc.getNodeGraph(scheme, csvt, null).resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme), true, false, 1, 1, new LocalNameList(), null,
null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
Enumeration<? extends ResolvedConceptReference> refEnum = matches.enumerateResolvedConceptReference();
while (refEnum.hasMoreElements()) {
ResolvedConceptReference ref = refEnum.nextElement();
AssociationList sourceof = ref.getSourceOf();
Association[] associations = sourceof.getAssociation();
for (int i = 0; i < associations.length; i++) {
Association assoc = associations[i];
pw.println("\t" + assoc.getAssociationName());
AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
for (int j = 0; j < acl.length; j++) {
AssociatedConcept ac = acl[j];
String rela = replaceAssociationNameByRela(ac, assoc.getAssociationName());
EntityDescription ed = ac.getEntityDescription();
pw.println("\t\t" + code + " --> (" + rela + ") --> " + ac.getConceptCode() + "/"
+ (ed == null ? "**No Description**" : ed.getContent()));
}
}
}
}
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:46,代码来源:EntityExporter.java
示例8: getCodeDescription
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Returns the entity description for the given code.
*/
protected String getCodeDescription(LexBIGService lbsvc, String scheme, CodingSchemeVersionOrTag csvt, String code)
throws LBException {
CodedNodeSet cns = lbsvc.getCodingSchemeConcepts(scheme, csvt);
cns = cns.restrictToCodes(Constructors.createConceptReferenceList(code, scheme));
ResolvedConceptReferenceList rcrl = cns.resolveToList(null, noopList_, null, 1);
if (rcrl.getResolvedConceptReferenceCount() > 0) {
EntityDescription desc = rcrl.getResolvedConceptReference(0).getEntityDescription();
if (desc != null)
return desc.getContent();
}
return "<Not assigned>";
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:17,代码来源:TreeUtils.java
示例9: compareTo
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Compare this ScoredTerm to another. Comparison is by score, using
* description text as tie-breaker ...
*/
public int compareTo(ScoredTerm st) {
float f = st.score - this.score;
if (f != 0)
return f > 0 ? 1 : 0;
EntityDescription ed1 = ref.getEntityDescription();
EntityDescription ed2 = st.ref.getEntityDescription();
String term1 = ed1 != null ? ed1.getContent() : "";
String term2 = ed2 != null ? ed2.getContent() : "";
return term1.compareTo(term2);
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:15,代码来源:ScoredTerm.java
示例10: printChainForNode
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Handles recursive display of hierarchy for an individual node,
* up to the maximum specified depth.
* @param lbscm
* @param scheme
* @param sab
* @param csvt
* @param ref
* @param currentDepth
* @param maxDepth
* @param assocName
* @throws LBException
*/
protected void printChainForNode(
LexBIGServiceConvenienceMethods lbscm,
String scheme,
String sab,
CodingSchemeVersionOrTag csvt,
ResolvedConceptReference ref,
int currentDepth,
int maxDepth,
String assocName) throws LBException
{
// Print the referenced node; indent based on current depth ...
StringBuffer indent = new StringBuffer();
for (int i = 0; i <= currentDepth; i++)
indent.append(" ");
String code = ref.getConceptCode();
EntityDescription desc = ref.getEntityDescription();
Util.displayMessage(new StringBuffer()
.append(indent)
.append(assocName != null ? (assocName+"->") : "")
.append(code).append(':').append(desc != null ? desc.getContent() : "")
.toString());
if (currentDepth < maxDepth) {
AssociationList aList = lbscm.getHierarchyLevelNext(
scheme, csvt, null, code, false,
ConvenienceMethods.createNameAndValueList(sab, "Source"));
for (int i = 0; i < aList.getAssociationCount(); i++) {
Association assoc = aList.getAssociation(i);
AssociatedConceptList acList = assoc.getAssociatedConcepts();
for (Iterator<AssociatedConcept> nodes = acList.iterateAssociatedConcept(); nodes.hasNext(); ) {
printChainForNode(lbscm, scheme, sab, csvt, nodes.next(), currentDepth + 1, maxDepth, assoc.getDirectionalName());
}
}
}
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:50,代码来源:ListHierarchyMetaBySource.java
示例11: printHierarchyBranch
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Handles recursive display of hierarchy for the given start node,
* up to the maximum specified depth.
* @param lbscm
* @param scheme
* @param csvt
* @param hierarchyID
* @param branchRoot
* @param currentDepth
* @param maxDepth
* @param assocName
* @throws LBException
*/
protected void printHierarchyBranch(
LexBIGServiceConvenienceMethods lbscm,
String scheme,
CodingSchemeVersionOrTag csvt,
String hierarchyID,
ResolvedConceptReference branchRoot,
int currentDepth,
int maxDepth,
String assocName) throws LBException
{
// Print the referenced node; indent based on current depth ...
StringBuffer indent = new StringBuffer();
for (int i = 0; i < currentDepth; i++)
indent.append(" ");
String code = branchRoot.getConceptCode();
EntityDescription desc = branchRoot.getEntityDescription();
Util.displayMessage(new StringBuffer()
.append(indent)
.append(assocName != null ? (assocName+"->") : "")
.append(code).append(':').append(desc != null ? desc.getContent() : "")
.toString());
// Print each association and recurse ...
if (currentDepth < maxDepth) {
AssociationList assocList = lbscm.getHierarchyLevelNext(scheme, csvt, hierarchyID, code, false, null);
if (assocList != null)
for (int i = 0; i < assocList.getAssociationCount(); i++) {
Association assoc = assocList.getAssociation(i);
AssociatedConceptList nodes = assoc.getAssociatedConcepts();
for (Iterator<AssociatedConcept> subsumed = nodes.iterateAssociatedConcept(); subsumed.hasNext(); ) {
printHierarchyBranch(lbscm, scheme, csvt, hierarchyID, subsumed.next(), currentDepth + 1, maxDepth, assoc.getDirectionalName());
}
}
}
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:50,代码来源:ListHierarchy.java
示例12: transformSummaryDescription
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
@Override
public MapCatalogEntrySummary transformSummaryDescription(CodingScheme codingScheme) {
if(codingScheme == null){
return null;
}
MapCatalogEntrySummary mapCatalogEntrySummary = new MapCatalogEntrySummary();
mapCatalogEntrySummary.setAbout(
this.getUriHandler().getCodeSystemUri(codingScheme)
);
String mapName = codingScheme.getCodingSchemeName();
mapCatalogEntrySummary.setMapName(mapName);
mapCatalogEntrySummary.setHref(this.getUrlConstructor().createMapUrl(mapName));
mapCatalogEntrySummary.setFormalName(codingScheme.getFormalName());
EntityDescription entityDescription = codingScheme.getEntityDescription();
if(entityDescription != null){
EntryDescription description = new EntryDescription();
description.setValue(ModelUtils.toTsAnyType(entityDescription.getContent()));
mapCatalogEntrySummary.setResourceSynopsis(description);
}
Tuple<CodeSystemReference> fromAndTo = this.getFromToCodingSchemes(codingScheme);
mapCatalogEntrySummary.setFromCodeSystem(fromAndTo.getOne());
mapCatalogEntrySummary.setToCodeSystem(fromAndTo.getTwo());
return mapCatalogEntrySummary;
}
开发者ID:NCIP,项目名称:lexevs-service,代码行数:33,代码来源:CodingSchemeToMapTransform.java
示例13: setProperty
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
public void setProperty(CodingSchemeSummary codingSchemeSummary, int schemeIndex, ComponentReference property) {
if(property.equals(RESOURCE_SYNOPSIS_REF)){
EntityDescription codingSchemeDescription = new EntityDescription();
codingSchemeDescription.setContent(this.getScheme_DataField(schemeIndex, DataField.RESOURCE_SYNOPSIS));
codingSchemeSummary.setCodingSchemeDescription(codingSchemeDescription);
}
else if(property.equals(ABOUT_REF)){
codingSchemeSummary.setCodingSchemeURI(this.getScheme_DataField(schemeIndex, DataField.ABOUT));
}
else if(property.equals(RESOURCE_NAME_REF)){
codingSchemeSummary.setLocalName(this.getScheme_DataField(schemeIndex, DataField.RESOURCE_LOCALNAME));
codingSchemeSummary.setRepresentsVersion(this.getScheme_DataField(schemeIndex, DataField.RESOURCE_VERSION));
}
}
开发者ID:NCIP,项目名称:lexevs-service,代码行数:15,代码来源:FakeLexEvsData.java
示例14: printTo
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
protected static void printTo(String code, String relation, LexBIGService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException
{
System.out.println("Points to ...");
// Perform the query ...
NameAndValue nv = new NameAndValue();
NameAndValueList nvList = new NameAndValueList();
nv.setName(relation);
nvList.addNameAndValue(nv);
ResolvedConceptReferenceList matches =
lbSvc.getNodeGraph(scheme, csvt, null)
.restrictToAssociations(nvList, null)
.resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme),
true, false, 1, 1, new LocalNameList(), null, null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
ResolvedConceptReference ref =
(ResolvedConceptReference) matches.enumerateResolvedConceptReference().nextElement();
// Print the associations
AssociationList sourceof = ref.getSourceOf();
Association[] associations = sourceof.getAssociation();
for (int i = 0; i < associations.length; i++) {
Association assoc = associations[i];
AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
for (int j = 0; j < acl.length; j++) {
AssociatedConcept ac = acl[j];
EntityDescription ed = ac.getEntityDescription();
System.out.println(
"\t\t" + ac.getConceptCode() + "/"
+ (ed == null?
"**No Description**":ed.getContent()));
}
}
}
}
开发者ID:NCIP,项目名称:camod,代码行数:41,代码来源:PrintUtility.java
示例15: createRootNode
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
protected DefaultMutableTreeNode createRootNode(ResolvedConceptReference rootCode){
Concept concept = new Concept();
concept.setEntityCode(rootCode.getConceptCode());
EntityDescription ed = new EntityDescription();
ed.setContent(rootCode.getEntityDescription().getContent());
concept.setEntityDescription(ed);
TreeNode childNode = new TreeNode();
childNode.setConcept(concept);
DefaultMutableTreeNode tree = new DefaultMutableTreeNode(childNode);
//System.out.println("createRootNode - created root node. " );
return tree;
}
开发者ID:NCIP,项目名称:camod,代码行数:14,代码来源:RecursiveTreeBuilder.java
示例16: getSourceHierarchyRoots
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
public List getSourceHierarchyRoots(String scheme,
CodingSchemeVersionOrTag csvt, String sab) throws LBException {
try {
CodingScheme cs = lbSvc.resolveCodingScheme(scheme, csvt);
if (cs == null)
return null;
Mappings mappings = cs.getMappings();
SupportedHierarchy[] hierarchies = mappings.getSupportedHierarchy();
if (hierarchies == null || hierarchies.length == 0)
return null;
// SupportedHierarchy hierarchyDefn = hierarchies[0];
//String hier_id = hierarchyDefn.getLocalId();
/*
String[] associationsToNavigate =
hierarchyDefn.getAssociationNames();
boolean associationsNavigatedFwd =
hierarchyDefn.getIsForwardNavigable();
*/
// String code = "C1140168";
ResolvedConceptReference SRC_root =
getRootInSRC(scheme, csvt.getVersion(), sab);
String rootName =
SRC_root.getReferencedEntry().getEntityDescription()
.getContent();
String rootCode = SRC_root.getCode();
_logger.debug("Searching for roots in " + sab + " under -- "
+ rootName + " (CUI: " + rootCode + ")");
HashMap hmap = getChildren(rootCode, sab);
ArrayList list = new ArrayList();
TreeItem ti = (TreeItem) hmap.get(rootCode);
for (String assoc : ti._assocToChildMap.keySet()) {
List<TreeItem> roots = ti._assocToChildMap.get(assoc);
for (int k = 0; k < roots.size(); k++) {
TreeItem root = roots.get(k);
ResolvedConceptReference rcr =
new ResolvedConceptReference();
EntityDescription desc = new EntityDescription();
desc.setContent(root._text);
rcr.setEntityDescription(desc);
rcr.setCode(root._code);
list.add(rcr);
}
}
SortUtils.quickSort(list);
return list;
} catch (Exception ex) {
}
return new ArrayList();
}
开发者ID:NCIP,项目名称:nci-metathesaurus-browser,代码行数:56,代码来源:SourceTreeUtils.java
示例17: printFrom
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Display relations to the given code from other concepts.
*
* @param code
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
@SuppressWarnings("unchecked")
protected void printFrom(PrintWriter pw, String code, LexBIGService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException {
displayMessage(pw, "\n\tPointed at by ...");
// Perform the query ...
ResolvedConceptReferenceList matches = lbSvc.getNodeGraph(scheme, csvt, null).resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme), false, true, 1, 1, new LocalNameList(), null,
null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
Enumeration<? extends ResolvedConceptReference> refEnum = matches.enumerateResolvedConceptReference();
while (refEnum.hasMoreElements()) {
ResolvedConceptReference ref = refEnum.nextElement();
AssociationList targetof = ref.getTargetOf();
if (targetof != null) {
if (targetof != null) {
Association[] associations = targetof.getAssociation();
if (associations != null && associations.length > 0) {
for (int i = 0; i < associations.length; i++) {
Association assoc = associations[i];
//displayMessage(pw, "\t" + assoc.getAssociationName());
AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
for (int j = 0; j < acl.length; j++) {
AssociatedConcept ac = acl[j];
String rela = replaceAssociationNameByRela(ac, assoc.getAssociationName());
EntityDescription ed = ac.getEntityDescription();
displayMessage(pw, "\t\t" + ac.getConceptCode() + "/"
+ (ed == null ? "**No Description**" : ed.getContent()) + " --> (" + rela + ") --> " + code);
if (ac.getAssociationQualifiers() != null && ac.getAssociationQualifiers().getNameAndValue() != null) {
for(NameAndValue nv: ac.getAssociationQualifiers().getNameAndValue()){
displayMessage(pw, "\t\t\tAssoc Qualifier - " + nv.getName() + ": " + nv.getContent());
displayMessage(pw, "\n");
}
}
}
}
}
}
}
}
}
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:59,代码来源:PropsAndAssocForCode.java
示例18: printTo
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* Display relations from the given code to other concepts.
*
* @param code
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
@SuppressWarnings("unchecked")
protected void printTo(PrintWriter pw, String code, LexBIGService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException {
displayMessage(pw, "\n\tPoints to ...");
// Perform the query ...
ResolvedConceptReferenceList matches = lbSvc.getNodeGraph(scheme, csvt, null).resolveAsList(
ConvenienceMethods.createConceptReference(code, scheme), true, false, 1, 1, new LocalNameList(), null,
null, 1024);
// Analyze the result ...
if (matches.getResolvedConceptReferenceCount() > 0) {
Enumeration<? extends ResolvedConceptReference> refEnum = matches.enumerateResolvedConceptReference();
while (refEnum.hasMoreElements()) {
ResolvedConceptReference ref = refEnum.nextElement();
AssociationList sourceof = ref.getSourceOf();
if (sourceof != null) {
Association[] associations = sourceof.getAssociation();
if (associations != null && associations.length > 0) {
for (int i = 0; i < associations.length; i++) {
Association assoc = associations[i];
//displayMessage(pw, "\t" + assoc.getAssociationName());
AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
for (int j = 0; j < acl.length; j++) {
AssociatedConcept ac = acl[j];
String rela = replaceAssociationNameByRela(ac, assoc.getAssociationName());
EntityDescription ed = ac.getEntityDescription();
displayMessage(pw, "\t\t" + code + " --> (" + rela + ") --> " + ac.getConceptCode() + "/"
+ (ed == null ? "**No Description**" : ed.getContent()));
if (ac.getAssociationQualifiers() != null && ac.getAssociationQualifiers().getNameAndValue() != null) {
for(NameAndValue nv: ac.getAssociationQualifiers().getNameAndValue()){
displayMessage(pw, "\t\t\tAssoc Qualifier - " + nv.getName() + ": " + nv.getContent());
displayMessage(pw, "\n");
}
}
}
}
}
}
}
}
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:58,代码来源:PropsAndAssocForCode.java
示例19: getTreePathData
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
public HashMap getTreePathData(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,
CodingSchemeVersionOrTag csvt, SupportedHierarchy hierarchyDefn, String focusCode) throws LBException {
HashMap hmap = new HashMap();
TreeItem ti = new TreeItem("<Root>", "Root node");
long ms = System.currentTimeMillis();
int pathsResolved = 0;
try {
// Resolve 'is_a' hierarchy info. This example will
// need to make some calls outside of what is covered
// by existing convenience methods, but we use the
// registered hierarchy to prevent need to hard code
// relationship and direction info used on lookup ...
String hierarchyID = hierarchyDefn.getLocalId();
String[] associationsToNavigate = hierarchyDefn.getAssociationIds();
boolean associationsNavigatedFwd = hierarchyDefn.getIsForwardNavigable();
// Identify the set of all codes on path from root
// to the focus code ...
Map<String, EntityDescription> codesToDescriptions = new HashMap<String, EntityDescription>();
AssociationList pathsFromRoot = getPathsFromRoot(lbsvc, lbscm, scheme, csvt, hierarchyID, focusCode,
codesToDescriptions);
// Typically there will be one path, but handle multiple just in
// case. Each path from root provides a 'backbone', from focus
// code to root, for additional nodes to hang off of in our
// printout. For every backbone node, one level of children is
// printed, along with an indication of whether those nodes can
// be expanded.
for (Iterator<Association> paths = pathsFromRoot.iterateAssociation(); paths.hasNext();) {
addPathFromRoot(ti, lbsvc, lbscm, scheme, csvt, paths.next(), associationsToNavigate, associationsNavigatedFwd,
codesToDescriptions);
pathsResolved++;
}
} finally {
_logger.debug("Run time (milliseconds): " + (System.currentTimeMillis() - ms) +
" to resolve " + pathsResolved + " paths from root.");
}
hmap.put(focusCode, ti);
// Print the result ..
return hmap;
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:47,代码来源:TreeUtils.java
示例20: addPathFromRoot
import org.LexGrid.commonTypes.EntityDescription; //导入依赖的package包/类
/**
* The given path represents a multi-tier association with associated
* concepts and targets. This method expands the association content
* and adds results to the given tree item, recursing as necessary to
* process each level in the path.
* <p>
* Nodes in the association acts as the backbone for the display.
* For each backbone node, additional children are resolved one level
* deep along with an indication of further expandability.
*/
protected void addPathFromRoot(TreeItem ti,
LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
String scheme, CodingSchemeVersionOrTag csvt,
Association path, String[] associationsToNavigate, boolean associationsNavigatedFwd,
Map<String, EntityDescription> codesToDescriptions)
throws LBException {
// First, add the branch point from the path ...
ConceptReference branchRoot = path.getAssociationReference();
String branchCode = branchRoot.getConceptCode();
String branchCodeDescription = codesToDescriptions.containsKey(branchCode) ? codesToDescriptions
.get(branchCode).getContent() : getCodeDescription(lbsvc, scheme, csvt, branchCode);
TreeItem branchPoint = new TreeItem(branchCode, branchCodeDescription);
String branchNavText = getDirectionalLabel(lbscm, scheme, csvt, path, associationsNavigatedFwd);
// Now process elements in the branch ...
AssociatedConceptList concepts = path.getAssociatedConcepts();
for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {
// Add all immediate leafs in the branch, and indication of
// sub-nodes. Do not process codes already in the backbone here;
// they will be printed in the recursive call ...
AssociatedConcept concept = concepts.getAssociatedConcept(i);
String code = concept.getConceptCode();
TreeItem branchItem = new TreeItem(code, getCodeDescription(concept));
branchPoint.addChild(branchNavText, branchItem);
addChildren(branchItem, lbsvc, lbscm, scheme, csvt, code, codesToDescriptions.keySet(),
associationsToNavigate, associationsNavigatedFwd);
// Recurse to process the remainder of the backbone ...
AssociationList nextLevel = concept.getSourceOf();
if (nextLevel != null) {
if (nextLevel.getAssociationCount() != 0) {
// More levels left to process ...
for (int j = 0; j < nextLevel.getAssociationCount(); j++)
addPathFromRoot(branchPoint, lbsvc, lbscm, scheme, csvt, nextLevel.getAssociation(j), associationsToNavigate,
associationsNavigatedFwd, codesToDescriptions);
} else {
// End of the line ...
// Always add immediate children ot the focus code.
addChildren(branchItem, lbsvc, lbscm, scheme,
csvt, concept.getConceptCode(), Collections.EMPTY_SET,
associationsToNavigate, associationsNavigatedFwd);
}
}
}
// Add the populated tree item to those tracked from root.
ti.addChild(branchNavText, branchPoint);
}
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:63,代码来源:TreeUtils.java
注:本文中的org.LexGrid.commonTypes.EntityDescription类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论