Hi,

We're trying to build an application that uses metadata from DSpace's REST
API and I'm having some issues. We're testing on DSpace 5.5 with PostgreSQL.

First, it seems there is no way to use a wildcard value with the
find-by-metadata-field endpoint—I want all items where a field
`cg.subject.ilri` exists. Second, for another query, I'm not sure that the
API is returning the correct results. Taking into account the text_lang of
the metadata, the following database queries and REST API results don't add
up. Here are the database results for null, blank, and en_US text_lang
values:

dspace=# select count(text_value) from metadatavalue where
resource_type_id=2 and metadata_field_id=203 and text_value='SEEDS' and
text_lang is null;
 count
-------
    15
dspace=# select count(text_value) from metadatavalue where
resource_type_id=2 and metadata_field_id=203 and text_value='SEEDS' and
text_lang='';
 count
-------
     4
dspace=# select count(text_value) from metadatavalue where
resource_type_id=2 and metadata_field_id=203 and text_value='SEEDS' and
text_lang='en_US';
 count
-------
    66

Then the API results, in the order of null, blank, and en_US language:

$ curl -s -H "accept: application/json" -H "Content-Type: application/json"
-X POST "http://localhost:8080/rest/items/find-by-metadata-field"; -d
'{"key": "cg.subject.ilri","value": "SEEDS"}' | jq length
55
$ curl -s -H "accept: application/json" -H "Content-Type: application/json"
-X POST "http://localhost:8080/rest/items/find-by-metadata-field"; -d
'{"key": "cg.subject.ilri","value": "SEEDS", "language":""}' | jq length
34
$ curl -s -H "accept: application/json" -H "Content-Type: application/json"
-X POST "http://localhost:8080/rest/items/find-by-metadata-field"; -d
'{"key": "cg.subject.ilri","value": "SEEDS", "language":"en_US"}' | jq
length

The results don't even remotely match, and there are actually more results
from the API than from the database (85 vs 89).

Does anyone know what's up with either of these issues? Thanks,
-- 

Alan Orth
alan.o...@gmail.com
https://englishbulgaria.net
https://alaninkenya.org
https://mjanja.ch

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to