Open bansp opened 4 months ago
@margaretha this is one of the commits I mentioned as needing your eye for a check if everything is idiomatic, etc.
For example, I've noticed we have a conflict of naming styles and I tried to adjust to your practice (so I used $registry-links instead of $registryLinks or $registry_links; the last one being my favourite but I think no one uses that any longer, so I usually go for the Java style).
But I'm a bit afraid that I have let javaStyled naming slip in, at a few places, elsewhere... :-\
In order to be more precise about registryLink, two examples follow.
<centre id="ZIM" deposition="1">
<name>ZIM Centre for Information Modelling</name>
<registryLink registry="CLARIN" uri="https://centres.clarin.eu/centre/65"/>
<nodeInfo>
<ri status="B-centre">CLARIN</ri>
</nodeInfo>
</centre>
First, a simple one, with a minimal modification of the <a>
. The content of the attribute @registry
and of the element <ri>
is controlled by the same closed set of values. Now, a more complex case:
<centre id="CLARIN-CH" deposition="1">
<name>CLARIN Switzerland</name>
<registryLink registry="CLARIN" uri="https://centres.clarin.eu/centre/80" label="CLARIN-CH-LiRI"/>
<registryLink registry="CLARIN" uri="https://centres.clarin.eu/centre/81" label="CLARIN-CH-LaRS"/>
<nodeInfo>
<ri status="B-centre">CLARIN</ri>
</nodeInfo>
</centre>
The recommendations for CLARIN-CH put two centres onto a single list, because, from the perspective of the SIS, these centres share everything except their CLARIN registry link and the associated name.
Partial visualisation logic is added in the commit linked above: it produces a list if there is more than one registryLink, and if the optional attribute @label
is present, it prints it out.
What remains to be done is possibly:
<div>
and repeating the existing functionality in the inner <div>
(s)Note that points (1) and (2) are, for the time being, moot.
The only relevant point is (3), and that may be a matter of a single function that returns 1 by default but for centres like CLARIN-CH, it returns the number of registryLink
s that have the same @registry
. ("What if the structure gets complicated and we have a single file for two CLARIN centres that are at the same 3 DARIAH centres", you ask. I reply: that is simply not going to happen, because in such cases, we would simply split the representation into individual centres.)
A variant of (3):
where
a centre has more than one registryLink (or more than one registryLink/@label
, maybe), use the labels as separate centre names for various lists (with all the rest of info duplicated)Update: a registry for Text+ has been created, link follows shortly...
Some of the cases that would need to be enriched with an indirection mechanism, to count centres as two (or more) depending on the number of labelled registryLink
s.
In model/recommendation-by-centre.xqm
, we have:
declare variable $recommendation:centres := collection('/db/apps/clarin/data/recommendations')/recommendation;
In modules/centre.xql
, there is this:
declare function cm:count-number-of-centres-with-recommendations($centres) {
let $centre-with-recommendations :=
for $c in $centres
let $recommendations := cm:get-recommendations(data($c/@id))
let $numOfRecommendations := count($recommendations/formats/format)
return
if ($numOfRecommendations > 0)
then
1
else
0
return
sum($centre-with-recommendations)
};
I have turned
<a>
intoregistryLink
with some extra attributes, and while this is now handled for multiple links to the same registry, in a single RI (commit forthcoming), we need to extend this to cases where a centre is listed by more than one RI.This is not so distant; for now, I was simply unable to locate Text+ or DARIAH centre/repository registries, or I would have added references to them where appropriate.