top

Semantic Service Discovery

Published 2014-10-28 | (Compatible with SDK 4.5 and 2013 models)

The way to API using Service explorer

When a user inputs a keyword in Service Explorer, the Semantic Service Discovery function searches services semantically with keyword and its results are displayed. The results include 3 rd party web services and Samsung SDK Library APIs related to the given keyword.

Service Discovery

Service discovery function provides two types of search. They are semantic service search and keyword-based service search. For keyword-based service search, a user can specify the search condition with seven prefix types in the figure below

Figure: Web Services search screen

  1. A user can input keyword in Keyword text field.
  2. When the mouse cursor is moved over the Keyword label or input field, help about the keyword input information (No. 1 ~ 8) is popped-up in Service Explorer. The help menu shows the one Semantic service search (No. 1) and seven keyword-based service search methods (No.2 ~ 8). Semantic service search doesn’t need any prefix.
  3. Before performing Semantic service search with a keyword, a user can adjust levels of semantic search. The level of semantic search is a search option that signifies relevance score of the discovered services in the result table. The relevance score is computed basically by Apache Lucene’s scoring which combines Boolean model (BM) of Information Retrieval with Vector Space Model (VSM) of Information Retrieval. The selection of the first level (score: 0.1) will display the results which have scores over 0.1. In the second level, the results over 0.2 score will be shown in the result table. With the highest level, only services over score 0.5 are delivered as search result. The higher the level is, the less result is shown.
  4. When a user inputs a keyword and presses Enter, the results are displayed in the result tables of Samsung API and External API, respectively.

Utilities

Useful capabilities for convenient service search are suppored in Service Explorer. See below for more details.

Auto-completion of a keyword

When a user input a keyword, the keyword can be suggested automatically through the input keyword history. Then, the user can select one in keyword history.

Figure: Keyword auto-completion screen

The following section shows an example.

  1. Input a keyword.
  2. During input a keyword, a list of keywords that match the keyword from the input keyword history is shown. After that, a user can perform service search.

Search within results

In Service Explorer, a user can search again within the previous search results. It filters the first results with a new keyword specified in the Keyword field.

Figure: Search within results screen

The following section shows an example.

  1. Input a keyword:map and press Enter.
  2. A list of services that match map keyword is displayed in the result table.
  3. Click the checkbox button for Search within results.
  4. Input a new keyword get into a Keyword field.
  5. The filtered results that include a new keyword get among the previous results are displayed.

Getting service details

Whenever a user clicks a service in the result tables of the Samsung APIs and External APIs, the Properties View is filled with the service details.

Figure: Detailed service information output screen

The following section shows an example.

  1. Click a service in Service Explorer or Matching View.
  2. In Properties View, the detailed information of the selected service is retrieved.

Accessing service URL through the internal web browser

If a user double clicks the mouse on a service in the search results, the web URL of the selected service in the internal web browser (the default web browser in Eclipse) pops up. It is also possible to open web URL of the service by double-clicking usage_url in Properties View.

Figure: Web browser calling screen

The following section shows an example.

  1. Double click a service in Service Explorer or service_url in Properties View.
  2. The web URL of the selected service opens the internal web browser.

JSON Viewer

In the Properties View, the input and output values can be shown through JSON Viewer, which provides high readability.

Figure: The screen that shows the input/output item having the Json information

Figure: Pretty-print JSON Viewer screen

The following section shows an example.

  1. Double click the input or output fields in Properties View.
  2. JSON Viewer is opened and the input or output information is aligned in the form of JSON in the JSON Viewer.

A sample code snippet

A service API activated in black color on the search result table in Service Explorer has sample code snippet to invoke the API. If a user drags and drops the service API into the source code editor, the sample code snippet is automatically inserted. It is also available in the Matching View. A service API in gray color means that it has no sample code snippet.

Figure: Automatic sample code insertion screen

The following section shows an example.

  1. Move the cursor to the position where the sample code snippet will be inserted.
  2. Select a service API to be inserted and drag & drop it into the source code editor.
  3. The sample code snippet of the service API is inserted in the editor.

Exception Handling

If an exception occurs when Samsung SDK is connecting to semantic servers, error message is popped-up. The error message helps for a user to handle this exception.

Figure: Exception Handling