[3.3] Project Metadata: Missing Columns or Columns Number

47 views
Skip to first unread message

Fran Parras

unread,
Jun 26, 2020, 2:22:29 AM6/26/20
to OpenRefine
Hi Guys,
part of the project metadata I am missing something important, which is the columns or the number of columns, which can helps to leverage additional scenarios through APIs. 

Do you know if I am missing something? or I should be open a new issue requesting this functionality?

I am working now with version 3.3.

Cheers,
Fran

Felix Lohmeier

unread,
Jun 26, 2020, 5:00:00 AM6/26/20
to OpenRefine
Hi Fran,

On Friday, 26 June 2020 08:22:29 UTC+2, Fran Parras wrote:
part of the project metadata I am missing something important, which is the columns or the number of columns, which can helps to leverage additional scenarios through APIs.

Fran Parras

unread,
Jun 26, 2020, 10:04:59 AM6/26/20
to OpenRefine
Thanks Felix.. Do you know if the method get-columns is available in v 3.3? I got a 404

Antonin Delpeuch (lists)

unread,
Jun 26, 2020, 10:09:05 AM6/26/20
to openr...@googlegroups.com
Just to be sure, you will need to adapt Felix's URLs to include a
project id that exists in your OpenRefine workspace.

Other than that, these APIs have not changed for quite a while.

Antonin
> --
> You received this message because you are subscribed to the Google
> Groups "OpenRefine" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openrefine+...@googlegroups.com
> <mailto:openrefine+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openrefine/aca2b0b0-183e-4642-a2e9-b1db4cf00572n%40googlegroups.com
> <https://groups.google.com/d/msgid/openrefine/aca2b0b0-183e-4642-a2e9-b1db4cf00572n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Fran Parras

unread,
Jun 26, 2020, 10:25:28 AM6/26/20
to OpenRefine
get-models works like a charm but get-columns nope really.. let me try with 3.4.. but with 3.3 running in linux that method is not working

Fran Parras

unread,
Jun 26, 2020, 10:27:01 AM6/26/20
to OpenRefine

Fran Parras

unread,
Jun 26, 2020, 10:52:40 AM6/26/20
to OpenRefine
Same problem using 3.4 .. I am using GET in this case.. and v3.4 running in windows I got a 404 and v3.3 running in Linux I got the same.... Can someone test it quickly?

Owen Stephens

unread,
Jun 26, 2020, 10:59:02 AM6/26/20
to OpenRefine
Hi 

I think the API call you need is get-columns-info not get-columns

Best wishes

Owen

Thad Guidry

unread,
Jun 26, 2020, 11:02:12 AM6/26/20
to openr...@googlegroups.com
http://127.0.0.1:3333/command/core/get-columns-info?project=2284080337916

And if you want to know what commands, operations, etc. are supported...
Just look through the controller.js file itself where they are registered.



To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/615ff5cb-f972-43f5-b885-ad52014d8d84n%40googlegroups.com.

Owen Stephens

unread,
Jun 26, 2020, 11:05:20 AM6/26/20
to OpenRefine
Although get-column-info isn't a commonly used API - it was specifically built as a helper for the scatterplot facet. Can you explain what you are trying to do exactly?
Why is get-models not sufficient - as it includes a list of the columns?
For example to get the number of columns I think you can just check the size of the columnModel.columns array?

Best wishes

Owen

Fran Parras

unread,
Jun 26, 2020, 11:09:22 AM6/26/20
to OpenRefine
I am looking to create columns dynamically and move those columns at the end, but you need to provide a fix value for it, calculate the number of the columns is possible but take additional steps for this escenario.

Tom Morris

unread,
Jun 26, 2020, 11:21:57 AM6/26/20
to openr...@googlegroups.com
Of course it's important to remember that the internal client/server protocol is not documented for external use nor guaranteed to be stable.

Tom

Owen Stephens

unread,
Jun 26, 2020, 11:24:23 AM6/26/20
to OpenRefine
There's no API call (as far as I know) that just gives you the number of columns if that's what you need.

I can't see an easier way way to get the number of columns is to use get-models and then get the size of the columns array

Fran Parras

unread,
Jun 26, 2020, 12:43:09 PM6/26/20
to OpenRefine
I know.. anyway thanks so much.. I can contribute to enrich the project metadata adding the number of columns if you guys think could be worthy.

Owen Stephens

unread,
Jun 26, 2020, 3:19:01 PM6/26/20
to OpenRefine
Hi Fran,

I'd suggest that you could create a Github issue for an enhancement that would help you achieve your goals - then we can discuss and decide the right way of approaching it - and if that's then something you can help fix as well that's great.

Link to create a new feature request:

I'd encourage you to describe what you need to achieve as well as a possible solution - for example we could discuss whether it's better to have enhance the "add column" call to add at the start/end of the project rather than necessarily having to return the number of columns and then specify where the column should be added (this is just an example - it may not fit your use case - but if the feature request describes what you want to achieve and why it will help discussion about the best approach).

Best wishes

Owen
Reply all
Reply to author
Forward
0 new messages