本文整理汇总了Java中org.LexGrid.LexBIG.Exceptions.LBException类的典型用法代码示例。如果您正苦于以下问题:Java LBException类的具体用法?Java LBException怎么用?Java LBException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LBException类属于org.LexGrid.LexBIG.Exceptions包,在下文中一共展示了LBException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: search
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public ResolvedConceptReferencesIterator search(
Vector<String> schemes, Vector<String> versions, String matchText, String algorithm, String target) throws LBException {
if (algorithm == null|| target == null) return null;
if (algorithm.compareToIgnoreCase(EXACT_MATCH) == 0 && target.compareToIgnoreCase(CODES) == 0) {
return search(schemes, versions, matchText, BY_CODE, "exactMatch");
} else if (algorithm.compareToIgnoreCase(LUCENE) == 0 && target.compareToIgnoreCase(CODES) == 0) {
return search(schemes, versions, matchText, BY_CODE, "exactMatch");
} else if (algorithm.compareToIgnoreCase(EXACT_MATCH) == 0 && target.compareToIgnoreCase(NAMES) == 0) {
return search(schemes, versions, matchText, BY_NAME, "exactMatch");
} else if (algorithm.compareToIgnoreCase(LUCENE) == 0 && target.compareToIgnoreCase(NAMES) == 0) {
return search(schemes, versions, matchText, BY_NAME, "lucene");
} else if (algorithm.compareToIgnoreCase(CONTAINS) == 0 && target.compareToIgnoreCase(NAMES) == 0) {
return search(schemes, versions, matchText, BY_NAME, "contains");
}
return null;
}
示例2: resolveConcepts
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
* Resolves matching concepts for any word in the given term.
* @param css The code system to search.
* @param matchWords The term to match.
* @return The list of matching references.
* @throws LBException
*/
protected ResolvedConceptReferencesIterator resolveConcepts(CodingSchemeSummary css, String query) throws LBException {
// Define a code set over the target terminology and
// restrict to concepts with matching text based on
// the provided term.
LexBIGService lbs = LexBIGServiceImpl.defaultInstance();
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
csvt.setVersion(css.getRepresentsVersion());
CodedNodeSet cns = lbs.getCodingSchemeConcepts(css.getLocalName(), csvt);
// Restrict the code set.
cns.restrictToMatchingDesignations(
query, SearchDesignationOption.ALL, MatchAlgorithms.LuceneQuery.name(), null);
// Resolve the concepts and assigned text.
ResolvedConceptReferencesIterator matches = cns.resolve(
ConvenienceMethods.createSortOptionList(new String[] {SortableProperties.code.name()}),
null, new PropertyType[] {PropertyType.PRESENTATION});
return matches;
}
示例3: doPage
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
@Override
protected List<? extends ResolvedConceptReference> doPage(
int position,
int pageSize) {
List<ResolvedConceptReference> returnList = new ArrayList<ResolvedConceptReference>();
try {
while(quickIterator.hasNext() && returnList.size() < pageSize){
returnList.addAll(this.resolveOneHit(quickIterator.next()));
}
} catch (LBException e) {
throw new RuntimeException(e);
}
return returnList;
}
示例4: getSupportedHierarchies
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的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();
}
示例5: getPathsFromRoot
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的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;
}
示例6: restrict
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public CodedNodeGraphDirectoryBuilder restrict(AssociationQueryServiceRestrictions restrictions){
if(restrictions != null &&
restrictions.getPredicate() != null &&
restrictions.getPredicate().getEntityName() != null &&
restrictions.getPredicate().getEntityName().getName() != null){
String predicateName = restrictions.getPredicate().getEntityName().getName();
try {
this.updateState(
this.getState().restrictToAssociations(Constructors.createNameAndValueList(predicateName), null));
} catch (LBException e) {
throw new RuntimeException(e);
}
}
return this;
}
示例7: getLexCodingScheme
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public static CodingScheme getLexCodingScheme(
LexBIGService lexBigService,
CodingSchemeRendering lexCodingSchemeRendering) {
CodingScheme lexCodingScheme = null;
String lexCodingSchemeName = null;
String lexVersion = null;
CodingSchemeVersionOrTag lexTagOrVersion = null;
try {
if(lexCodingSchemeRendering != null){
lexCodingSchemeName = lexCodingSchemeRendering.getCodingSchemeSummary().getCodingSchemeURI();
lexVersion = lexCodingSchemeRendering.getCodingSchemeSummary().getRepresentsVersion();
lexTagOrVersion = Constructors.createCodingSchemeVersionOrTagFromVersion(lexVersion);
}
lexCodingScheme = lexBigService.resolveCodingScheme(lexCodingSchemeName, lexTagOrVersion);
} catch (LBException e) {
throw new RuntimeException(e);
}
return lexCodingScheme;
}
示例8: createMockedResolveCodingScheme
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
private void createMockedResolveCodingScheme(LexBIGService lexBigService) throws LBException{
EasyMock.expect(lexBigService.resolveCodingScheme((String) EasyMock.anyObject(), (CodingSchemeVersionOrTag) EasyMock.anyObject())).andAnswer(
new IAnswer<CodingScheme>() {
@Override
public CodingScheme answer() throws Throwable {
String codingSchemeName = (String) EasyMock.getCurrentArguments()[0];
CodingSchemeVersionOrTag tagOrVersion = (CodingSchemeVersionOrTag) EasyMock.getCurrentArguments()[1];
CodingScheme codingScheme = new CodingScheme();
//TODO: Need to set the values with correct data
codingScheme.setCodingSchemeName(codingSchemeName);
codingScheme.setRepresentsVersion(tagOrVersion.getVersion());
codingScheme.setCodingSchemeURI("");
codingScheme.setFormalName("");
codingScheme.setLocalName(new String[0]);
return codingScheme;
}
}
).anyTimes();
}
示例9: run2
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run2() throws LBException {
_displayConcepts = Prompt.prompt("Display Concepts", _displayConcepts);
String codes[] = new String[] {
"C32221", "C38626", "C13043", "C32949", "C12275",
"C25763", "C34070", "C62484", "C34022",
"C13024", "C13091", "C32224",
};
for (int i=0; i<codes.length; ++i) {
if (i > 0) {
Util.displayMessage("");
Util.displayMessage(SEPARATOR);
}
process(codes[i]);
}
Util.displayMessage("Done");
}
示例10: numOfChildren
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
protected int numOfChildren(String code) throws LBException {
ResolvedConceptReferenceList list = getMatches(code, HAS_SUBTYPE, false);
if (list.getResolvedConceptReferenceCount() <= 0)
return 0;
ResolvedConceptReference ref = (ResolvedConceptReference)
list.enumerateResolvedConceptReference().nextElement();
AssociationList aList = ref.getSourceOf();
Association[] associations = aList.getAssociation();
int n = 0;
for (int i = 0; i < associations.length; i++) {
Association assoc = associations[i];
AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
n += acl.length;
}
return n;
}
示例11: run
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run()throws LBException{
if (_css == null)
return;
String word = "cell";
while (true) {
word = Prompt.prompt("Word (q to Quit)", word);
if (word.equalsIgnoreCase("q"))
break;
_displayConcepts = Prompt.prompt("Display Concepts", _displayConcepts);
process(word);
Util.displayMessage("");
Util.displayMessage(SEPARATOR);
}
Util.displayMessage("Quit");
}
示例12: run2
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run2() throws LBException {
String words[] = new String[] {
"cell", "blood"
};
_displayConcepts = Prompt.prompt("Display Concepts", _displayConcepts);
for (int i=0; i<words.length; ++i) {
if (i > 0) {
Util.displayMessage("");
Util.displayMessage(SEPARATOR);
}
Util.displayMessage("*** Keyword: " + words[i]);
process(words[i]);
}
Util.displayMessage("Done");
}
示例13: printChain
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
* Displays the given concept chain, taking into account any branches
* that might be imbedded.
* @param assoc
* @param depth
* @throws LBException
*/
protected void printChain(Association assoc, int depth) throws LBException {
StringBuffer indent = new StringBuffer();
for (int i = 0; i <= depth; i++)
indent.append(" ");
AssociatedConceptList concepts = assoc.getAssociatedConcepts();
for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {
// Print focus of this branch ...
AssociatedConcept concept = concepts.getAssociatedConcept(i);
Util.displayMessage(
new StringBuffer(indent)
.append(assoc.getAssociationName()).append("->")
.append(concept.getConceptCode()).append(':')
.append(concept.getEntityDescription() == null ? "NO DESCRIPTION" : concept.getEntityDescription().getContent())
.toString());
// Find and recurse printing for next batch ...
AssociationList nextLevel = concept.getSourceOf();
if (nextLevel != null && nextLevel.getAssociationCount() != 0)
for (int j = 0; j < nextLevel.getAssociationCount(); j++)
printChain(nextLevel.getAssociation(j), depth + 1);
}
}
示例14: run2
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run2() throws LBException {
int maxDepth = 3;
boolean displayConcepts = Prompt.prompt("Display Concepts", true);
String codes[] = new String[] {
"C32221", "C38626", "C13043", "C32949", "C12275",
"C25763", "C34070", "C62484", "C34022",
"C13024", "C13091", "C32224",
};
for (int i=0; i<codes.length; ++i) {
if (i > 0) {
Util.displayMessage("");
Util.displayMessage(SEPARATOR);
}
process(codes[i], maxDepth, displayConcepts);
}
Util.displayMessage("Done");
}
示例15: getConceptByCode
import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
* Get concept Entity by code
* @param codingScheme
* @param code
* @return
*/
public ResolvedConceptReference getConceptByCode(String codingScheme, String version,
String code) {
CodedNodeSet cns = null;
ResolvedConceptReferencesIterator iterator = null;
try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) csvt.setVersion(version);
cns = lbSvc.getCodingSchemeConcepts(codingScheme, csvt);
ConceptReferenceList crefs =
createConceptReferenceList(new String[] { code }, codingScheme);
cns.restrictToCodes(crefs);
iterator = cns.resolve(null, null, null);
if (iterator.numberRemaining() > 0) {
ResolvedConceptReference ref = (ResolvedConceptReference) iterator.next();
return ref;
}
} catch (LBException e) {
_logger.info("Error: " + e.getMessage());
}
return null;
}