iKnow Web Services
InterSystems has deprecated InterSystems IRIS® Natural Language Processing (NLP). It may be removed from future versions of InterSystems products. The following documentation is provided as reference for existing users only. Existing users who would like assistance identifying an alternative solution should contact the WRCOpens in a new tab.
The %iKnow package provides web service classes that execute NLP queries. This chapter provides an overview of these classes and describes how to use them. It discusses the following topics:
In InterSystems IRIS, a web service runs within an InterSystems IRIS web application. In turn, the web application is served by your choice of web server (the same web server that serves the Management Portal).
Available Web Services
NLP provides the following web service classes:
-
%iKnow.Queries.CcWSAPIOpens in a new tab — provides web methods that you can use to get information about concept-concept (CC) pairs. These web methods are equivalent to the methods in the %iKnow.Queries.CcAPIOpens in a new tab class.
-
%iKnow.Queries.CrcWSAPIOpens in a new tab — provides web methods that you can use to get information about Concept-Relation-Concept (CRC) triples. These web methods are equivalent to the methods in the %iKnow.Queries.CrcAPIOpens in a new tab class.
-
%iKnow.Queries.EntityWSAPIOpens in a new tab — provides web methods that you can use to get information about entities. These web methods are equivalent to the methods in the %iKnow.Queries.EntityAPIOpens in a new tab class.
-
%iKnow.Queries.EquivWSAPIOpens in a new tab — provides web methods that you can use to manage equivalences. These web methods are equivalent to the methods in the %iKnow.Queries.EquivAPI class.
-
%iKnow.Queries.MetadataWSAPIOpens in a new tab — provides web methods that you can use to manage and get information about source metadata. These web methods are equivalent to the methods in the %iKnow.Queries.MetadataAPIOpens in a new tab class.
-
%iKnow.Queries.PathWSAPIOpens in a new tab — provides web methods that you can use to get information about paths. These web methods are equivalent to the methods in the %iKnow.Queries.PathAPIOpens in a new tab class.
-
%iKnow.Queries.SentenceWSAPIOpens in a new tab — provides web methods that you can use to get information about sentences. These web methods are equivalent to the methods in the %iKnow.Queries.SentenceAPIOpens in a new tab class.
-
%iKnow.Queries.SourceWSAPIOpens in a new tab — provides web methods that you can use to get information about sources. These web methods are equivalent to the methods in the %iKnow.Queries.SourceAPIOpens in a new tab class.
The %iKnow.Queries package also contains classes that the compiler generated when these classes were compiled. For example, when the compiler compiled the class %iKnow.Queries.CcWSAPIOpens in a new tab, it generated the classes in the %iKnow.Queries.CcWSAPIOpens in a new tab package. These generated classes are not intended for direct use.
Using an NLP Web Service
To use a web service, you create and use a web client that communicates with it. To do so for an NLP web service, you use the same procedure as with any other web service:
-
Create a web client that can communicate with the web service. Typically, to do so, you generate the web client using a tool provided by the client technology and you provide the WSDL of the web service as input. This process generates a set of client classes.
For an InterSystems IRIS® data platform web service, the WSDL is available at a specific URL. The URL has the following form, using the <baseURL> for your instance:
https://<baseurl>/csp/namespace/web_service_class.cls?WSDL
Where:
-
namespace is the namespace name.
-
web_service_class is the full package and class name of the web service with .cls at the end.
For example, for the class %iKnow.Queries.EntityWSAPIOpens in a new tab, use %25iKnow.Queries.EntityWSAPI.cls
Important:Be sure to replace the leading percent sign of the package with the URL escape sequence %25 as shown here.
For example:
https://devsys/csp/samples/%25iKnow.Queries.EntityWSAPI.cls?WSDL
-
-
Rather than editing the generated client classes, create an additional class or routine that uses them. The details depend on the technology.
In InterSystems IRIS, to use a web client, you create an instance of the web client class and then invoke its instance methods. See the following example.
Comparison of NLP Web Services with Primary NLP APIs
The primary NLP APIs use arguments that cannot be easily represented in SOAP messages, so the methods in NLP web services have different signatures than do the methods in the primary NLP APIs. In particular, note the following differences:
-
Instead of %Library.ListOpens in a new tab, the web services (and their clients) use %Library.ListOfDataTypesOpens in a new tab. This means that to build a list for a web service, you create an instance of %Library.ListOfDataTypesOpens in a new tab and then use its SetAt() method to add items. You cannot use list functions such as $LISTBUILD with this instance.
-
Instead of an instance of %iKnow.Filters.FilterOpens in a new tab, the web services (and their clients) use a string of the form returned by the ToString() method of that class.
-
For APIs that return complex results, rather than returning results by reference as a multidimensional array, the web services (and their clients) return an instance of %XML.DataSetOpens in a new tab.
Important:This structure is supported only in .NET and in InterSystems products. Other web technologies do not recognize this format.
See Also
For information on web services and clients in InterSystems IRIS, see Creating Web Services and Web Clients.