Page 128 - JOURNAL OF LIBRARY SCIENCE IN CHINA 2018 Vol. 42
P. 128

OU Shiyan, TANG Zhengui & SU Feifei / Construction and usage of terminology services for information retrieval  127


               basic terminology services (see Table 1) considering the actual situation of Chinese Thesaurus.
               These services can be combined further to form more complex terminology services.


               Table 1. The basic terminology services built in this study
                No.   Terminology Service   Function             Input             Output
                   searchConceptByKeyword Search the concepts that
                 1                                       Text string,e.g., “camera”
                   (String keyword)   match the input keyword
                   getBroaderConcept(String Get the broader concepts of Text string,e.g.,“X-ray
                 2                                                          The URL, preferred labels,
                   keyword)           the input term     diffraction camera”
                   getNarrowerConcept(String Get the narrower concepts of   or alternative labels of the
                 3                                       Text string,e.g.,“camera”  returned concept
                   keyword)           the input term
                   getRelatedConcept(String Get the related concepts of Text string,e.g., “X-ray
                 4
                   keyword)           the input term     diffraction camera”
                   getSynonym(String key- Get the synonyms of the input Text string,e.g., “X-ray Synonyms in the same lang-
                 5
                   word)              term               goniometer”        uage(text string)
                   getEnglishTranslation  Get the Engligh translations Text string,e.g., “X-ray Corresponding English
                 6
                   (String keyword)   of the input term  goniometer”        translations(text string)

                 Figure 2 shows the programming code of using Jersey to implement terminology services by
               taking the “searchConceptByKeyword” service as an example. Firstly, a terminology service
               resource class is defined with the method of Java Annotation, e.g., “TermServices”. Herein,
               @Path defines the path of the terminology service resource class (i.e. root URI), e.g. <http://
               host:port/rest/termservices>; @Produces annotates the MIME type responded by the terminology
               service, e.g. “application/json”; @Consumes defines the MIME type of the request that can
               be accepted by the terminology service, e.g. “text/plain”. In this resource class, different
               terminology service methods are continually defined, e.g. “searchConceptByKeyword”. @Path
               of this method is combined with the root path to form the path of the sub-resource, e.g. <http://
               host:port/rest/termservices/searchConceptByKeyword>; @GET refers to the HTTP GET method
               which can be responded by the method. Different terminology service methods use different
               SPARQL queries to get corresponding information from the vocabulary through the port of the
               Fuseki server.
                 While accessing the sever-side data in different domains using AJAX  requests, the AJAX
                                                                            ①a
               cross-domain issue arises. This issue is caused because of the homologous strategy in the security
               restriction of the JavaScript language. To allow AJAX clients in different domains to call RESTful
               Web services, the cross-domain issue should be solved. We realized the cross-domain call of
               RESTful Web services by modifying the response code of the AJAX client on the server side.
               Jersey provides the javax.ws.rs.core. Response class to modify different fields of the HTTP
               Response HEADER. The ok method of the Response class creates a Response Builder instance
               by modifying the HEADER parameters through the header method of the Response Build object.

               ①a AJAX stands for Asynchronous JavaScript and XML, which can update a web page without reloading the whole page.
   123   124   125   126   127   128   129   130   131   132   133