Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

JSON error for /package endpoint #1149

Closed Woseseltops closed 8 months ago

Woseseltops commented 8 months ago

ELAN dev Divya Kanekal reports that API endpoint https://signbank.cls.ru.nl/dictionary/package/?&dataset_name=tstMH doesn't work anymore, and I can confirm... I suspect there is something wrong with an individual gloss

image

susanodd commented 8 months ago

@rem0g I've added functionality on the Dataset Manager page to upload a zip file to the location 'dictionary/import_videos/TEMP'

The idea is that the uploaded zip file will have a name to match the dataset. (So far, it's the same name as the uploaded file.)

(This is not deployed yet. It will need to be put on the development server first, so we can confirm that is works correctly.))

If nothing is done to the original filename during uploading, it would just overwrite an existing one. Or we could just leave the zipped files there as archives, then the manager can just upload new zips. (Not sure what to do yet, if we want this to become a full-fledged feature.)

The uploaded name will probably need to resemble the expanded folder structure for the dataset, so it can just be unzipped into the upload location.

I'll work on an unzip command next.

Then you will be able to apply the batch command to the unzipped files.

I'm thinking there may be a need for feedback with this for the Dataset Manager, otherwise it's not clear if it worked. I have it so it prints a success message after uploading the zip file. But it needs to be checked also during an unzip. I'll make the actual batch import command more user friendly. (It's not an actual template, it just outputs a table and actually prints a log, which is kind of useless for the end user.)

susanodd commented 8 months ago

@rem0g do you need the video upload functionality to be available via the api with json? At the moment, I put the url / button in the Dataset Manager page. (Not online yet.) But probably there needs to be a totally separate page/template for this under the Dataset menu. If I design it that way and make it so one dataset can be manipulated at a time, then I can design the urls in such a way that they can be json friendly, with the dataset id in the url. But for viewing feedback from the command, such as a list of videos, a page would be nicer. Or both ways.

rem0g commented 8 months ago

It would be good if it can be done via JSON and have response back with JSON whether upload/update/insert is succeeded with Glos ID so the platform can have a proper callback.

Woseseltops commented 8 months ago

Hey @susanodd , let's keep this issue strictly about problems with the /package endpoint, so if it's okay with you, I have changed the issue name back to the original. If you feel that part is fixed, let's close this issue.

All discussion about new API endpoints can be done in #1152, and given the length of the discussion, perhaps it's better to split it up into multiple issues.

susanodd commented 8 months ago

Yes, that part is fixed. @Jetske corresponded with the person and the fields are fine again.

susanodd commented 8 months ago

I got a bit side-tracked and posted in this issue because it started with the same url, but it was zipped instead of json, etc.

You can close this issue then.

Woseseltops commented 8 months ago

Great, thanks

rem0g commented 8 months ago

@rem0g Here is the first version:

https://signbank.cls.ru.nl/dictionary/get_gloss_data/5/4681/

That's elephant.

Because it's public, you can also view it anonymously, but see fewer fields.

The "5" is the dataset ID for NGT

It doesn't take any parameters other than those in the url. As mentioned above, if the ids are messed up, it returns nothing.

We will need all glosses in that json format in one file, can you make an api endpoint for that?

Thanks

susanodd commented 8 months ago

@rem0g Okay, sure. I'll add that. I summarized the current API in the API wiki. (@Woseseltops asked for that.)

So this will be the same as the zipped package version, but not zipped, and containing all the glosses.

The upload for a zip video archive is nearly done. I checked it for Apple and a home computer. To my surprise, I need to modify a lot. I'll put details in the wiki when it's ready, since it was difficult to get it to accept the file that's on your own computer. We'll need to also check this for Windows zips. (The Apple zips have invisible files .DS_Store in all the folders. It skips those now.)

rem0g commented 8 months ago

Great, thank you. I also want to know requirements/limits of the video upload, like size, resolution, filetype in the Wiki.