Skip to content

Add dutil function to get distinct speaker labels of a single character #340

@ingoboerner

Description

@ingoboerner

I am interested in attaching the unique speaker labels to the character in the RDF rendering by getting distinct-values of the string value in <speaker>. I implemented this in the rdf.xqm which is probably not the best idea because this makes re-using this function much harder.
Consider adding a function to util.xqm:

let $distinct-speaker-labels := $play//tei:sp[@who eq "#" || $character-item?id]/tei:speaker/string()  => for-each(function($label) { replace($label, '\.$', '') }) => distinct-values() 

This results in normalizing "EMILIA" and EMILIA. to a unique value EMILIA, but includes "ODOARDO" and "ODOARDO GALOTTI" as distinct labels.

Consider setting up a range index on the sp[@who] attribute value to speed up the lookup of @who eq "#" || $character-item?id.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions