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
Size: 657
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Utility that parses NDJSON objects from Redis' histograph-queue
, adds it to
Neo4j, indexes the data with Elasticsearch and performs inferencing.
npm i
node index.js --config [cfg.json]
--config <file>
: Run with a configuration file, structured like this.NOTES
--config
is optional – the HISTOGRAPH_CONFIG
environment variable is read if it is omitted.-verbose
argument is omitted. Because of this, you will not be able to see whether data import has completed. Killing the program prematurely results in an inconsistent state between the Neo4j graph, the Elasticsearch index and the Redis queue. So if you need to be certain that the program is done, run the program with -verbose
.curl -X DELETE localhost:9200/
to remove all Elasticsearch indexes (beware).neo4j-shell -c "MATCH (n) OPTIONAL MATCH (n)-[e]-() DELETE e, n RETURN DISTINCT true;"
to remove all content of the graph (but keep the indices)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
}
}
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.