Permalink
Browse files

More documentation.

  • Loading branch information...
Orbifold committed Jun 1, 2017
1 parent f4d1c03 commit 194cb9cfe3e50fcca55e66a13fec58638cc73027
Showing with 1,118 additions and 124 deletions.
  1. +904 −16 Apps/REST/API/Qwiery.API.js
  2. +64 −29 Apps/REST/PostmanProject.json
  3. +1 −1 Apps/REST/README.md
  4. +7 −39 Apps/REST/index.js
  5. +36 −7 doc/README.md
  6. +77 −1 doc/notes/Features.md
  7. +28 −0 doc/notes/Highlevel.md
  8. +1 −1 doc/notes/Templates.md
  9. +0 −23 doc/notes/Terms.md
  10. +0 −7 doc/notes/index
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -154,7 +154,7 @@
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"console.log(responseBody)",
"tests[\"Qwiery\"] = responseBody.indexOf(\"Qwiery\") ===0;",
"tests[\"Qwiery\"] = responseBody.indexOf(\"Qwiery\") >=0;",
""
]
}
@@ -709,7 +709,7 @@
"description": "Folder for graph",
"item": [
{
"name": "graph/entity/upsert",
"name": "entity/upsert",
"event": [
{
"listen": "test",
@@ -743,52 +743,75 @@
],
"body": {
"mode": "raw",
"raw": "{\"entity\":{\n\"Title\": \"Hello there\",\n\"Type\":\"Thought\"\n}\n}"
"raw": "{\"entity\":{\n\"Title\": \"Hello there\",\n\"Id\":\"SomethingToBeReused\",\n\"Type\":\"Thought\"\n}\n}"
},
"description": "Upserts a semantic entity in the user's graph."
},
"response": []
},
{
"name": "graph/entity/upsertMany",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"",
"var jsonData = JSON.parse(responseBody);",
"console.log(\">>\" +jsonData.length );",
"tests[\"Contains ids\"] = jsonData.length===1;"
]
}
}
],
"request": {
"url": "{{domain}}/graph/entity/upsertMany",
"method": "POST",
"header": [],
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
},
{
"key": "apiKey",
"value": "{{apiKey}}",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": "the entities to be added"
"raw": "{\"entities\":[\n\t{\n\t\t\"Title\": \"Q 1.3\",\n\t\t\"Type\": \"Version\"\n\t\t\n\t}\n\t]}"
},
"description": "Upserts multiple entities to the user's graph."
},
"response": []
},
{
"name": "graph/entity/get/:id",
"name": "entity/get/:id",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"tests[\"Your test name\"] = jsonData.DataType === \"Thought\";"
]
}
}
],
"request": {
"url": {
"raw": "http://localhost:4785/graph/entity/get/:id",
"protocol": "http",
"auth": {},
"host": [
"localhost"
],
"port": "4785",
"path": [
"graph",
"entity",
"get",
":id"
],
"variable": [
{
"value": "{{id}}",
"id": "id"
}
]
},
"method": "POST",
"header": [],
"url": "http://localhost:4785/graph/entity/get/SomethingToBeReused",
"method": "GET",
"header": [
{
"key": "apiKey",
"value": "{{apiKey}}",
"description": ""
}
],
"body": {},
"description": "Fetches the entity with the given id from the user's graph."
},
@@ -825,6 +848,7 @@
"tags",
":id"
],
"query": [],
"variable": [
{
"value": "{{id}}",
@@ -1287,6 +1311,7 @@
"delete",
":id"
],
"query": [],
"variable": [
{
"value": "{{id}}",
@@ -1350,6 +1375,7 @@
"get",
":id"
],
"query": [],
"variable": [
{
"value": "{{id}}",
@@ -1423,6 +1449,7 @@
"clear",
":key"
],
"query": [],
"variable": [
{
"value": "{{key}}",
@@ -1498,6 +1525,7 @@
"get",
":correlationId"
],
"query": [],
"variable": [
{
"value": "{{correlationId}}",
@@ -1528,6 +1556,7 @@
"history",
":count"
],
"query": [],
"variable": [
{
"value": "{{count}}",
@@ -1653,6 +1682,7 @@
"entities",
":tagName"
],
"query": [],
"variable": [
{
"value": "{{tagName}}",
@@ -1684,6 +1714,7 @@
":entityId",
":tagName"
],
"query": [],
"variable": [
{
"value": "{{entityId}}",
@@ -1791,6 +1822,7 @@
"add",
":id"
],
"query": [],
"variable": [
{
"value": "{{id}}",
@@ -1822,6 +1854,7 @@
"remove",
":id"
],
"query": [],
"variable": [
{
"value": "{{id}}",
@@ -1853,6 +1886,7 @@
"contains",
":id"
],
"query": [],
"variable": [
{
"value": "{{id}}",
@@ -1901,6 +1935,7 @@
":entityId",
":tagName"
],
"query": [],
"variable": [
{
"value": "{{entityId}}",
View
@@ -1,6 +1,6 @@
This is the REST facade on top of a Qwiery instance. It allows you to use Qwiery as a service as part of a microservice architecture, in the cloud and whatnot.
The whole service is documented using [Swagger](http://swagger.io) and you can fetch the JSON via [/api-docs.json](/api-docs.json) or a cached version via [/swagger.json](/swagger.json). Using this JSON you can generate stubs (proxys) for your favorite language via the [Swagger Codegen](http://swagger.io/swagger-codegen/) or generate documentation via [Swagger UI](http://swagger.io/swagger-ui/).
The whole service is documented using [Swagger 2.0](http://swagger.io) and you can fetch the JSON via [/api-docs.json](/api-docs.json) or a cached version via [/swagger.json](/swagger.json). Using this JSON you can generate stubs (proxys) for your favorite language via the [Swagger Codegen](http://swagger.io/swagger-codegen/) or generate documentation via [Swagger Editor](http://editor.swagger.io/).
The service has been tested with [Postman](https://www.getpostman.com) and you can find the complete Postman collection of tests in the Qwiery code under _/Apps/REST/PostmanProject.json_.
View
@@ -3,8 +3,7 @@ const path = require('path'),
cors = require('cors'),
fs = require('fs-extra'),
_ = require("lodash"),
Qwiery = require("../../lib")
;
Qwiery = require("../../lib") ;
let template = null;
process.on('uncaughtException', function(err) {
@@ -29,14 +28,14 @@ let HOST;
if(false) {
// In case you want SSL, this is the kinda code you'll need.
// See here (among other) for more info https://github.com/andrewconnell/generator-nodehttps/blob/master/docs/setup-https.md
var https_options = {
const https_options = {
key: fs.readFileSync(__dirname + '/Data/Certificates/ssl-key.pem'),
cert: fs.readFileSync(__dirname + '/Data/Certificates/ssl-cert.pem')
};
PORT = 8443;
HOST = 'localhost';
var server = https.createServer(https_options, app).listen(PORT, HOST);
const server = https.createServer(https_options, app).listen(PORT, HOST);
console.log('+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+');
console.log('HTTPS Server listening @ https://%s:%s', HOST, PORT);
console.log('+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+');
@@ -64,7 +63,7 @@ const options = {
basePath: '/', // Base path (optional)
},
apis: ['./API/*.js'],
apis: [path.join(__dirname, './API/Qwiery.API.js')],
};
// Initialize swagger-jsdoc -> returns validated swagger spec in json format
@@ -78,18 +77,6 @@ app.get('/swagger.json', function(req, res) {
res.setHeader('Content-Type', 'application/json');
res.send(fs.readJsonSync(path.join(__dirname, "swagger.json")));
});
//
// app.get('/Dashboard/doc/:name', function(req, res) {
// var name = req.params.name;
//
// var filePath = path.join(__dirname, "../docs", name + ".md");
// if(fs.existsSync(filePath)) {
// res.send(fs.readFileSync(filePath, 'utf8'));
// }
// else {
// res.status(404).send("Document does not exist.");
// }
// });
const qwiery = new Qwiery();
require('./API/Qwiery.API.js')(app, qwiery);
@@ -121,7 +108,7 @@ function getTemlate() {
app.use("*", function(req, res) {
var file;
let file;
if(req.params[0] === "/") {
const MarkdownIt = require('markdown-it');
const md = new MarkdownIt();
@@ -132,29 +119,10 @@ app.use("*", function(req, res) {
return;
}
else if(req.params[0].toLowerCase().indexOf("/dashboard/apidocs") === 0) {
var pageName = req.params[0].substring(19).trim().toLowerCase();
if(pageName.length === 0 || pageName === "index") {
res.render('APIDocs/index');
return;
} else {
file = req.params[0];
var filePath = path.join(__dirname, "../Dashboard/Views/APIDocs/", pageName);
fs.exists(filePath, function(exists) {
if(exists) {
res.sendFile(filePath);
} else {
res.status(404).send("The file or service '" + file + "'does not exist.");
}
})
return;
}
}
else {
file = req.params[0];
}
var filePath = path.join(__dirname, "../", file);
const filePath = path.join(__dirname, "../", file);
fs.exists(filePath, function(exists) {
if(exists) {
res.sendFile(filePath);
@@ -183,7 +151,7 @@ app.use("*", function(req, res) {
* */
if(process.env.Platform === "Azure") {
var http = require('http');
const http = require('http');
app.set('port', process.env.PORT || 3000);
http.createServer(app).listen(app.get('port'), function() {
console.log("Express server listening on port " + app.get('port'));
View
@@ -1,18 +1,47 @@
![Qwiery](http://www.qwiery.com/QwieryLogoSmall.png)
Qwiery is a generic cognitive agent architecture for text-based user interfaces. In simple terms: it allows you to assemble modules which together interprete text input (questions) and formulate an appropriate answer. In a narrow sense, it allows you to create bots. In a broader sense, it has cognitive modules to emulate emotions, memory, personalization, personality and learning capabilities. The plugin architecture allows you to assemble and customize the beahvior in function of your (business) aims.
Qwiery is **a symbolic cognitive architecture for building agents, text-based user interfaces and cognitive pipelines** in general. It's a constuctive approach to cognitive computing and computational knowledge based on a modular system (plugins) with a focus on NLP-oriented interactions but allows a wide range of scenarios, including hybrid combinations of technologies (Python, R, Neo4j...) and approaches (neural networks, machine learning...).
The framework can articulate bots, utterance-intend interactions, REST services, HTML output and is an **engine** focused on processing interactions rather than a particular IO channel. It's written in JavaScript (**NodeJS**) and as such favors some constructs like Express, JSON and HTML but through the flexibility of NodeJS allows easy integration with XML, Python and whatnot.
Below you can find pointers to various documents which can help to get the most out of Qwiery.
Please read the following manuals to get started:
- [Configuration]{@tutorial Configuration}
- [Graph format]{@tutorial GraphDBFormat}
- [Mongo sample database]{@tutorial MongoDatabase}
**Overview**
- [Getting started]{@tutorial GettingStarted}
- [Architecture overview]{@tutorial Highlevel}
- [Features]{@tutorial Features}
- [Requirements]{@tutorial Requirements}
**Tutorials**
- [Ask confirmation]{@tutorial How_AskConfirmation}
- [Custom workflow state]{@tutorial How_CustomState}
- [How to store stuff]{@tutorial How_StoreThings}
**Basics**
- [Plugins]{@tutorial Plugins}
- [Pods]{@tutorial Pods}
- [Alias]{@tutorial Alias}
- [Apps]{@tutorial Apps}
- [Commands]{@tutorial Commands}
- [Configuration]{@tutorial Configuration}
- [Mongo database]{@tutorial MongoDatabase}
- [Templates]{@tutorial Templates}
- [Topics]{@tutorial Topics}
- [Workflows]{@tutorial Workflows}
**Advanced**
- [Ask]{@tutorial Ask}
- [Graph format]{@tutorial GraphDBFormat}
- [Personalization]{@tutorial Personalization}
- [Ask confirmation]{@tutorial How_AskConfirmation}
- [Session]{@tutorial Session}
- [Storage]{@tutorial Storage}
- [Trace]{@tutorial Trace}
- [Workflows]{@tutorial Workflows}
- [WorkflowState]{@tutorial WorkflowState}
Oops, something went wrong.

0 comments on commit 194cb9c

Please sign in to comment.