dracor-org/dracor-api

scene information for characters

rjoberon opened this issue · 3 comments

It would be great if there would be an endpoint to get characters per scene, or scenes per character (or character ids in /spoken-text). If that's already possible, then https://dracor.org/doc/api should show it (I could not find it, unfortunately).

I think you mean the segmentation function. But I just saw in the API documentation that we're about to retired it, can't remember why and if there's an adequate replacement. (@cmil?)

Anyhow, here's an example.

cmil commented

The basic data for a play (e.g. https://dracor.org/api/corpora/ger/play/lessing-emilia-galotti) provides the scenes with characters in it's segments property. This is virtually the same information as in the .../segmentation endpoint, just in JSON instead of XML, which is why the XML is deprecated. Together with the list of characters in the cast array it should be easy to determine the scenes per character.

As for spoken text, there is the spoken-text-by-character endpoint (e.g. https://dracor.org/api/corpora/ger/play/lessing-emilia-galotti/spoken-text-by-character) which provides each character's spoken text, although not broken down by scene.

How can we improve this?

Thank you all! I had overlooked the segments property. It is exactly what I was looking for. I'll adapt my code accordingly.