本文整理汇总了Java中org.LexGrid.LexBIG.Utility.Constructors.createConceptReference方法的典型用法代码示例。如果您正苦于以下问题:Java Constructors.createConceptReference方法的具体用法?Java Constructors.createConceptReference怎么用?Java Constructors.createConceptReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.LexGrid.LexBIG.Utility.Constructors
的用法示例。
在下文中一共展示了Constructors.createConceptReference方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addChildren
import org.LexGrid.LexBIG.Utility.Constructors; //导入方法依赖的package包/类
/**
* Populate child nodes for a single branch of the tree,
* and indicates whether further expansion (to grandchildren)
* is possible.
*/
protected void addChildren(TreeItem ti,
LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
String scheme, CodingSchemeVersionOrTag csvt,
String branchRootCode, Set<String> codesToExclude, String[] associationsToNavigate,
boolean associationsNavigatedFwd)
throws LBException {
// Resolve the next branch, representing children of the given
// code, navigated according to the provided relationship and
// direction. Resolve the children as a code graph, looking 2
// levels deep but leaving the final level unresolved.
CodedNodeGraph cng = lbsvc.getNodeGraph(scheme, csvt, null);
ConceptReference focus = Constructors.createConceptReference(branchRootCode, scheme);
cng = cng.restrictToAssociations(Constructors.createNameAndValueList(associationsToNavigate), null);
/*
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
// to be reversed after loading the patch
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);
// The resolved branch will be represented by the first node in
// the resolved list. The node will be subdivided by source or
// target associations (depending on direction). The associated
// nodes define the children.
for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
ResolvedConceptReference node = nodes.next();
AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();
// Process each association defining children ...
for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
Association child = pathsToChildren.next();
String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);
// Each association may have multiple children ...
AssociatedConceptList branchItemList = child.getAssociatedConcepts();
for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
.hasNext();) {
AssociatedConcept branchItemNode = branchNodes.next();
String branchItemCode = branchItemNode.getConceptCode();
// Add here if not in the list of excluded codes.
// This is also where we look to see if another level
// was indicated to be available. If so, mark the
// entry with a '+' to indicate it can be expanded.
if (!codesToExclude.contains(branchItemCode)) {
TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
AssociationList grandchildBranch =
associationsNavigatedFwd
? branchItemNode.getSourceOf()
: branchItemNode.getTargetOf();
if (grandchildBranch != null)
childItem.expandable = true;
ti.addChild(childNavText, childItem);
}
}
}
}
}
示例2: getAssociationTargets
import org.LexGrid.LexBIG.Utility.Constructors; //导入方法依赖的package包/类
public HashMap getAssociationTargets(String scheme, String version, String code, String assocName)
{
HashMap hmap = new HashMap();
TreeItem ti = null;
long ms = System.currentTimeMillis();
Util.StopWatch stopWatch = new Util.StopWatch(); //DYEE
Set<String> codesToExclude = Collections.EMPTY_SET;
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();
LexBIGServiceConvenienceMethods lbscm = (LexBIGServiceConvenienceMethods) lbSvc
.getGenericExtension("LexBIGServiceConvenienceMethods");
lbscm.setLexBIGService(lbSvc);
String name = getCodeDescription(lbSvc, scheme, csvt, code);
ti = new TreeItem(code, name);
ti.expandable = false;
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
ConceptReference focus = Constructors.createConceptReference(code, scheme);
cng = cng.restrictToAssociations(Constructors.createNameAndValueList(assocName), null);
boolean associationsNavigatedFwd = true;
/*
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);
for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
ResolvedConceptReference node = nodes.next();
AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();
// Process each association defining children ...
for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
Association child = pathsToChildren.next();
String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);
// Each association may have multiple children ...
AssociatedConceptList branchItemList = child.getAssociatedConcepts();
for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
.hasNext();) {
AssociatedConcept branchItemNode = branchNodes.next();
String branchItemCode = branchItemNode.getConceptCode();
// Add here if not in the list of excluded codes.
// This is also where we look to see if another level
// was indicated to be available. If so, mark the
// entry with a '+' to indicate it can be expanded.
if (!codesToExclude.contains(branchItemCode)) {
TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
ti.expandable = true;
AssociationList grandchildBranch =
associationsNavigatedFwd
? branchItemNode.getSourceOf()
: branchItemNode.getTargetOf();
if (grandchildBranch != null)
childItem.expandable = true;
ti.addChild(childNavText, childItem);
}
}
}
}
hmap.put(code, ti);
} catch (Exception ex) {
ex.printStackTrace();
}
_logger.debug("Run time (milliseconds) getSubconcepts: " + (System.currentTimeMillis() - ms) + " to resolve " );
_logger.debug("DYEE: getSubconcepts: " + stopWatch.getResult() + " to resolve " );
return hmap;
}
示例3: addChildren
import org.LexGrid.LexBIG.Utility.Constructors; //导入方法依赖的package包/类
/**
* Populate child nodes for a single branch of the tree,
* and indicates whether further expansion (to grandchildren)
* is possible.
*/
protected void addChildren(TreeItem ti,
LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
String scheme, CodingSchemeVersionOrTag csvt,
String branchRootCode, Set<String> codesToExclude, String[] associationsToNavigate,
boolean associationsNavigatedFwd)
throws LBException {
// Resolve the next branch, representing children of the given
// code, navigated according to the provided relationship and
// direction. Resolve the children as a code graph, looking 2
// levels deep but leaving the final level unresolved.
CodedNodeGraph cng = lbsvc.getNodeGraph(scheme, csvt, null);
ConceptReference focus = Constructors.createConceptReference(branchRootCode, scheme);
cng = cng.restrictToAssociations(Constructors.createNameAndValueList(associationsToNavigate), null);
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
// The resolved branch will be represented by the first node in
// the resolved list. The node will be subdivided by source or
// target associations (depending on direction). The associated
// nodes define the children.
for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
ResolvedConceptReference node = nodes.next();
AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();
// Process each association defining children ...
for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
Association child = pathsToChildren.next();
String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);
// Each association may have multiple children ...
AssociatedConceptList branchItemList = child.getAssociatedConcepts();
for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
.hasNext();) {
AssociatedConcept branchItemNode = branchNodes.next();
String branchItemCode = branchItemNode.getConceptCode();
// Add here if not in the list of excluded codes.
// This is also where we look to see if another level
// was indicated to be available. If so, mark the
// entry with a '+' to indicate it can be expanded.
if (!codesToExclude.contains(branchItemCode)) {
TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
AssociationList grandchildBranch =
associationsNavigatedFwd
? branchItemNode.getSourceOf()
: branchItemNode.getTargetOf();
if (grandchildBranch != null)
childItem.expandable = true;
ti.addChild(childNavText, childItem);
}
}
}
}
}
示例4: getResourceSummaries
import org.LexGrid.LexBIG.Utility.Constructors; //导入方法依赖的package包/类
@Override
public DirectoryResult<AssociationDirectoryEntry> getResourceSummaries(
AssociationQuery query, SortCriteria sortCriteria, Page page) {
if(! this.validateQuery(query)){
throw new UnsupportedOperationException();
}
AssociationQueryServiceRestrictions restrictions = query.getRestrictions();
NameOrURI codeSystemVersion = restrictions.getCodeSystemVersion();
NameVersionPair versionName = this.nameConverter.fromCts2VersionName(codeSystemVersion.getName());
EntityNameOrURI focus;
Direction direction;
if(restrictions.getSourceEntity() != null){
direction = Direction.SOURCEOF;
focus = restrictions.getSourceEntity();
} else {
direction = Direction.TARGETOF;
focus = restrictions.getTargetEntity();
}
CodedNodeGraph initialState;
try {
initialState =
this.getLexBigService().getNodeGraph(
versionName.getName(),
Constructors.createCodingSchemeVersionOrTagFromVersion(versionName.getVersion()),
null);
} catch (LBException e) {
throw new RuntimeException(e);
}
ConceptReference ref =
Constructors.createConceptReference(
focus.getEntityName().getName(),
this.codingSchemeNameTranslator.translateToLexGrid(focus.getEntityName().getNamespace()),
null);
DirectoryBuilder<AssociationDirectoryEntry> builder =
new CodedNodeGraphDirectoryBuilder(
initialState,
new CodedNodeGraphCallback(ref, direction),
null,
null).
restrict(restrictions).
addStart(page.getStart()).
addMaxToReturn(page.getMaxToReturn());
return builder.resolve();
}