Merge of items gives error "Source item id is required"
When merging items, we got for some items the error Source item id is required because source was matched with '{Source}' by Accessible at Url.
Looking for the reason, I found out, that when merging an item the algorithm is looking for possible existing sources based on the host of the first accessibleAt-value. If it finds such a value, it will raise the error. In our example, we had a GitHub-URL as accessibleAt-value. As there already exists a source also having a GitHub-URL as source-URL, the mentioned error raises. I also tried it out with a Zotero-URL for accessibleAt, as we also have a source-URL referencing Zotero. The same error occurs. The problem raises, because the algorithm is only comparing the host-part of the URLs.
Have a look at https://gitlab.gwdg.de/sshoc/sshoc-marketplace-backend/-/blob/develop/src/main/java/eu/sshopencloud/marketplace/validators/items/ItemFactory.java#L86 where a source is looked for, based on the accessibleAtUri (and it takes only the first as you can see at https://gitlab.gwdg.de/sshoc/sshoc-marketplace-backend/-/blob/develop/src/main/java/eu/sshopencloud/marketplace/validators/items/ItemFactory.java#L83) - as the merged item does not contain a source (see discussion in #97 (closed)) it still looks for the accessibleAt. Based on https://gitlab.gwdg.de/sshoc/sshoc-marketplace-backend/-/blob/develop/src/main/java/eu/sshopencloud/marketplace/validators/sources/SourceFactory.java#L86 it only looks for the hosts. As we have one source with host https://github.com (the source url itself is a full github-URL: https://github.com/clarin-eric/resource-families-html-generator/tree/master/resource_families) we run into the incident, that every merge that has a github-URL on first position of accessibleAt is not possible and raises the mentioned error.
If you like, you can reproduce it, by creating two items, having a github-URL as accessibleAt and trying to merge them. Even worse, when trying it out now this way, I discovered that even creating an item that has only a github-URL in accessibleAt already raises the error. This means, that actually it is not possible to create items that have an accessibleAt-url that shares the same host as any of the source-urls (you can try it with https://www.zotero.org/... or with https://www.cessda.eu/... or one of the other 15 source-urls we currently have). Based on this, I would say that it is major bug that we see here.
Notify @lbarbot @cesare.concordia @edward.gray, @anowak