示例#1
0
    def setUp(self):
        self.NAME = 'ora_solr'
        self.END = Ora().ENDPOINT
        self.FIELD = 'author'
        # We are going to use the following thesis as our test item.
        # http://ora.ox.ac.uk/objects/uuid:83530474-369e-417b-a8db-ac06ebf42c84
        self.AUTHOR = 'cummings'
        self.TITLE = 'neural control of convergence eye movements'
        self.EID = '83530474-369e-417b-a8db-ac06ebf42c84'
        self.SEARCH = fetch.Search(self.NAME)
        self.DATEFIELD = 'timestamp'
        self.EDATE = '2013-01-21'
        self.ETIME = '11:14:22.227Z'
        self.EDATETIME = '%sT%s' % (self.EDATE, self.ETIME)
        self.JOINER = '&'

        # These expected value might change. Correct as of 18th July 2013
        # The total expected is due to ORA defaulting return 10 rows.
        self.TOTAL_EXPECTED = 10
        self.ROWS_EXPECTED = 2
        self.DOCS_EXPECTED = 334
        self.TITLE_NOQUOTES_EXPECTED = 112100
        self.TOTAL_DATERANGE = 250
        # Total until able to explain why it has changed.
        self.TOTAL_DATERANGE = 248
示例#2
0
 def setUp(self):
     self.NAME = 'plos_test'
     p = Plos()
     self.END = p.ENDPOINT
     self.KEY = p.KEY
     self.URL_API_KEY = p.URL_KEY_FIELD
     self.SEARCH = fetch.Search(self.NAME)
示例#3
0
 def setUp(self):
     self.NAME = 'ora_solr_idlist'
     self.END = Ora().ENDPOINT
     self.FIELD = 'recordContentSource'
     self.VALUE = 'polonsky'
     # Did a visual check of ORA to confirm this id is from the source above.
     self.CHECK_ID = 'uuid:278c6978-9421-46af-af61-a062a2044591'
     self.SEARCH = fetch.Search(self.NAME)
     self.TOTAL_EXPECTED = 1242
示例#4
0
 def _fetch_ids(self):
     '''Obtain the IDs for the items we want to get totals for.'''
     start = time.time()
     search = fetch.Search('IDs fetching')
     ids, log = search.auto_list_ids(self.ENDPOINT, self.VALUE, self.FIELD)
     self.REPORT_METHOD.update(log)
     self.RAW_IDS = ids
     self.REPORT_METHOD['3a. Seconds taken to find IDs'] = time.time(
     ) - start
示例#5
0
 def data_loader(self, year, month, day):
     '''Return the total of items with the same year, month and day.'''
     self.SEARCH = fetch.Search(self.NAME)
     self.SEARCH.set_endpoint(self.END)
     # We might as well reduce the amount of data returned
     self.SEARCH.set_rows(2) # only two items
     self.SEARCH.set_field_getlist(('id',self.FIELD)) # and two fields
     # This data loader requires us to restrict the search by date       
     wanted = self.SEARCH.format_date(year, month, day)
     self.SEARCH.query_daterange(self.FIELD, wanted, wanted)
     
     # Now can get the data.
     if self.ENABLE_GET_DOCUMENTS:
         unused = self.SEARCH.get_documents() # execute the query 
         return self.SEARCH.DOCS_FOUND
     else: # simulate with obviously wrong numbers
         return year+month+day+10000
示例#6
0
    def setUp(self):
        self.NAME = 'dfinder_solr'
        self.END = Datafinder8000().ENDPOINT
        self.FIELD = 'silo'
        # We are going to use the following thesis as our test item.
        self.SILO = 'eprints'
        self.DATEFIELD = 'timestamp'
        self.TID = 'oai:generic-eprints-org:774'
        self.EDATE = '2012-08-21'
        self.ETIME = '15:13:33.521Z'
        self.DATEEMBARG = '2082-08-21'

        self.SEARCH = fetch.Search(self.NAME)

        # These expected results are correct as of 3rd September 2013
        self.EXPECTED_TOTAL = 331
        self.EXPECTED_DATERANGE_TOTAL = 1814
        self.EXPECTED_EMBARG_TOTAL = 175
示例#7
0
    def setUp(self):
        self.NAME = 'plos_solr'
        p = Plos()
        self.END = p.ENDPOINT
        self.KEY = p.KEY
        self.URL_API_KEY = p.URL_KEY_FIELD
        self.AUTHOR = 'Majlender'
        self.AUTHOR2 = 'Welling'
        self.AUTHOR_NONASCII = u"Björk"
        self.TITLE = 'Open Access to the Scientific Journal Literature'
        self.EID = "10.1371/journal.pone.0011273"
        self.DATEFIELD = 'publication_date'
        self.EDATE = '2010-06-23'
        self.ETIME = '00:00:00Z'
        self.EDATETIME = '%sT%s' % (self.EDATE, self.ETIME)
        self.SEARCH = fetch.Search(self.NAME)
        self.JOINER = p.AND_JOINER

        # These expected value might change. Correct as
        self.DOCS_EXPECTED = 8  #of 26th July 2013
        self.DATE_EXPECTED = 259
示例#8
0
 def setUp(self):
     self.NAME = 'ora_solr'
     self.END = Ora().ENDPOINT
     self.FIELD = 'author'
     self.AUTHOR = 'cummings'
     self.SEARCH = fetch.Search(self.NAME)