addDownloadAux :: Bool -> SPEC_NAME -> LIB_ITEM
addDownloadAux unique j =
  let libPath = deleteQuery j
      query = abbrevQuery j -- this used to be the fragment
      i = case query of
        "" -> j
        "?" -> libPath
        _ : r -> fromMaybe libPath $ parseIRICurie r
  in Download_items (iriLibName i)
    (if unique then UniqueItem i else ItemMaps [ItemNameMap i Nothing])
    $ iriPos i
addDownloadAux :: Bool -> SPEC_NAME -> LIB_ITEM
addDownloadAux unique j =
  let libPath = deleteQuery j
      query = abbrevQuery j -- this used to be the fragment
      i = case query of
        "" -> j
        "?" -> libPath
        _ : r -> fromMaybe libPath $ parseIRICurie r
  in Download_items (iriLibName i)
    (if unique then UniqueItem i else ItemMaps [ItemNameMap i Nothing])
    $ iriPos i
addDownloadAux unique j =
  let libPath = deleteQuery j
      query = abbrevQuery j -- this used to be the fragment
      i = case query of
        "" -> j
        "?" -> libPath
        _ : r -> fromMaybe libPath $ parseIRICurie r
  in Download_items (iriLibName i)
    (if unique then UniqueItem i else ItemMaps [ItemNameMap i Nothing])
    $ iriPos i