Name: watson-discovery-analyze-data-breaches
Owner: International Business Machines
Description: A Node.js application that demonstrates how to Import, Enrich, and see Insights about data using Watson Discovery.
Created: 2017-06-21 14:16:31.0
Updated: 2018-05-10 18:55:18.0
Pushed: 2018-05-10 18:55:20.0
Homepage: https://developer.ibm.com/code/patterns/import-enrich-and-gain-insight-from-data/
Size: 15902
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
In this Code Pattern you will upload your own data into the Watson Discovery Service. Then you'll configure a web application so that it can query the data collection you created. The web app allows you to explore that data.
Once you have completed this Code Pattern, you will know how to:
Use the Deploy to IBM Cloud
button OR create the services and run locally.
Press the above Deploy to IBM Cloud
button and then click on Deploy
.
In Toolchains, click on Delivery Pipeline to watch while the app is deployed. Once deployed, the app can be viewed by clicking View app.
To see the app and services created and configured for this Code Pattern, use the IBM Cloud dashboard. The app is named watson-data-breaches
with a unique suffix. The following services are created:
NOTE: These steps are only needed when running locally instead of using the
Deploy to IBM Cloud
button.
Clone the watson-discovery-analyze-data-breaches
repo locally. In a terminal, run:
t clone https://github.com/ibm/watson-discovery-analyze-data-breaches
We'll be using the folder data/breaches/
Create the following services:
Launch the Watson Discovery tool. Create a new data collection and give the data collection a unique name.
Save the environment_id and collection_id for your
.env
file in the next step.
Under Add data to this collection
use Drag and drop your documents here or browse from computer
to seed the content with the json files in data/breaches/
.
The credentials for the IBM Cloud Discovery service can be found in the Services
menu in IBM Cloud,
by selecting the Service Credentials
option for the service.
The other settings for Conversation and Discovery were collected during the
earlier setup steps (DISCOVERY_COLLECTION_ID
, DISCOVERY_ENVIRONMENT_ID
and
WORKSPACE_ID
).
Copy the env.sample
to .env
.
env.sample .env
Edit the .env
file with the necessary settings.
env.sample:
place the credentials here with your own.
name this file to .env before starting the app.
tson Discovery
OVERY_USERNAME=<add_discovery_username>
OVERY_PASSWORD=<add_discovery_password>
OVERY_ENVIRONMENT_ID=<add_discovery_environment>
OVERY_COLLECTION_ID=<add_discovery_collection>
n locally on a non-default port (default is 3000)
RT=3000
npm install
, followed by npm start
.localhost:3000
.Note: server host can be changed as required in server.js and
PORT
can be set in.env
.
Error: Environment {GUID} is still not active, retry once status is active
This is common during the first run. The app tries to start before the Discovery environment is fully created. Allow a minute or two to pass. The environment should be usable on restart. If you used
Deploy to IBM Cloud
button the restart should be automatic.
Error: Only one free environent is allowed per organization
> To work with a free trial, a small free Discovery environment is created. If you already have a Discovery environment, this will fail. If you are not using Discovery, check for an old service thay you may want to delete. Otherwise use the .env DISCOVERY_ENVIRONMENT_ID
to tell the app which environment you want it to use. A collection will be created in this environment using the default configuration.