예제 #1
0
    def verify_zero_month_record(self, events):
        event = events[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#AUCTION-EVENT,Br-2646']

        ts = event['timespan']
        self.assertEqual(ts['_label'], '1825-01-28 to 1825-12-28')
        self.assertEqual(ts['begin_of_the_begin'], '1825-01-28T00:00:00Z')
        self.assertEqual(ts['end_of_the_end'], '1825-12-29T00:00:00Z')
        self.assertEqual(classified_identifiers(ts), {None: '1825-00-28'})
예제 #2
0
    def verify_zero_day_record(self, events):
        event = events[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#AUCTION-EVENT,B-197-A']

        ts = event['timespan']
        self.assertEqual(ts['_label'], '1811-09')
        self.assertEqual(ts['begin_of_the_begin'], '1811-09-01T00:00:00Z')
        self.assertEqual(ts['end_of_the_end'], '1811-10-01T00:00:00Z')
        self.assertEqual(classified_identifiers(ts), {None: '1811-09-00'})
예제 #3
0
    def test_modeling_ar48(self):
        '''
        AR-48: Update modeling of Knoedler records to use book/page/row number identifiers
        '''
        output = self.run_pipeline('ar48')
        lo = output['model-lo']
        objects = output['model-object']

        phys_book = objects[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:knoedler#Book,3']

        text_book = lo[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:knoedler#Text,Book,3']
        text_page = lo[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:knoedler#Text,Book,3,Page,20']
        text_row = lo[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:knoedler#Text,Book,3,Page,20,Row,42']

        # Test the physical object records
        self.assertDictContainsSubset(
            {
                'Title': 'Knoedler Stock Book 3',
                'Book Number': '3'
            }, classified_identifiers(phys_book))

        # Test the linguistic object records
        self.assertDictContainsSubset(
            {
                'Title': 'Knoedler Stock Book 3',
                'Book Number': '3',
            }, classified_identifiers(text_book))
        self.assertDictContainsSubset(
            {
                'Title': 'Knoedler Stock Book 3, Page 20',
                'Page Number': '20',
            }, classified_identifiers(text_page))
        self.assertDictContainsSubset(
            {
                'Title': 'Knoedler Stock Book 3, Page 20, Row 42',
                'Entry Number': '42',
                'STAR Identifier': '44301',
            }, classified_identifiers(text_row))
예제 #4
0
    def test_modeling_ar38(self):
        output = self.run_pipeline('ar38')

        objects = output['model-object']
        obj = objects[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:knoedler#Object,2391']

        self.assertEqual(classified_identifiers(obj), {
            'Stock Number': '2391',
            'Title': 'Head of young girl',
        })
예제 #5
0
    def test_modeling_ar39(self):
        '''
        AR-39: Ensure names of stock books and auction catalogs match "Sale Catalog" style
        '''
        output = self.run_pipeline('ar39')
        lo = output['model-lo']
        objects = output['model-object']

        # Catalog Textual Works
        expected_br = 'Sale Catalog Br-1544'
        cat_br = lo[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#CATALOG,Br-1544']
        self.assertEqual(cat_br['_label'], expected_br)
        self.assertEqual(classified_identifiers(cat_br)[None], expected_br)

        expected_sc = 'Sale Catalog SC-A40'
        cat_sc = lo[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#CATALOG,SC-A40']
        self.assertEqual(cat_sc['_label'], expected_sc)
        self.assertEqual(classified_identifiers(cat_sc)[None], expected_sc)

        expected_d = 'Sale Catalog D-A50'
        cat_d = lo[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#CATALOG,D-A50']
        self.assertEqual(cat_d['_label'], expected_d)
        self.assertEqual(classified_identifiers(cat_d)[None], expected_d)

        # Physical Catalogs
        expected_br_bib = 'Sale Catalog Br-1544, owned by “BIB”'
        phy_bib = objects[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#PHYS-CAT,Br-1544,BIB']
        self.assertEqual(phy_bib['_label'], expected_br_bib)
        self.assertEqual(
            classified_identifiers(phy_bib)[None], expected_br_bib)

        expected_br_val = 'Sale Catalog Br-1544, owned by “VAL”'
        phy_val = objects[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#PHYS-CAT,Br-1544,VAL']
        self.assertEqual(phy_val['_label'], expected_br_val)
        self.assertEqual(
            classified_identifiers(phy_val)[None], expected_br_val)
예제 #6
0
    def test_modeling_ar41(self):
        '''
        AR-41: Stub Records generated in ETL for "copy after" are missing title
        '''
        output = self.run_pipeline('ar41')
        objects = output['model-object']

        obj = objects[
            'tag:getty.edu,2019:digital:pipeline:REPLACE-WITH-UUID:sales#OBJ,B-213,0005,1813-02-22-Original']
        self.assertEquals(
            classified_identifiers(obj),
            {'Constructed Title': '[Work] by RUBENS, PETER PAUL'})

        production = obj['produced_by']
        parts = production['part']
        self.assertEquals(len(parts), 1)
        part = parts[0]
        artists = part['carried_out_by']
        self.assertEquals(len(artists), 1)
        artist = artists[0]
        self.assertEquals(artist['_label'], 'RUBENS, PETER PAUL')