Questions tagged [grel]

GREL is the transformation expression language for OpenRefine (formerly Google Refine), a data wrangling application. Originally, GREL stood for "Google Refine Expression Language". Now it is usually expanded as "General Refine Expression Language".

GREL is the transformation expression language for OpenRefine (formerly Google Refine), a data wrangling application. Originally, GREL stood for "Google Refine Expression Language". Now it is usually expanded as "General Refine Expression Language".

69 questions
6
votes
1 answer

Simple OpenRefine IF to create a new column

Im trying to create a new column which contains true or false. Basically column A has a number in it, between 1 and 6, if its higher than 3 I want the new column 'match' to contain true, otherwise it contains false. Using the add column based on…
Paul M
  • 3,937
  • 9
  • 45
  • 53
4
votes
1 answer

Parse multivalued JSON in GREL (OpenRefine)

I have a column with the following content: 7. {"resource":"abc"} 8. [{"resource":"def"},{"resource":"ghi"}] I try to get the content of "resource": value.parseJson().resource Works. If I try to get the content of multivalued cells, I can't get it…
CH_
  • 685
  • 1
  • 7
  • 18
3
votes
2 answers

OpenRefine - Merge multiple column values into new column should (?) work

My data includes multiple columns that--for my purposes--are the same. In these places, I need to combine the values in multiple selected columns into a single column. For example, combine columns names1, names2, and names3 into a single column…
3
votes
2 answers

How to do a dynamic regex in openrefine GREL replace?

I'm trying to remove case-insensitively the value of cell 'artist' from the current cell (which is a song name). I know that replace() can take regex as argument…
dvalexieva
  • 31
  • 2
3
votes
1 answer

How to use or statement in a if statement in openrefine

I need to verify 2 values inside a if condition in Openrefine I already tried: if(value > 5.6 | < -33, "inside", "outside") if(value > 5.6 || < -33, "inside", "outside") if(value > 5.6 or < -33, "inside", "outside")
Joni Hoppen
  • 658
  • 5
  • 23
2
votes
2 answers

OpenRefine error: "object[] value not storable"

I'm trying to extract an array of industry code descriptions from the OpenCorporates.com JSON output using OpenRefine. I've extracted the industry_codes array from the JSON body into a new column. Some records have a full array, some just have [ ].…
woodbine
  • 553
  • 6
  • 26
2
votes
1 answer

Inserting Regular Expressions into OpenRefine facets

Working in OpenRefine I want to find word pairs where the second word is 'Street'. I have a python regular expression which works for this but I can't get it to work in OpenRefine. https://regex101.com/r/igjCuo/94 show the regex working…
Jack
  • 2,245
  • 2
  • 14
  • 18
2
votes
1 answer

How to add a column that substract the difference between two existing columns ? GREL in OpenRefine

So I'm trying to find a simple way to create a new column that displays the difference between two existing columns (each with numbers)... I can't seem to find the proper GREL expression.... So I'm trying to find the amount of items sold with a…
2
votes
3 answers

How can I add a string character based on a position in OpenRefine?

I have a column in Openrefine, which I would like to add a character string in each of its rows, based on the position in the string. For example: I have an 8th character number string: 85285296 and would like to add "-" at the fourth place:…
tzipy
  • 147
  • 7
2
votes
1 answer

OpenRefine: 'Fill Up' replacing values along one column

I have following table ╔════════╦════════╦════════╦════════╗ ║ record ║ Brand ║ Model ║ Spec ║ ╠════════╬════════╬════════╬════════╣ ║ 1 ║ X ║ null ║ 1 ║ ║ ║ X ║ DF ║ 3 ║ ║ ║ X ║ null ║ 5 …
til
  • 832
  • 11
  • 27
2
votes
2 answers

Extracting email addresses from messy text in OpenRefine

I am trying to extract just the emails from text column in openrefine. some cells have just the email, but others have the name and email in john doe format. I have been using the following GREL/regex but it does not return the entire…
Abi Hassen
  • 23
  • 2
2
votes
1 answer

Open Refine--create new column by looking up values from a pair of columns

I have a table in OpenRefine with columns A, B, and C like this: A | B | C | D ---|---|---|--- a | 1 | b | 2 b | 2 | | c | 3 | a | 1 d | 4 | c | 3 I want to create a column D by fetching the values from B corresponding to those in C, using…
Will Hanley
  • 457
  • 3
  • 16
2
votes
2 answers

OpenRefine: select value based on a variable another column

I have a problem with OpenRefine. I am adding a new column based on a url and from there calling an API for getting some terms from a controlled vocabulary (AAT). I parse the results and I obtain a multivalued cells such…
K3it4r0
  • 195
  • 12
1
vote
1 answer

How to do a for loop in openrefine

I'm using OpenRefine to manage some data. I have a column named "Country" that has countries around the world. However,some values are some states names of U.S instead of "United States". I want to change them to a single value "United States". This…
gggjackie
  • 63
  • 7
1
vote
2 answers

Extracting skos:closeMatch from RDF/XML using GREL in OpenRefine

This is a picture of my OpenRefine project. I need to extract all the instances of skos:CloseMacth URIs from an RDF/XML column into a separate column in OpenRefine. This is my RDF/XML code:
Zayn Sab
  • 13
  • 3
1
2 3 4 5