OpenRefine adds "_ - " to column names when creating new project from JSON.

Created on 10 Jul 2015  路  5Comments  路  Source: OpenRefine/OpenRefine

Refine adds "_ - " in front of all column names (i.e. keys in JSON). It happens on import of any JSON files.

JSON UI bug import

Most helpful comment

Instead of coming up with our own way to encode the JSON聽structure in column names, we could use the JSON Pointer syntax for that, which is reasonably standard since it is used by JSON Schema: #2201.

All 5 comments

The underscore character is used as a placeholder for empty (ie null) names and the column name is constructed as a concatenation of the names for the path leading to the current object/field (since the names aren't necessarily unique by themselves).

Are you asking for something different to be done? We've discussed in the past (and I think there might be an issue for it already), removing the root object from the path. Are you looking for something along those lines or something different?

While brevity is appreciated, including enough words so that we can tell what you're requesting is helpful.

Pardon about so long answer, there was the reason.

Refine importer does not check for empty keys (or it does not work).
Check it out on simple JSON:

[
    {
    "key1": "value1",
    "key2": "value2"
    }
]

Column names in Refine for it is _ - key1 and _ - key2, respectively.
It is unnecessary to add any placeholders in this case.

Found this issue #524, but not the pull.

Instead of coming up with our own way to encode the JSON聽structure in column names, we could use the JSON Pointer syntax for that, which is reasonably standard since it is used by JSON Schema: #2201.

This is related to #710

Was this page helpful?
0 / 5 - 0 ratings