Skip to content

Commit 066d5e9

Browse files
committed
Merge pull request #155 from paxtonhare/154_sample_tweet_data
fixed #154 - added sample tweets
2 parents 878553d + bc600eb commit 066d5e9

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

examples/tweets/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Example Tweet Hub
2+
This example shows how to load JSON tweets from the [Twitter JSON API](https://dev.twitter.com/overview/api).
3+
4+
The tweets are zipped into a .zip file in the input/ folder.
5+
```
6+
|-- input
7+
|-- tweets.zip
8+
```
9+
10+
# TLDR; How do I run it?
11+
1. Download the latest quick-start jar from the [releases page](https://github.com/marklogic/marklogic-data-hub/releases) into this folder.
12+
13+
1. Run the quick-start jar `java -jar quick-start.jar`
14+
15+
1. Open your web browser to [http://localhost:8080](http://localhost:8080).
16+
17+
1. Point the Login box to your MarkLogic installation.
18+
19+
1. Create the "tweets" Entity.
20+
21+
Click on **"New Entity"**
22+
23+
**Entity Name:** Tweet
24+
**Ingest Flow Name:** ingest-tweets
25+
**Conformance Flow Name:** conform-tweets
26+
**Plugin Type:** Javascript
27+
**Data Format:** JSON
28+
29+
1. Deploy your modules by pressing the **Deploy Modules** button.
30+
31+
1. Load the tweets by pressing the **Load Data** button next to ingest-tweets. When prompted, choose the input folder. Set the collection to **tweets**. Set the Data Format to **Documents**. Check the **Input Files are Compressed** checkbox. Now Press **Submit**.
32+
33+
1. At this point you have loaded the sample tweets. You can browse the data via [QConsole](http://localhost:8000/qconsole) or by searching the REST endpoint on the Staging Http Server [http://localhost:8010/v1/search](http://localhost:8010/v1/search). *Your port may be different if you changed it during setup*
34+
35+
1. To run the conformance flow simply press the **Run** button next to the "conform-tweets" flow.
36+
37+
1. Now you have conformed the data into your final database. You can browse the data via [QConsole](http://localhost:8000/qconsole) or by searching the REST endpoint on the Final Http Server [http://localhost:8011/v1/search](http://localhost:8011/v1/search). *Your port may be different if you changed it during setup*
38+
39+
40+
# Entities
41+
Entities represent the data you are modeling. For this example you created the **Tweet** entity. Inside this entity definition you will find the generated flows.
42+
43+
# Flows
44+
Flows are sets of plugins that work together to create an envelope document.
45+
46+
- [Input Flows](#input-flows) work on incoming data and store it in the Staging database.
47+
- [Conformance Flows](#conformance-flows) work on staged data and transform and store it into the Final database.
48+
49+
## Input Flows
50+
51+
### input-tweets
52+
The auto-generated input Flow will ingest the compressed tweets as JSON files.
53+
54+
## Conformance Flows
55+
56+
This "conform-tweets" flow will create a conformed JSON document that contains the original tweet JSON as the content of an envelope.

examples/tweets/input/tweets.zip

5.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)