SISS / SISSVoc

SISSVoc is a Linked Data API for accessing published vocabularies.
http://www.sissvoc.info/
GNU Lesser General Public License v3.0
4 stars 2 forks source link

Some queries can return duplicates #5

Closed rwalkerands closed 5 years ago

rwalkerands commented 7 years ago

I filed this issue against the Elda library:

https://github.com/epimorphics/elda/issues/173

But because of LDA spec ambiguity, it's probably not a defect in Elda, but a case where endpoint queries have to be specified a bit more explicitly.

In short: some of the queries in the "off-the-shelf" SISSVoc spec template can return duplicate results. This happens if the SPARQL query can match in multiple ways. The case in point is the /concept?labelcontains={text} endpoint, and you do a search where there's a hit against both a concept's prefLabel and its altLabel.

You'll see in the Elda GitHub issue that I've added a workaround.

The same issue will (probably) apply to all ListEndpoints that are currently implemented using api:where, and which contain a UNION.

jyucsiro commented 7 years ago

Thanks. The workaround looks interesting.

rwalkerands commented 7 years ago

Any thoughts on whether you would/will change the template?

jyucsiro commented 7 years ago

Hi Richard,

Yes, we'd be willing to change the template to fix the duplicate results. Is the proposal to switch from using api:where to api:select using a full SPARQL select query with DISTINCT clause?

rwalkerands commented 7 years ago

Well, it's a proposal.

There seem to be two ways:

  1. Change api:where to api:select, as I did in the example at https://github.com/epimorphics/elda/issues/173#issuecomment-262409344
  2. Force sorting of the results, as per one of the ways given in the section "Ordering" at https://github.com/UKGovLD/linked-data-api/blob/wiki/API_Selecting_Resources.md

For example, compare the results of:

(You wouldn't do it this way (adding the parameter to the URL), but use api:orderBy or api:sort in the template.)

I think I prefer option 1 (use api:select).

rwalkerands commented 7 years ago

Anything going to happen here?

jyucsiro commented 5 years ago

Looking into this a bit now that elda is up to date. See PR #9 for some changes.

jyucsiro commented 5 years ago

Rolled into release v3.6-rc-3.