This is the text of a message I sent to RonDuPlain. It describes how to query the NRAOpapers! front-end. -- KaiGroner - 05 Dec 2008


I will try to explain how you can get JSON from the NRAOpapers front end.

Briefly:
   search-run.php?mode=simple/complex&... -> redirect to search-result.shtml&searchId=NNN
   search-result.php?searchId=NNN&... -> json

Also:
   paper.php?paperId=ZZZ -> json (or xml or html)

Less brief explanation follows below:

The form (or forms) on this page can be used to construct a query:
   https://safe.nrao.edu/php/library/search.shtml

These forms will submit to:
   https://safe.nrao.edu/php/library/search-run.php?mode=simple&...
   https://safe.nrao.edu/php/library/search-run.php?mode=complex&...

The simple search uses a MySQL fulltext index, so it matches words,
etc.  Making a query for that by hand is pretty straight forward.  You can
use this as a template:

   https://safe.nrao.edu/php/library/search-run.php?mode=simple&keywords=&keywords-mode=&authors=&authors-mode&=years-from&=years-until

   keywords-mode can be ANY/ALL/EXACT
   keywords allows "quoted terms" and -negations
   authors-mode can be ANY/ALL
   authors allows "quoted terms" and -negations

Off hand, I think I made it so you can leave off fields you don't use,
but its been a while so I could be mistaken.

For the complex form, you may find it useful to use the form to build a
query and then use firebug to see the submission (which otherwise
vanishes in a puff of redirect).

The complex form allows more field specific queries, here is the breakdown:

   https://safe.nrao.edu/php/library/search-run.php?mode=complex&...

   ... is a sequence of queries made up of 5 fields:
   search-combinator0 can be AND/OR
   search-negator0 can be NOT (or nothing)
   search-field0 can be one of the fields seen in the select box on search.shtml
   search-op0 can be one of the operators seen in the select box on search.shtml
   search-parameter0[] can be 0 or more operands depending on the operator

   You can then combine those with search-combinator1, search-negator1, etc.

On submitting either request, you will get a redirect to search-result.shtml#searchId=NNN&paperId= or to no-result.php

Save NNN.  Now you can query search-result.php?searchId=NNN&n=..., parameters:

   searchId=NNN
   order=one of these
> 'FirstAuthor',
> 'AuthorName',
> 'Title',
> 'PubYear',
> 'journal',
> 'Volume',
> 'CitationCount',
> 'Pages',
> 'Refereed',
> 'BibCode',
> 'PublicComment',
> 'ProgramId',
> 'InstrumentId',
> 'sortTitle'
>
   dir=up/down
   start=row number, defaults to 0
   n=how many rows, the maximum is 1000 right now, but that can be changed

   The searchId is expired after 1 hour with no activity.

   The results are JSON, I guess they should be self explanatory.

You can also query paper.php?paperId=ZZZ&as=json/xml/html

If you have any questions, don't hesitate to ask.  You can also poke around the
source if you prefer:

   http://libtest.nrao.edu/cgit/cgit.cgi?url=papers-fe/tree/www


Topic revision: r1 - 2008-12-05, KaiGroner
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback