Talk:Ifd:searchForConcepts
From dev.ifd-library.org
A Context parameter is needed. An Exception should not be thrown when the result of the search is empty. --Kees Woestenenk
In stead of the Context attribute an optional 'owner' attribute could be added, to allow selection based on the authors.
The language parameter should be an array of language_codes, in stead of IfdLanguages. It is less ambiguous and more flexible to use language_codes; using an array of languages would only work if the library contains a unified and complete list of languages.
This function should return an array of Names in stead of Concepts. A user searches for Names representing concepts, so it would be natural to get back a list of Names contained in the library that fit the search criteria. The next step would then be to get the Concepts associated with a Name. For this, another - already proposed - function is needed: getConceptsWithName. The current function returning an array of concepts enforces a call for getConcept for each concept returned, in order to retieve the Names associated with that Concept, otherwise a user does not know what the Concept stands for. --Kees Woestenenk
Answer: The search function do return names as well as the concepts to which the names belongs. A concept IfdConcept contains not only the concept details but also names, descriptions, etc, and each name in its turn contains language information. The search function works like this: When searching the IFD API looks for all matching names according to the search pattern. For each name hit it looks for the concept that uses that name. Second it retrieves all other names for that concept as well as descriptions and illustrations and wrap the whole thing up in an IfdConcept There is no need for another call to retrieve the names. Therefore I believe there will be no need for the suggested getNames function. --Lars.Bjørkhaug 19:38, 5 September 2006 (CEST)
Currently, the search function only returns a list of Concepts, where for each Concept only the guid is provided. A call to getConcept is needed for each Concept to retrieve additional information, including Names and Descriptions. The search function does not return a list of Names, not even a list of Names assigned to retrieved Concepts; to retrieve Names, additional calls are needed, which is quite time consuming. Even when Names-assigned-to-concepts are retrieved, then this is not the list of Names that is based on the search, because it contains Names as well that do not conform to the search criteria. The getNames function would solve this, or, if my proposal for the search function is followed, the search function would do this when it returns just a list of Names conforming to the serach criteria. Note, that Lars's answer does not discuss my other comments and proposals. --Kees Woestenenk