graphmalizer / graphmalizer-core

Graphmalizer core
https://graphmalizer.github.io
GNU Affero General Public License v3.0
1 stars 1 forks source link

confusing error when missing `dataset` #7

Closed wires closed 9 years ago

wires commented 9 years ago

pushing without dataset attribute makes graphmalizer an unhappy software.

127.0.0.1:6379> lpush histograph '{"data":{"type":"hg:Address", "id":"x"}, "action": "add", "type":"pit"}'
(integer) 1
127.0.0.1:6379> lpush histograph '{"data":{"type":"hg:Address", "id":"x"}, "action": "add", "type":"pit", "dataset": "x"}'

it reports (for the first item, second works fine)

{ type: 'hg:Address', id: 'x' }
Error: Type 'hg:Address' requires an id
    at Object.requireId [as node] (/Users/wires/r/erfgoed-locatie/histograph-core/node_modules/graphmalizer-core/core/queries.js:20:9)
    at Object.exports.mkQuery (/Users/wires/r/erfgoed-locatie/histograph-core/node_modules/graphmalizer-core/core/queries.js:58:37)
    at prepare (/Users/wires/r/erfgoed-locatie/histograph-core/node_modules/graphmalizer-core/index.js:82:19)