gbv / jskos-vue

A suite of components and plugins for Vue 3 related to JSKOS.
https://gbv.github.io/jskos-vue/
MIT License
0 stars 1 forks source link

Rename ConceptSearch to ItemSuggest #2

Closed nichtich closed 3 years ago

nichtich commented 3 years ago

The main difference between JSKOS Concept and JSKOS Item is the former can have hierarchical links (narrower, broader...). Searching does not require a hierarchy.

stefandesu commented 3 years ago

Technically inScheme is only a property for JSKOS Concepts, and we are searching inside a scheme. However, since we've been planning to adjust the component so that it is more flexible about how the results are fetched, we can rename it together with that change. We could then also provide an example on how to use ItemSearch to search for vocabularies in the BARTOC database, or something like that.

stefandesu commented 3 years ago

So, I already renamed ConceptSearch to ItemSearch (not yet pushed), and I would like to add two more props to the component. One that optionally indicates which kind of item we're dealing with (concepts or concept schemes) and one function parameter as an alternative to using a cocoda-sdk registry (my suggestion would be that it should be an async function that returns results in OpenSearch Suggest Format).

We might be able to do without the former prop by requiring scheme to be given when searching for concepts. This makes sense because we can't really use a concept without knowing which concept scheme it belongs to. Would this be okay?

Also any suggestions for the function parameter? Maybe something like getResults?

nichtich commented 3 years ago

One that optionally indicates which kind of item we're dealing with (concepts or concept schemes)

:-(

one function parameter as an alternative to using a cocoda-sdk registry (my suggestion would be that it should be an async function that returns results in OpenSearch Suggest Format).

:-)

We might be able to do without the former prop by requiring scheme to be given when searching for concepts. This makes sense because we can't really use a concept without knowing which concept scheme it belongs to. Would this be okay?

Yes, scheme is required to assign found concepts to its concept scheme, so this parameter indicates object type Concept. Otherwise we get object type Item.

Also any suggestions for the function parameter?

Just search?

stefandesu commented 3 years ago

Okay, I change the implementation accordingly. However, I noticed a few more question:

Otherwise we get object type Item.

What does that exactly mean? According to the JSKOS specs, there is no specific type for JSKOS Item. So just an object with property uri?

Also, currently we're focusing on suggestions (OpenSearch Suggest Format and using suggest/vocSuggest with jskos-server). However, the component is called ItemSearch and there might be APIs which do not support /suggest. Should we maybe change the component so that, instead of using OpenSearch Suggest Format, we use an array for the results?

One last thing: At the moment, if registry is given, but scheme is not, we're using vocSuggest for suggestions. Is that okay? In any case, I should clarify this in the documentation.

(The documentation was also updated with more examples: https://gbv.github.io/jskos-vue/dev/components/ItemSearch.html)

stefandesu commented 3 years ago

Some changes to ItemSuggest continued in #14.