histograph/core

Name: core

Owner: Histograph

Description: Histograph Core: Graph management and inferencing

Created: 2015-02-10 12:09:52.0

Updated: 2016-01-13 01:26:27.0

Pushed: 2018-01-16 14:01:56.0

Homepage:

Size: 657

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Histograph-Core

Utility that parses NDJSON objects from Redis' histograph-queue, adds it to Neo4j, indexes the data with Elasticsearch and performs inferencing.

Running Histograph-Core
npm i
node index.js --config [cfg.json]

NOTES

Cleaning up before / after running
Input JSON syntax (through Redis)

JSON PIT object:

{
    "action": ["add", "delete", "update"],
    "type": "pit",
    "source": String,
    "target": ["graph", "es"],          // Optional, omit to send to both
    "data":
        "id": integer,
        "type": String,
        "name": String,
        "uri": String,                  // Optional
        "startDate": xsd:date,          // Optional
        "endDate": xsd:date,            // Optional
        "geometry": GeoJSON string,     // Optional
        "data": {                       // Optional
            ...additional keys/values
        }
    }
}

JSON Relation object:

{
    "action": ["add", "delete"],
    "type": "relation",
    "source": String,
    "data": {
        "from": [integer | String], (internal ID or hgID)
        "to": [integer | String], (internal ID or hgID)
        "label": String
    }
}
I/O examples through Redis

Add PITs:

h "histograph-queue" "{'action': 'add', 'type': 'pit', 'source': 'graafje', 'data': {'id': '123', 'name': 'Rutger', 'type': 'Human' } }"
h "histograph-queue" "{'action': 'add', 'type': 'pit', 'source': 'graafje', 'data': {'id': '321', 'name': 'Bert', 'type': 'Human' } }"

Add relations:

h "histograph-queue" "{'action': 'add', 'type': 'relation', 'source': 'graafje', 'data': { 'from': 123, 'to': 321, 'label': 'hg:absorbedBy' } }"

Delete PITs:

h "histograph-queue" "{'action': 'delete', 'type': 'pit', 'source': 'graafje', 'data': { 'id': '321', 'name': 'Bert', 'type': 'Human' } }"

Delete relations:

h "histograph-queue" "{'action': 'delete', 'type': 'relation', 'source': 'graafje', 'data': { 'from': 123, 'to': 321, 'label': 'hg:absorbedBy' } }"

Update PITs:

h "histograph-queue" "{'action': 'update', 'type': 'pit', 'source': 'graafje', 'data': { 'id': '321', 'name': 'Frits', 'type': 'Human' } }"

Copyright © 2015 Waag Society.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.