lucaswerkmeister / tool-lexeme-forms

Wikidata tool to create lexemes with pre-populated forms (e. g. declensions or conjugations)
https://lexeme-forms.toolforge.org/
Other
11 stars 7 forks source link

Support passing data through Lexeme Forms to the newly-created lexeme #54

Closed nikkiwd closed 3 years ago

nikkiwd commented 3 years ago

When prefilling fields, there is often extra information we already have that we want to add to the lexeme, e.g. external identifiers. Lexeme Forms only supports adding forms and there is no plan to change that, therefore it would be nice if Lexeme Forms would support passing some data through unchanged in some way which could then be used by scripts on-wiki.

My suggestion would be a parameter which appends its value as the hash when loading the newly-created lexeme, e.g. /template/language-pos/?form_representation=form1&append=mydata/wiki/Lexeme:L123456#mydata

lucaswerkmeister commented 3 years ago

Hm, that sounds acceptable to me, but why a hash? To me a URL parameter would make more sense: /template/X/?extra=ABC/wiki/Lexeme:X?lexeme-forms-extra=ABC

(I guess one reason would be that the tool currently links/redirects to the /entity/ URI, and the redirect from there to the lexeme page doesn’t preserve arbitrary URL parameters – but I would just fix that by pointing directly to the page URL. I don’t think there’s actually a good reason to link/redirect to the URI.)

lucaswerkmeister commented 3 years ago

Hm, on the other hand – for the redirect case, we currently use HTTP 303, which Wikipedia describes as:

The response to the request can be found under another URI using the GET method. When received in response to a POST (or PUT/DELETE), the client should presume that the server has received the data and should issue a new GET request to the given URI.

So maybe having a URI there makes sense after all.

nikkiwd commented 3 years ago

I thought a hash might be nicer because afaik the data wouldn't get sent to the server when loading the page that way. I'm not really bothered either way though, I just want the data available in some way. :smile:

I don't really follow why the 303 would mean it makes more sense to link to the URI.