202 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Slides from MS Ignite Office Education day – Office Add-Ins Script Lab
Wed, Oct 4th 2017 3
Speaking at SharePoint Chicago Dec 2017
Wed, Sep 6th 2017 4
Office Add-Ins: Working with Tables in Word. Part 1: Creation
Tue, May 30th 2017 3
Interesting new release – Istio service mesh microservices management
Wed, May 24th 2017 4
Office Add-Ins – JavaScript control over the Content Control lock in a Word document
Thu, Mar 30th 2017 4
Calling an external service from your chat bot
Mon, Mar 20th 2017 5
NWCJS Meetup: Creating Bots with JavaScript and the Microsoft Bot Framework
Tue, Mar 14th 2017 3
Top 10
Accessing the original element when using Select2-focus
Sun, Aug 17th 2014 15
Adding your Let’s Encrypt SSL certificate into your Domino keyring file
Thu, Feb 18th 2016 13
Angular.js in XPages #6 – A People Manager CRUD application
Sun, Jun 1st 2014 12
Creating an XPages Websockets chat client using Bluemix
Sun, Nov 9th 2014 11
Mustache.js – How to create a client side Repeat control in XPages
Sun, Feb 23rd 2014 10
Binding jQuery code to an XPages partialRefresh using DOM Mutation events
Wed, Oct 29th 2014 9
How to ad icons to individual items in a Select2 multi-value field
Tue, Mar 18th 2014 8
WebSockets comes to XPages!! Awesome – Awesome – Awesome
Tue, May 20th 2014 8
Opening an XPage in XPiNC and passing Query_String parameters
Tue, Sep 30th 2014 8
Obtain an Office 365 OAuth token from within an Office Add-in without pop-ups or dialogs
Mon, May 30th 2016 8


Create your own Watson Q and A example with Bluemix, Webstorm and Jazz Hub
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
mark roden    

Introduction

In this article I will demonstrate how to get up and running with one of the Bluemix/Watson service examples. I will be using the example provided by IBM in their documentation as the basis for the article but the way in which I achieved the final goal was quite different from the way that they explained it in the example.

This example will use:

I could have added BS words as an attention seeking headline, and it would fit because there is so much I want to show in this one post (it is probably should be 5 separate posts). But I figured that it’s probably better to have a more description title about what this is really about (more googlable that way). So be warned this is a longer post than normal because of all the pictures. Going through this experience helped me better understand Git, Webstorm (and how it uses Git), Jazz Hub and Bluemix.

Creating an example of using the Bluemix Watson service.

Earlier this week IBM announced that they added the Watson API as a service to Bluemix. I honestly have no idea what I would ever use this for in my line of business but the coolness factor is huge!

In this post I am going to demonstrate how I was able to create the example service without using the same process as laid out in the IBM documented example. As this is a long post (lots of pictures) I will be discussing the separate parts in other posts.

There are also other ways of creating your App from scratch (for example Create an App, select node.js as a runtime and then bind the Watson service.) The reason I did the example this way was to highlight that you do not always have to start with a new service. I needed a node.js runtime, and it happened that one of my services already provided that (the DataCache starter service). That’s kinda cool and kinda the point of Bluemix!

1) Log into Bluemix

https://ace.ng.bluemix.net

Your should be presented with your dashboard.

2) Create an App 

 

 

a1

 

Select the Node.js runtime
w1

 

Name the App (in my case the App is called xominoWatsonQandA and the Host is xominoWatsonQ)

w2

3) Add a service – Watson Question and Answer 

w3

w3

4) Assign meta-data to the new service

  • Give the service a name – you will need this later so don’t over complicate this (qa-service)
  • The Watson service is currently in Bluemix as a Beta at time of writing

w4


5) Confirm you have an application

Now we have the pieces necessary to build the application on.

  1. A Node server
  2. The Watson service.

w5

6) Make sure you have a Jazz Hub account

If you do not already have a Jazz Hub account then go and create one here https://hub.jazz.net/

NOTE: The Jazz Hub site uses your IBM login userid and your Jazz Hub password – do yourself a HUGE favor and make the password the same as your IBM account and if you ever change the password on your IBM account you have been warned :)

Here is a shot of my Jazz Hub account before we start – note no “xominoWatsonQandA”

w1

7) Add your new application to Jazz Hub

Select the “Add GIT” option on the top right of your App dashboard

w6

8) Confirm existing service code?

The next prompt asks me if I want to create starter code in the new Git Source Control repository. In this case I do not – un-check it.

w9

9) Go to your new source control Git repository

Click on the Jazz Hub URL displayed on the right hand side.

The Add Git link will be replaced with a link to the repository. Click on the link to go to there. We will look at Edit Code in another post.

 

w7

 

10) Get the URL of the repository

In the picture below you can see over on the right there is a link for the Git URL – click on that and copy the URL.

w11

11) Open Webstorm IDE

As I was working my way through this example I wanted to learn more about how Webstorm functions as a Git client. You can use Source Tree or the Git command line if you prefer.

You need to ensure that Git is enabled in Webstorm before you proceed. it is not configured out of the box. The instructions for enabling git are found here https://www.jetbrains.com/webstorm/webhelp/using-git-integration.html. You will need to have Git installed before hand. Follow the ssh key instructions and it will show you how.

12) Checkout the new repository

Select Checkout from Version Control > Git form the Webstorm VCS menu option

w12

 

Paste the URL from the Jazz Hub site into the Vcs Repository URL

w13

Select Clone and a new project is created within Webstorm and as you can see, the files downloaded are those from the repository on Jazz Hub

w14

12) Download the example code and add to the local repository

Following the example site, download the sample file qa-nodejs-sample.zip. Unzip it locally and drag the files into the repository directory created by Webstorm in the previous step.

w15

Clicking back into Webstorm you will see the files refresh in the project – they all appear “red” because although the files are in the repository directory they are not current added to the Git configuration, it does not know they exist.

w16

13) Add the files to the local Git repository

Right click on the project and add the directory as follows.

w17

The files will all turn green

14) Edit the manifest.yml file

Within Bluemix the manifest,yml file is the key to holding everything together. It contains the “services” and the application they are used in. In my case the service name for Watson was qa-service and the application is xominoWatsonQandA.

Save the Manifest file

w8

You can also see from the manifest file command “node app.js“. If you look into the other files currently in the example you will find app.js. This tells Bluemix how to start the application.

15) Commit the files to the local repository

Right click on the project name – select Git > Commit Directory

In this case I chose to Commit and Push back to the repository

 

w20

w21

Webstorm then does a stupidity check on your files (we all need that)

w22

And then Webstorm tells you that you are stupid!!

w23

On dear……….well actually if you look into this, Webstorm is reporting issues in the example app css files and missing semi-colons in the JavaScript. Without going into correcting all of them, the application works despite these errors. So we Commit and continue.

w24

My commit comments are “Modified manifest and all files”

Pushing…

w25

We get confirmation that the files were committed and pushed up to the Jazz Hub repository

16) Confirm Jazz Hub

You can now see by refreshing your Jazz Hub page that all the files are now in the server repository. You can also see next to my picture in the middle “Manifest change and all files” as the last commit comment.

w26

Then comes the really cool and completely not Command Line experience. In the top right of the page you can see Build and Deploy….

17) Build and Deploy

w27

18) Confirm

You will be taken to a page where you can see the results of the build and deploy. Jazz Hub is very smart and self aware. If you have un-committed changes within your repository it will not let you Deploy. That is for another day though.

w28

 

Note: what’s interesting is that the Deploy to URL which I cannot change is xominoWatsonQandA.mybluemix.net not what I would expect as xominoWatsonQ.mybluemix.net which is the route I gave the application in the first place. Turns out I not have two routes to the same App. I can see this back on my bluemix dashboard as there is now a (+1) next to my routes options!

So note to self, name your route the same as the application name!

w10

19) You now own Watson

Click on the route link back on your Bluemix dashboard and you now have a running example of the Watson Heathcare service

w9

In review

In this example we saw a LOT of cool new features, concepts and ideas for Domino developers and you know that we have barely scratched the Bluemix, Webstorm, Jazz Hub surface. I learned a significant amount of new and cool things from going through this process. The first time from scratch it took about 90 minutes to figure out what I was doing. The second time I went through it, even taking all the screenshots for the blog it took 25 minutes.

We only changed two lines in one file to make this work – anyone can do this !!

Like I said at the top of the article, I have no idea how I would use Watson in the day job but that was not the purpose for doing this example. These “services” are componentized capabilities which we can take advantage of. Imagine the growth possibilities as more and more services are added to Bluemix. This has got to be fun to watch and follow along. Remember IBM are investigating putting Domino into Bluemix.

The Watson Cloud REST API information is available here http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/apis/#!/Question_Answer

This is so cool :)




---------------------
http://xomino.com/2014/10/13/create-your-own-watson-q-and-a-example-with-bluemix-webstorm-and-jazz-hub/
Oct 12, 2014
8 hits



Recent Blog Posts
3
Slides from MS Ignite Office Education day – Office Add-Ins Script Lab
Wed, Oct 4th 2017 4:57p   Mark Roden
A
4
Speaking at SharePoint Chicago Dec 2017
Wed, Sep 6th 2017 2:55a   Mark Roden
A
3
Office Add-Ins: Working with Tables in Word. Part 1: Creation
Tue, May 30th 2017 6:18p   Mark Roden
A
4
Interesting new release – Istio service mesh microservices management
Wed, May 24th 2017 3:37p   Mark Roden
A
4
Office Add-Ins – JavaScript control over the Content Control lock in a Word document
Thu, Mar 30th 2017 1:30a   Mark Roden
A
5
Calling an external service from your chat bot
Mon, Mar 20th 2017 1:49a   Mark Roden
In this article I will show to how integrate simple commands (intents) into your bot to then integrate with an external service. Introduction In previous articles we have looked at how to create a sample Azure bot and in this article we will be looking into how “intents” work. The microsoft documentation on dialogIntents can be found here (for the … Continue reading Calling an external service from your chat bot
3
NWCJS Meetup: Creating Bots with JavaScript and the Microsoft Bot Framework
Tue, Mar 14th 2017 2:33a   Mark Roden
Next week’s Northwest Chicago JavaScript meetup (23 March @PSCGroup) features our own Adam Lepley speaking about some of the work he has been doing on the Microsoft Bot Framework. https://www.meetup.com/Northwest-Chicago-JavaScript/events/236993059/ “Bots, they are invading our chat apps, now it’s time to learn to develop your own. Come learn how Microsoft’s Bot Framework enables you to leverage … Continue reading NWCJS Meetup: Creating Bots with JavaScript and the Microsoft Bot&#
1
Setting up the sample Azure bot to work locally with the bot emulator
Mon, Mar 13th 2017 2:27a   Mark Roden
In this article I will demonstrate how to configure your local development environment to work with the environmental variables set up within your Azure environment in the sample bot previously discussed, Introduction  In the previous article we looked at how to create a sample azure bot and then how to configure it in VSTS for continuous integration. If you … Continue reading Setting up the sample Azure bot to work locally with the bot emulator
1
Adding your bot code to VSTS for source control and configuring continuous integration
Mon, Mar 6th 2017 3:00a   Mark Roden
A
2
Adding your Azure bot framework bot into Skype
Tue, Feb 28th 2017 2:30a   Mark Roden
A




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition