0% found this document useful (0 votes)
6 views

CloudComputing_Chapter3_Lecture1

The document discusses REST architecture, which is an architectural style for web services that facilitates communication between systems using standard HTTP methods. It explains the characteristics and constraints of REST, including its stateless nature and the use of URIs for resource identification. Additionally, it covers IBM Watson, an AI product that provides various services such as chatbots, natural language processing, and visual recognition, highlighting its applications in healthcare and data analysis.

Uploaded by

dawasthi952
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

CloudComputing_Chapter3_Lecture1

The document discusses REST architecture, which is an architectural style for web services that facilitates communication between systems using standard HTTP methods. It explains the characteristics and constraints of REST, including its stateless nature and the use of URIs for resource identification. Additionally, it covers IBM Watson, an AI product that provides various services such as chatbots, natural language processing, and visual recognition, highlighting its applications in healthcare and data analysis.

Uploaded by

dawasthi952
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Rest architecture and Watson API’s

REST:
REST, or Representational State Transfer, is an architectural style for providing standards between computer systems on the
web, making it easier for systems to communicate with each other.
REST is a way to access resources which lie in a particular environment. For example, you could have a server that could be
hosting important documents or pictures or videos. All of these are an example of resources. ... Now REST defines a way on
how these resources can be accessed.
REST stands for Representational State Transfer, a term coined by Roy Fielding in 2000. It is an architecture style for
designing loosely coupled applications over HTTP, that is often used in the development of webservices
A RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POSTand DELETE data. An
API for a website is code that allows two software programs to communicate with each other.
A REST API works in a similar way. You search for something, and you get a list of results back from the service you're
requesting from. ... The developer creates the API on the server and allows the client to talk to it. REST determines how
the API looks like. It stands for “Representational State Transfer”.
Representational state transfer (REST) is a software architectural style that defines a set of constraints to be used for creating
Web services. ... In a RESTful Web service, requests made to a resource's URI will elicit a response with a payload formatted
in HTML, XML, JSON, or some other format.
What is difference between REST API and Microservices?
MicroServices can be implement using REST style, an architecture which defines that overall solution (application, product)
should be split into multiple services, that interact with each other. microservices is more about architecture whereas
a RESTful API focuses more on how to expose those microservices.

REST stands for REpresentational State Transfer. It means when a RESTful API is called, the server will transfer tothe
client a representation of the state of the requestedresource.
An API (Application Programming Interface) is a software-to-software interface that enables two applications to exchange
data among each other. Though this might sound a little boring, they are used a lot in the real world to create some amazing
applications.

REST is a type of API. Not all APIs are REST, but all REST services are APIs.
API is a very broad term. Generally it's how one piece of code talks to another. In web development API often refers to the
way in which we retrieve information from an online service. The API documentation will give you a list of URLs, query
parameters and other information on how to make a request from the API, and inform you what sort of response will be given
for each query.
REST is a set of rules/standards/guidelines for how to build a web API. Since there are many ways to do so, having an
agreed upon system of structuring an API saves time in making decisions when building one, and saves time in
understanding how to use one.
Rest architecture and Watson API’s
REST:
▪REST is a term that was first used by Roy Fielding (one of the creators of the HTTP protocol)
in his doctoral thesis, which was published in the year 2000. This style of software architecture
for distributed systems (such as World Wide Web) is not applicable only for the development of
web services. For example REST principles are intended to apply to other protocols such as
FTP.
▪REST is an architecture style for accessing and manipulating resources on the web, such as
HTML documents, images, and script files.
▪ To retrieve or update a resource, perform an action by using HTTP methods.
▪To identify which resource to retrieve or update, REST uses a Uniform Resource Identifier
(URI) to describe the network location of the resource.
.
REST has the following characteristics:

• REST is a simple way of building services for client/server interactions, which are built on web resources.
• REST is an architecture, not a product. You build services that follow the REST architectural style.
•REST services follow standard web protocols, such as HTTP. There is a misconception that REST can
work solely over the HTTP protocol, but this idea is not true. Although the most common scenarios for using
REST are over the HTTP protocol, REST can be used over other transfer protocols, such as SMTP.
• REST services tend to use lightweight data models, such as JSON. It is used also for XML.
• REST services are a popular way for applications to interact with server-side applications.
REST architecture constraints:
• Uses a client/server model:
The client initiates a stateless request by using the HTTP protocol for destination servers. Servers process the requests and
return the responses based on these requests. These requests and responses are built around the transfer of
representations of resources. Separation of concerns is the principle behind the client-server constraints. For instance, by
separating the user interface concerns from the data storage concerns, we improve the user interface portability across
multiple platforms and improve scalability by decoupling and simplifying the servercomponents.
• Stateless:
In client/server interaction, the communication must be stateless natively, which means that each request from client to
server must contain all of the information that is necessary to understand the request, and not take advantage of any stored
context on the server. Therefore, the session state is kept on the client.
• Resource:
In the REST architectural style, any available information is a resource. The registration of a person, an image, a document,
and the quotation of a currency are examples of resources. Each resource must have a unique identifier. This identifier is
used so that the resource can be accessed. On the internet or in an intranet, a web resource is identified by a URI.
A resource is an object with a type, associated data, relationship to other resources, and a set of methods that operate the
resource.
This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete operations
and HTTP methods:
•GET
•POST
•PUT
•DELETE
For example, HTTP GET is defined as a data-producing method that is intended to be used by a client application to retrieve
a resource, fetch data from a web server, or run a query with the expectation that the web server looks for and responds with
a set of matching resources. The GET method is used to retrieve information from the server. When you use your browser to
go to any URI, you use the GET method to get the HTML of that website. The query string containing the parameters that are
needed for the request are sent in the URL by placing a question mark (?) at the end of the URI and then writing the
parameters.

The POST method is used to create the data in the server. In this case, the parameters are posted in the body of the request,
not in the URI.
The PUT method is used to change the state of current data in the server. In this case, the parameters are posted in the
body of the request, and not in the URI. Using PUT to replace the original resource provides a much cleaner interface that is
consistent with REST principles and the definition of HTTPmethods.
The DELETE method is used to delete a resource from the server.
Resource Identifier and URIs:
Differences between URI, URL, and URN:
Every URL and URN are a URI because a URI is the superset of both a URL and URN.URI is a text that is
used to identify any resource or name. In the example, it is the location of the resource
http://example.com/personDetail.
A Uniform Resource Location (URL) is a subset of a URI. A URL includes the location and protocol to retrieve
the resource. In the example, it is http://example.com/.
A Uniform Resource Name (URN) is the subset of a URI that is required to remain globally unique and
persistent even when the resource ceases to exist or becomes unavailable. A URN is a URI that uses the
URN scheme, and does not imply availability of the identified resource. Both URNs (names) and URLs
(locators) are URIs, and a particular URI may be both a name and a locator concurrently. A URN is similar to
a person’s name, and a URL is like a street address. A URN must have the form <URN> ::= "urn:" <NID> ":"
<NSS>, where <NID> is the Namespace Identifier and <NSS> is the Namespace Specific String. In the
example, it is urn:example:persondetail:ahmed:28.
A URI can be simple, such as http://example.com/index.html. When the protocol is http, the location where
the resource resides is example.com, the context root is /, and the path of the resource is index.html. The
URL is http://example.com.
Another example of a URI is http://example.com/personDetail?firstName=Ahmed&age=28, where the
protocol is http, the URL is http://example.com/ with the context root as / and the resource as personDetail.
The parameters are firstName and age.
Each parameter is represented as a name-value pair. The parameters are separated by “&”. The URI for a
GET request can be formatted as shown in the following example:
http://example.com/customer/customerDetail?firstName=Ahmed&age=28
A more complex example of URI could be:
http://example.com/services/customer/customerDetail?firstName=Ahmed&age=28.
This example is considered more complex because we have all elements in the URI, such as the protocol,
base URL, the context root, the resource name, resource method, and parameters. The http is the protocol,
the URL is http://example.com/services with the context root /services, and the customer is the resource path
with operation customerDetail on the resource customer and the parameters firstName and age.
JSON data type: Objects
JSON object is an unordered collection of key/value pairs with the following characteristics:
• Curly brackets ({ }) hold object declarations.
• Colons separate object keys and values.
• Commas separate each key-value pair.
• Keys are strings.
• Values can be any JSON data type.
• Objects can be nested.
In the example, the JSON object has three fields: name, id, and email. The name field is another JSON object with two fields:
First and last.
JSON data type: Arrays
JSON Array is an ordered sequence of values with the following characteristics:
• Arrays must begin and end with square brackets ([ ]).
• Commas separate array values.
• Arrays can be nested to represent multidimensional arrays.
Two examples are shown in this slide. The first example is an array of seven string values. The second
example is a multi-dimensional array. Notice that the array can hold a mix of JSON data types.
JSON must start with an object or an array at the top level.
Artificial intelligence is a technology and based on this technology IBM Watson is a Artificial intelligence product which
provides different services in software domain for different technology. Whatever services available in IBM cloud like chatbot,
visual recognition, text to speech, speech to text belongs to ibm Watson...
Watson is a question-answering computer system capable of answering questions posed in natural language,developed
in IBM's DeepQA project by a research team led by principal investigator David Ferrucci. Watson was named
after IBM's founder and first CEO, industrialist Thomas J.Watson.
IBM Watson. Named after IBM's first CEO, Watson was born back in 2007 as part of an effort by IBM Research to develop
a question-answering system that could compete on the American quiz show "Jeopardy." Since trouncing its human
opponents on the show in 2011, it has expanded considerably.
In an historic event, in February 2011 IBM’s Watson computer competed on Jeopardy! against the TV quiz show’s two
biggest all-time champions. Watson is a computer running software called Deep QA, developed by IBM Research. While the
grand challenge driving the project was to win on Jeopardy!, the broader goal of Watson was to create a new generation of
technology that can find answers in unstructured data more effectively than standard search technology.
Experts discuss. Ken Jennings (left) faces off against supercomputer Watson (center) and his fellow Jeopardy
champion, Brad Rutter (right)
Why IBM Watson is Important. First he won at Jeopardy. Now IBM Watson is helping to treat cancer. ... Doctors from
Memorial Sloan-Kettering have spent thousands of hours “teaching” Watson how to process analyze and interpret the
meaning of complex clinical information using natural languageprocessing.
A dermatology app called schEMA allows doctors to input patient data and, using natural-language processing (NLP), helps
identify potential symptoms and treatments. Additionally, Watson uses vision recognition to help doctors read scans such as
X-rays and MRIs to better narrow the focus on a potentialailment.
IBM Watson Analytics has two enterprise pricing options you can choose from. Starting at $30.00 per month, it is an
economical application for analyzing and visualizing your data
Advantages for radiologists and other physicians include the assurance that they are aware of all data relevant to a
particular patient, they will be able to review statistical comparisons to similar patient groups, coincidental diagnoseswill be
surfaced, patients can be triaged, and the potential for automated report
The figure shows the Watson services on IBM Cloud at the time of writing. These services will continue to be enhanced,and
new services will be introduced in the future.
The following services are available as REST APIs and software as a solution (SaaS) tools that developers can use to build
AI solutions or add AI features to theirapplications.
AI Assistant (Chatbot): Integrate diverse conversation technologies into your application:
•Watson Assistant: Quickly build a chatbot by using intents, entities and dialog trees. It uses Natural Language Processing
and pattern recognition techniques.
Data: Collect, organize, and analyze your data, and then achieve trust, scale, and automation across your
full AI lifecycle:
•Watson Studio: A collaborative environment with AI tools that a team can use to collect and prepare training data, and to
design, train, and deploy machine learning models.
•Watson Machine Learning: Enables users to perform two fundamental operations of machine learning: training and
scoring.
•Watson Knowledge Catalog: Machine learning data catalog that enables you to access, curate, categorize, and share
data, knowledge assets, and their relationships, wherever they are.
•Watson OpenScale: Operate and automate AI at scale by infusing it with trust and transparency, explaining its outcomes,
and eliminating harmful bias.
•Watson Compare & Comply: Extract data from contracts and governing documents to increase productivity, reduce
costs, and minimize exposure.
Knowledge: Get insights through accelerated data optimization capabilities:
• Discovery: Unlock hidden value in data to find answers, monitor trends, and surfacepatterns.
• Discovery News: Explore news and blogs with smarter news from Watson that includes concepts, sentiment,
relationships, and categories.
• Watson Natural Language Understanding: NLP for advanced text analysis.
• Knowledge Studio: Teach Watson to discover meaningful insights in unstructuredtext.
Vision: Identify and tag content, and then analyze and extract detailed information that is found in an image:
• Visual Recognition: Tag and classify visual content by using machine learning.
Speech: Converts text and speech with the ability to customizemodels:
• Speech to Text: Easily converts audio and voice into written text.
• Text to Speech: Converts written text into natural-sounding audio.
Language: Analyzes text and extracts metadata from unstructuredcontent:
• Language Translator: Translates text from one language toanother.
• Natural Language Classifier: Interprets and classifies natural language. Applies NLP and machine learning techniques to
return the best matching classes for a sentence orphrase.
Empathy: Understands tone, personality, and emotional state:
• Personality Insights: Predicts personality characteristics throughtext.
• Tone Analyzer: Understands emotions and communication style in text.
AI services on IBM Cloud catalog:
Watson Practical

Chatbot
Text – To – Speech
Speech – To – Text

(Available in recorded session)

You might also like