RDFLib / prez-ui

BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Setting of broader correctly #111

Closed hjohns closed 1 year ago

hjohns commented 1 year ago

Sometimes the setting of broader happens too late when processing the concept hierarchy.

A work around could be to set the broader attribute in an initial sweep before building the concept tree in getAllConcepts().

    let conceptsList: Concept[] = [];
    conceptArray.forEach(c => {
        if (c.narrower!.length > 0) {
            c.narrower!.forEach(n => {
                conceptArray[indexMap[n]].broader = c.iri;
            });
        }

    });