NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

LexEVS provides a number of services which are retrievable through the LexBIGService interface and the LexEvsServiceLocator interface. We list here a small sample including the more commonly used interfaces.

LexBIGService
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

HistoryService
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();	

		try {

			HistoryService historSvc = lbsv.getHistoryService(codingScheme);<

		} catch (LBException e) {	

			e.printStackTrace();	

		}

LexBIGServiceManager
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
                //LexBIG Service Manager can accept credentials validation to
                //preserve service security.
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		
		try {
			
			LexBIGServiceManager svcManager = lbsv.getServiceManager(credentials);
			
		} catch (LBException e) {
			e.printStackTrace();
		}

LexEVSServiceMetaData
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
                // User safe service meta data query interface.
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		
		try {
			
			LexBIGServiceMetadata svcMetaData = lbsv.getServiceMetadata();
			
		} catch (LBException e) {
			e.printStackTrace();
		}

LexEvsServiceLocator
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

SystemResourceService
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
 // The system resource service is commonly wrapped in LexBIGServiceManager calls
 // and as such it prevents unauthorized users from removing coding schemes from the service.
 SystemResourceService systemResourceService = LexEvsServiceLocator.getInstance().getSystemResourceService();
        // must be marked as inactive or pending before delete.
        systemResourceService.removeCodingSchemeResourceFromSystem(
                codingSchemeVersionReference.getCodingSchemeURN(),
                codingSchemeVersionReference.getCodingSchemeVersion());

LexEvsIndexOperations
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Some index operations can be accomplished using the interface returned from the LexEvsServiceLocator.

...

Code Block
		boolean isSingleIndex = 
			LexEvsServiceLocator.getInstance().getSystemResourceService().getSystemVariables().getIsSingleIndex();
		
		if(! isSingleIndex) {
			throw new RuntimeException("Lucene Clean Up can only be executed in Single Index Mode.");
		}
		try {
			List<AbsoluteCodingSchemeVersionReference> expectedList = 
				new ArrayList<AbsoluteCodingSchemeVersionReference>();
			
			for(RegistryEntry entry :
				LexEvsServiceLocator.getInstance().getRegistry().getAllRegistryEntriesOfType(ResourceType.CODING_SCHEME)) {
				
				AbsoluteCodingSchemeVersionReference ref = new AbsoluteCodingSchemeVersionReference();
				ref.setCodingSchemeURN(entry.getResourceUri());
				ref.setCodingSchemeVersion(entry.getResourceVersion());
				
				expectedList.add(ref);
			}
			
			LexEvsServiceLocator.getInstance().getLexEvsIndexOperations().cleanUp(expectedList, reindexMissing);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

EntityIndexService
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Others operations require using the IndexServiceManager to retrieve a more specific index service

...

We've shown how the LexBIGService interface can retrieve other services, but it also provides some user safe administrative functions. These functions provide users with information about the service and overlap general user API functions, since they give users information about how to use the service.

Getting Filter Extensions
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
        // LexEVS has no built-in filter extensions. This method call
        // will only return filters users have created themselves.
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		Enumeration<? extends ExtensionDescription> extDesc = lbsv.getFilterExtensions().enumerateExtensionDescription();
		while(extDesc.hasMoreElements()){
			System.out.println(extDesc.nextElement().getName());
		}

Getting Sort Algorithms
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		Enumeration<? extends SortDescription> sortDesc = lbsv.getSortAlgorithms(null).enumerateSortDescription();
		while(sortDesc.hasMoreElements()){
			System.out.println(sortDesc.nextElement().getName());
		}

Getting Match Algorithms
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
	LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		Enumeration<? extends ModuleDescription> modDesc = lbsv.getMatchAlgorithms().enumerateModuleDescription();
		while(modDesc.hasMoreElements()){
			System.out.println(modDesc.nextElement().getName());
		}

...

Code Block
 SpellingErrorTolerantSubStringSearch
 StemmedLuceneQuery
 literalContains
 startsWith
 nonLeadingWildcardLiteralSubString
 literal
 WeightedDoubleMetaphoneLuceneQuery
 literalSubString
 DoubleMetaphoneLuceneQuery
 RegExp

Getting Generic Extensions
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		Enumeration<? extends ExtensionDescription> extDesc = lbsv.getGenericExtensions().enumerateExtensionDescription();
		while(extDesc.hasMoreElements()){
			System.out.println(extDesc.nextElement().getName());

		}

...

Code Block
 SupplementExtension
 LexBIGServiceConvenienceMethods
 ApproxNumOfConceptsPostProcessor
 MappingExtension
 SupportedAttributePostProcessor
 OntologyFormatAddingPostProcessor

Getting Service Information on all Schemes
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		try {
			CodingSchemeRenderingList schemes = lbsv.getSupportedCodingSchemes();
            for (CodingSchemeRendering csr : schemes.getCodingSchemeRendering()) {
                // Separator ...
                System.out.println("=============================");
                CodingSchemeSummary css = csr.getCodingSchemeSummary();
                CodingScheme cs = lbsv.resolveCodingScheme(css.getCodingSchemeURI(), Constructors
                        .createCodingSchemeVersionOrTagFromVersion(css.getRepresentsVersion()));
                System.out.println(ObjectToString.toString(cs, "", 80));}

		} catch (LBException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

...

Code Block
 CodingScheme
    Name: MDR12_1_TO_CST95
    Formal Name: MDR12_1_TO_CST95
    URI: urn:oid:CL413321.MDR.CST
    Approximate Number of Concepts: 0
    Default Language: null
    Represents Version: 200909
    Local Names:
        Array of 1 items:
            MDR12_1_TO_CST95
    Mappings:
        MappingsSupportedAssociations:
                Array of 1 items:
                    SupportedAssociation
                        Local ID: mapped_to
                        Content: mapped_to
                        AssociationEntity CodingScheme: null
                        AssociationEntity EntityCodeNamespace: null
                        AssociationEntity EntityCode: null
            SupportedCodingSchemes: ...................................................

Getting Single Coding Scheme Information
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
	public void run(){
		String codingScheme = "amino-acid.owl";	
		CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
		versionOrTag.setVersion("1.2");
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		try {
			CodingScheme cs = lbsv.resolveCodingScheme(codingScheme, versionOrTag );
            System.out.println(ObjectToString.toString(cs, "", 80));

		} catch (LBException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

Output same as preceding but for designated coding scheme only.

Getting a Coding Scheme's Copyright Content
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code Block
		String codingScheme = "amino-acid.owl";	
		CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
		versionOrTag.setVersion("1.2");
		LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
		try {
			String cpywrt = lbsv.resolveCodingSchemeCopyright(codingScheme, versionOrTag);
            System.out.println(cpywrt);

		} catch (LBException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

Output is unformatted text

LexBIGService Manager Methods
Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

These methods are generally not end user safe or access information in the system that is administrator specific in context. In general it should not be exposed to the end user.

...