I would like to do the same with the Wikidata search engine but it's unclear to me how to adapt Search form to Wikidata search
WBK = import("https://cdn.skypack.dev/wikibase-sdk@7.14.2?min")
wbk = WBK.default({
instance: "https://www.wikidata.org",
sparqlEndpoint: "https://query.wikidata.org/sparql"
})
viewof entity = SearchForm({
placeholder: "Type to search...",
description: "Choose a Wikidata item",
suggestion: async (text) => {
const url = wbk.searchEntities({ search: "Ingmar Bergman" });
const res = await fetch(url)
.then((d) => d.json())
.then((d) => d.search);
return res[0];
}
})
Do you have any clue?