GithubHelp home page GithubHelp logo

doytsujin / contextapidemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from selerityinc/contextapidemo

0.0 1.0 0.0 49 KB

Demo code showing how to use the Selerity Context API

Shell 2.57% Java 97.43%

contextapidemo's Introduction

ContextApiDemo

Sample code that shows how to use the Selerity Context API.

Build Status

Installation

  • Request an API key from [email protected] for the Selerity Context API
  • Install Java 7 (or newer)
  • Install Maven
  • To query and show items about Google, run the following command (run-demo.sh builds the application upon need)

./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY -query Google


* To see all options along with some sample queries, run

./run-demo.sh -help


## Organization of the source code

The source code has three main relevant files:

* [`ContextApiDemoMain`](https://github.com/SelerityInc/ContextApiDemo/blob/master/src/main/java/com/seleritycorp/context/ContextApiDemoMain.java) is the main entry point and coordinator for the demo. The demo uses `QueryUtils` to talk to the Selerity Context API.
* [`QueryUtils`](https://github.com/SelerityInc/ContextApiDemo/blob/master/src/main/java/com/seleritycorp/context/QueryUtils.java) exposes the Selerity Context API endpoints. This abstraction layer is responsible for constructing the request objects and getting the results out of the API responses. The actual HTTP requests are performed through `RequestUtils`
* [`RequestUtils`](https://github.com/SelerityInc/ContextApiDemo/blob/master/src/main/java/com/seleritycorp/context/RequestUtils.java) performs the basic, low-level HTTP requests.

The remaning files are abstractions supporting those three parts.

## Examples

In the following examples, replace `REPLACE_WITH_YOUR_API_KEY` with your Selerity Context API key.

./run-demo.sh -help


The above command will list all available options.


./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY


The above command will query and show the latest breaking news.

./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY -querytype RECOMMENDATION


The above command will query and show the most important recent content.


./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY -query Google


The above command will query and show the latest breaking news for items relating
to Google. Even partial matches like the Twitter username @googleventures are
considered.


./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY -query Google -exact


The above command will query and show the latest breaking news for items relating
to entities that exactly match Google (i.e.: The company itself and the Google
twitter account). It will not consider content that is only relevant to entities
partially matching Google. So for example the Twitter username @googleventures is
not considered.


./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY -query Google -contributions ALL


The above command will query and show the latest breaking news for items relating
to Google (also considering partial matches), and gives details on which aspects
influenced the scoring.


./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY -query Google -live


The above command will query and show the latest breaking news for items relating toGoogle (including partial matches) while skipping pauses between updates. That way,new items are received right away.


./run-demo.sh -apikey REPLACE_WITH_YOUR_API_KEY -sources


The above command will query and show the sources that your API key is entitled for.


## JavaDoc

JavaDoc for this package is available at https://doc.seleritycorp.com/javadoc/com.seleritycorp.context/ContextApiDemo/master/

JavaDoc for the whole Selerity platform is at https://doc.seleritycorp.com/javadoc/platform/master/

## Questions/Support

If you run into issues or have questions, please let us know at [email protected]

contextapidemo's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.