Re: [Dspace-tech] How to search items by metadata using REST API?
Hi Kim, For versioning REST API, I'm not sure of a definitive best route to get there. A while back, for a Ruby on Rails project, one way we made a /rest/v1 and a /rest/v2 versions of that REST API, was just make a subfolder v1 and v2, copy and paste our entire v1 code into v2, and then never touch v1 code again, and update the v2 code to become different. I'd imagine jaxrs has some other graceful routes to accomplish this, but the subfolder route is easy-ish to support and understand. But yes. Its growing through evolution. Rather than intelligent design. ;) Peter Dietz Longsight www.longsight.com pe...@longsight.com p: 740-599-5005 x809 On Wed, Jun 17, 2015 at 4:32 AM, Alan Orth alan.o...@gmail.com wrote: That's interesting, Terry. I think I'll just wait until DSpace 5.0 to get the search-by-metadata feature, as there 5.0 is already a high priority for us for a number of other reasons as well! Alan On Tue, Jun 16, 2015 at 2:52 AM Terry Brady terry.br...@georgetown.edu wrote: Alan, The following PR has some code that will search metadata via the API: https://github.com/DSpace/DSpace/pull/954 I am also on 4.3, so this code is compatible with DSpace4.3. Terry On Thu, Jun 11, 2015 at 5:58 AM, Alan Orth alan.o...@gmail.com wrote: Ah, it seems the `/rest/items/find-by-metadata-field` endpoint doesn't exist in DSpace 4.x. Neither does the `/rest/login` endpoint. The docs need to make more of a point to say which versions these are supposed to work in... ;) Alan On Thu, Jun 11, 2015 at 12:24 PM Alan Orth alan.o...@gmail.com wrote: Thanks. It seems my query is well formed but it returns an HTTP 405 Method Not Allowed response. Perhaps DSpace 4.x's REST API isn't sufficient for the find-by-metadata-field query. Or perhaps I need to log in as you illustrated here: https://github.com/BrunoNZ/dspace-rest-requests I guess I'll fork that repo and give this a more structured test. I already found some syntax and usability bugs there (mixing sh and bash, not reading the sourced variables, etc). Alan On Wed, Jun 10, 2015 at 8:30 PM, Bruno Zanette brunonzane...@gmail.com wrote: Hey Alan, Take a look at the commentaries on the REST-API's documentation's page. I've answered a similar question there. https://wiki.duraspace.org/display/DSDOC5x/REST+API?focusedCommentId=68068154#comment-68068154 But basically, the request that you have to send is something like this: curl -k -4 -H accept: application/json -H Content-Type: application/json -X POST https://demo.dspace.org/rest/items/find-by-metadata-field; -d '{key: dc.title,value: Test Webpage,language: en_US}' Em qua, 10 de jun de 2015 às 14:08, Alan Orth alan.o...@gmail.com escreveu: Hey, I'm using DSpace 4.3 and trying to search for items matching certain metadata. The REST API docs on GitHub[0] mention that you can POST to `rest/items/find-by-metadata-field`, but it doesn't give any more information than that (like how to specify query parameters). I've tried several variations of the following: $ http --print Hhb POST ' http://localhost:8080/rest/items/find-by-metadata-field' dc.subject=LACTATION It always returns with an HTTP 405. What is the proper way to use this? Does the POST require I login first or something? Thanks, [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Terry Brady Applications Programmer Analyst Georgetown University Library Information Technology https://www.library.georgetown.edu/lit/code 425-298-5498 (Seattle, WA) -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette:
Re: [Dspace-tech] How to search items by metadata using REST API?
That's interesting, Terry. I think I'll just wait until DSpace 5.0 to get the search-by-metadata feature, as there 5.0 is already a high priority for us for a number of other reasons as well! Alan On Tue, Jun 16, 2015 at 2:52 AM Terry Brady terry.br...@georgetown.edu wrote: Alan, The following PR has some code that will search metadata via the API: https://github.com/DSpace/DSpace/pull/954 I am also on 4.3, so this code is compatible with DSpace4.3. Terry On Thu, Jun 11, 2015 at 5:58 AM, Alan Orth alan.o...@gmail.com wrote: Ah, it seems the `/rest/items/find-by-metadata-field` endpoint doesn't exist in DSpace 4.x. Neither does the `/rest/login` endpoint. The docs need to make more of a point to say which versions these are supposed to work in... ;) Alan On Thu, Jun 11, 2015 at 12:24 PM Alan Orth alan.o...@gmail.com wrote: Thanks. It seems my query is well formed but it returns an HTTP 405 Method Not Allowed response. Perhaps DSpace 4.x's REST API isn't sufficient for the find-by-metadata-field query. Or perhaps I need to log in as you illustrated here: https://github.com/BrunoNZ/dspace-rest-requests I guess I'll fork that repo and give this a more structured test. I already found some syntax and usability bugs there (mixing sh and bash, not reading the sourced variables, etc). Alan On Wed, Jun 10, 2015 at 8:30 PM, Bruno Zanette brunonzane...@gmail.com wrote: Hey Alan, Take a look at the commentaries on the REST-API's documentation's page. I've answered a similar question there. https://wiki.duraspace.org/display/DSDOC5x/REST+API?focusedCommentId=68068154#comment-68068154 But basically, the request that you have to send is something like this: curl -k -4 -H accept: application/json -H Content-Type: application/json -X POST https://demo.dspace.org/rest/items/find-by-metadata-field; -d '{key: dc.title,value: Test Webpage,language: en_US}' Em qua, 10 de jun de 2015 às 14:08, Alan Orth alan.o...@gmail.com escreveu: Hey, I'm using DSpace 4.3 and trying to search for items matching certain metadata. The REST API docs on GitHub[0] mention that you can POST to `rest/items/find-by-metadata-field`, but it doesn't give any more information than that (like how to specify query parameters). I've tried several variations of the following: $ http --print Hhb POST ' http://localhost:8080/rest/items/find-by-metadata-field' dc.subject=LACTATION It always returns with an HTTP 405. What is the proper way to use this? Does the POST require I login first or something? Thanks, [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Terry Brady Applications Programmer Analyst Georgetown University Library Information Technology https://www.library.georgetown.edu/lit/code 425-298-5498 (Seattle, WA) -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] How to search items by metadata using REST API?
Alan, The following PR has some code that will search metadata via the API: https://github.com/DSpace/DSpace/pull/954 I am also on 4.3, so this code is compatible with DSpace4.3. Terry On Thu, Jun 11, 2015 at 5:58 AM, Alan Orth alan.o...@gmail.com wrote: Ah, it seems the `/rest/items/find-by-metadata-field` endpoint doesn't exist in DSpace 4.x. Neither does the `/rest/login` endpoint. The docs need to make more of a point to say which versions these are supposed to work in... ;) Alan On Thu, Jun 11, 2015 at 12:24 PM Alan Orth alan.o...@gmail.com wrote: Thanks. It seems my query is well formed but it returns an HTTP 405 Method Not Allowed response. Perhaps DSpace 4.x's REST API isn't sufficient for the find-by-metadata-field query. Or perhaps I need to log in as you illustrated here: https://github.com/BrunoNZ/dspace-rest-requests I guess I'll fork that repo and give this a more structured test. I already found some syntax and usability bugs there (mixing sh and bash, not reading the sourced variables, etc). Alan On Wed, Jun 10, 2015 at 8:30 PM, Bruno Zanette brunonzane...@gmail.com wrote: Hey Alan, Take a look at the commentaries on the REST-API's documentation's page. I've answered a similar question there. https://wiki.duraspace.org/display/DSDOC5x/REST+API?focusedCommentId=68068154#comment-68068154 But basically, the request that you have to send is something like this: curl -k -4 -H accept: application/json -H Content-Type: application/json -X POST https://demo.dspace.org/rest/items/find-by-metadata-field; -d '{key: dc.title,value: Test Webpage,language: en_US}' Em qua, 10 de jun de 2015 às 14:08, Alan Orth alan.o...@gmail.com escreveu: Hey, I'm using DSpace 4.3 and trying to search for items matching certain metadata. The REST API docs on GitHub[0] mention that you can POST to `rest/items/find-by-metadata-field`, but it doesn't give any more information than that (like how to specify query parameters). I've tried several variations of the following: $ http --print Hhb POST ' http://localhost:8080/rest/items/find-by-metadata-field' dc.subject=LACTATION It always returns with an HTTP 405. What is the proper way to use this? Does the POST require I login first or something? Thanks, [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Terry Brady Applications Programmer Analyst Georgetown University Library Information Technology https://www.library.georgetown.edu/lit/code 425-298-5498 (Seattle, WA) -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] How to search items by metadata using REST API?
Thanks. It seems my query is well formed but it returns an HTTP 405 Method Not Allowed response. Perhaps DSpace 4.x's REST API isn't sufficient for the find-by-metadata-field query. Or perhaps I need to log in as you illustrated here: https://github.com/BrunoNZ/dspace-rest-requests I guess I'll fork that repo and give this a more structured test. I already found some syntax and usability bugs there (mixing sh and bash, not reading the sourced variables, etc). Alan On Wed, Jun 10, 2015 at 8:30 PM, Bruno Zanette brunonzane...@gmail.com wrote: Hey Alan, Take a look at the commentaries on the REST-API's documentation's page. I've answered a similar question there. https://wiki.duraspace.org/display/DSDOC5x/REST+API?focusedCommentId=68068154#comment-68068154 But basically, the request that you have to send is something like this: curl -k -4 -H accept: application/json -H Content-Type: application/json -X POST https://demo.dspace.org/rest/items/find-by-metadata-field; -d '{key: dc.title,value: Test Webpage,language: en_US}' Em qua, 10 de jun de 2015 às 14:08, Alan Orth alan.o...@gmail.com escreveu: Hey, I'm using DSpace 4.3 and trying to search for items matching certain metadata. The REST API docs on GitHub[0] mention that you can POST to `rest/items/find-by-metadata-field`, but it doesn't give any more information than that (like how to specify query parameters). I've tried several variations of the following: $ http --print Hhb POST ' http://localhost:8080/rest/items/find-by-metadata-field' dc.subject=LACTATION It always returns with an HTTP 405. What is the proper way to use this? Does the POST require I login first or something? Thanks, [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] How to search items by metadata using REST API?
Ah, it seems the `/rest/items/find-by-metadata-field` endpoint doesn't exist in DSpace 4.x. Neither does the `/rest/login` endpoint. The docs need to make more of a point to say which versions these are supposed to work in... ;) Alan On Thu, Jun 11, 2015 at 12:24 PM Alan Orth alan.o...@gmail.com wrote: Thanks. It seems my query is well formed but it returns an HTTP 405 Method Not Allowed response. Perhaps DSpace 4.x's REST API isn't sufficient for the find-by-metadata-field query. Or perhaps I need to log in as you illustrated here: https://github.com/BrunoNZ/dspace-rest-requests I guess I'll fork that repo and give this a more structured test. I already found some syntax and usability bugs there (mixing sh and bash, not reading the sourced variables, etc). Alan On Wed, Jun 10, 2015 at 8:30 PM, Bruno Zanette brunonzane...@gmail.com wrote: Hey Alan, Take a look at the commentaries on the REST-API's documentation's page. I've answered a similar question there. https://wiki.duraspace.org/display/DSDOC5x/REST+API?focusedCommentId=68068154#comment-68068154 But basically, the request that you have to send is something like this: curl -k -4 -H accept: application/json -H Content-Type: application/json -X POST https://demo.dspace.org/rest/items/find-by-metadata-field; -d '{key: dc.title,value: Test Webpage,language: en_US}' Em qua, 10 de jun de 2015 às 14:08, Alan Orth alan.o...@gmail.com escreveu: Hey, I'm using DSpace 4.3 and trying to search for items matching certain metadata. The REST API docs on GitHub[0] mention that you can POST to `rest/items/find-by-metadata-field`, but it doesn't give any more information than that (like how to specify query parameters). I've tried several variations of the following: $ http --print Hhb POST ' http://localhost:8080/rest/items/find-by-metadata-field' dc.subject=LACTATION It always returns with an HTTP 405. What is the proper way to use this? Does the POST require I login first or something? Thanks, [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] How to search items by metadata using REST API?
Hey Alan, Take a look at the commentaries on the REST-API's documentation's page. I've answered a similar question there. https://wiki.duraspace.org/display/DSDOC5x/REST+API?focusedCommentId=68068154#comment-68068154 But basically, the request that you have to send is something like this: curl -k -4 -H accept: application/json -H Content-Type: application/json -X POST https://demo.dspace.org/rest/items/find-by-metadata-field; -d '{key: dc.title,value: Test Webpage,language: en_US}' Em qua, 10 de jun de 2015 às 14:08, Alan Orth alan.o...@gmail.com escreveu: Hey, I'm using DSpace 4.3 and trying to search for items matching certain metadata. The REST API docs on GitHub[0] mention that you can POST to `rest/items/find-by-metadata-field`, but it doesn't give any more information than that (like how to specify query parameters). I've tried several variations of the following: $ http --print Hhb POST ' http://localhost:8080/rest/items/find-by-metadata-field' dc.subject=LACTATION It always returns with an HTTP 405. What is the proper way to use this? Does the POST require I login first or something? Thanks, [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
[Dspace-tech] How to search items by metadata using REST API?
Hey, I'm using DSpace 4.3 and trying to search for items matching certain metadata. The REST API docs on GitHub[0] mention that you can POST to `rest/items/find-by-metadata-field`, but it doesn't give any more information than that (like how to specify query parameters). I've tried several variations of the following: $ http --print Hhb POST ' http://localhost:8080/rest/items/find-by-metadata-field' dc.subject=LACTATION It always returns with an HTTP 405. What is the proper way to use this? Does the POST require I login first or something? Thanks, [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest -- Alan Orth alan.o...@gmail.com https://alaninkenya.org https://mjanja.ch In heaven all the interesting people are missing. -Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette