redisgraph-bulk-loader icon indicating copy to clipboard operation
redisgraph-bulk-loader copied to clipboard

Treating empty Values when using Enforce schema

Open YaphetKG opened this issue 4 years ago • 2 comments

This is more of a question with a use case when loading nodes lets imagine we have two objects

{ "name": "moving item" , "can_move" : True}
{ "name": "cat" , "can_make_noise": True}

let's say we can create a schema merging the properties of these objects that looks something like

name:STRING|can_move:BOOL|can_make_noise:BOOL
moving item|True|
cat||True

When using the bulk loader with enforce schema we are expected to define a value for the missing columns can_move for cat or can_make_noise for moving item.

There are cases where in data we are trying to load doesn't make sense to use default values , i.e cases where we can't assert that if this is not provided then use False (or True) for that matter .

Question is is it possible to accept missing values and not write those properties in the graph if values for those columns (attributes) are not provided?

YaphetKG avatar Dec 23 '20 19:12 YaphetKG

Hi @YaphetKG,

Sorry for the late response! The enforce-schema option currently assumes no property is optional, but I agree that this is a worse design than allowing missing values.

If you'd like to open a PR to this effect, I'd happily merge it, otherwise I will add this to the project backlog!

jeffreylovitz avatar Jan 06 '21 13:01 jeffreylovitz

I haven't had a chance to get that working I ended up spliting my files.

YaphetKG avatar Jan 06 '21 13:01 YaphetKG