nfdi4plants / Swate-templates

A collection of templates for Swate (https://github.com/nfdi4plants/Swate).
4 stars 17 forks source link

[BUG] Found ER_Tags as Tags in Swate #106

Closed Freymaurer closed 6 months ago

Freymaurer commented 7 months ago

This image lead me to open this issue:

image

In my opinion we should avoid recycling ER_Tags as Tags to reduce visual clutter and don't make the user question why they can click on ER_Tag or Tag PRIDE.

Below you can find a summary of templates with this issue:

Found ER_Tags as tag PRIDE in:

Code

// .fsx file

#r "nuget: ARCtrl, 1.0.7"

let templates = 
  ARCtrl.Template.Web.getTemplates None |> Async.RunSynchronously

let ER_Tags = ARCtrl.Template.Templates.getDistinctEndpointRepositories (templates)
let Tags = ARCtrl.Template.Templates.getDistinctTags (templates)
ER_Tags.Length // 10
Tags.Length //102

// These are ER_Tags also used as Tags
let ER_TagsAsTags = Tags |> Array.filter (fun tag -> ER_Tags |> Array.contains tag)

for (tag) in ER_TagsAsTags do
  let temps = ARCtrl.Template.Templates.filterByOntologyAnnotation ([|tag|]) templates
  printfn "## Found ER_Tags as tag `%s` in:" tag.NameText
  for template in temps do 
    let authors = 
      template.Authors 
      |> Array.map (fun a -> 
        let names = [|a.FirstName; a.MidInitials; a.LastName|] |> Array.map (fun n -> Option.defaultValue "" n)
        sprintf "%s %s %s" names.[0] names.[1] names.[2]
      ) 
      |> String.concat ", "
    printfn "- **%s** by (*%s*)" (template.Name.Trim()) (authors.Trim())
StellaEggels commented 7 months ago

For me the question is also if ER tags should be added for templates that don't directly correspond to repositories. Again maybe something to be discussed.