diff --git a/ref/MER/MERB-aliases.csv b/ref/MER/MERB-aliases.csv new file mode 100644 index 00000000..cc16bf94 --- /dev/null +++ b/ref/MER/MERB-aliases.csv @@ -0,0 +1,140 @@ +Ada,Ada_Crater +Bi,Block_Island +Bernallio,Bernalillo +Berrybowl,Berry_Bowl +Berrybowl_Empty,Berry_Bowl_Empty +Berrybowl_Full,Berry_Bowl_Full +"Berry_Bowl,_Empty",Berry_Bowl_Empty +Boabab,Baobab +Bouncerock,Bounce_Rock +Brian_Choice,Brian's_Choice +Burns,Burns_Formation +Burnsfm,Burns_Formation +Burns_Fm,Burns_Formation +Cape_St_Vincent,Cape_St._Vincent +Capes_Tribulation,Cape_Tribulation +Capes_York,Cape_York +Concepcion,Concepción_Crater +Concepción,Concepción_Crater +Cookies'n_Cream,Cookies_'n_Cream +Cy,Cape_York +Dogpark,Dog_Park +Donald_A_Hall,Donald_A._Hall +Eagle,Eagle_Crater +E_Cann,E._Cann +Endeavor,Endeavour_Crater +Endeavor_Crater,Endeavour_Crater +Endeavour,Endeavour_Crater +Endeavour_Crater's_Rim,Endeavour_Crater_Rim +Endeavour_Rim,Endeavour_Crater_Rim +Endeavour's_Rim,Endeavour_Crater_Rim +Endurance,Endurance_Crater +Erebus,Erebus_Crater +Erebus_Rim,Erebus_Crater_Rim +Espérance,Esperance +Flatrock,Flat_Rock +Fram,Fram_Crater +Fredripple,Fred_Ripple +Fruitbasket,Fruit_Basket +Gallgo,Gallego +Grasberg,Grasberg_Formation +Grasberg_Fm,Grasberg_Formation +Greeley_Haven,Greeley_Winter_Haven +Gudalupe,Guadalupe +Harold_M_Bixby,Harold_M._Bixby +Heat_Shield,Heat_Shield_Rock +Heat_Shield_Rock,Heat_Shield_Rock +Heatshield,Heat_Shield_Rock +Heatshield_Rock,Heat_Shield_Rock +Hematrench_1,Hema_Trench_1 +Hematrenchwall_2,Hema_Trench_Wall_2 +Hs,Heat_Shield_Rock +Hsr,Heat_Shield_Rock +Iazu,Iazu_Crater +Intrepid,Intrepid_Crater +Jackrussell,Jack_Russell +Jack_Russel,Jack_Russell +Kaikos,Kaikos_Crater +Kaikos_Cluster,Kaikos_Crater_Cluster +Knudson_Ridge,Knudsen_Ridge +Lemonrind,Lemon_Rind +Lindberg_Mound,Lindbergh_Mound +Lionstone,Lion_Stone +Mackinac,Mackinac_Island +Marathon,Marathon_Valley +Marquette,Marquette_Island +Matiejvic_Formation,Matijevic_Formation +Matijevic,Matijevic_Formation +Matijevic_Fm,Matijevic_Formation +Matijevic_Hills,Matijevic_Hill +Matjevic_Formation,Matijevic_Formation +Matjievic_Formation,Matijevic_Formation +Mckiitrick,Mckittrick +Meridian_Planum,Meridiani_Planum +Meridiani_Plaunum,Meridiani_Planum +Messila,Mesilla +Mi,Mackinac_Island +Mp,Meridiani_Planum +Mr,Murray_Ridge +Murray,Murray_Ridge +Murray_Rudge,Murray_Ridge +Nimrod,Nimrod_Crater +Odyssey,Odyssey_Crater +Oileán,Oileán_Ruaidh +Perseverance,Perseverance_Valley +Pi,Pinnacle_Island +Pinaut,Pierre_Pinaut +Pinnicle_Island,Pinnacle_Island +Purgatory,Purgatory_Dune +Pv,Perseverance_Valley +Realshark_Tooth,Real_Shark_Tooth +Resolution,Resolution_Crater +Resolution_Cluster_Craters,Resolution_Crater_Cluster +Resolution_Cluster,Resolution_Crater_Cluster +Rf,Roosevelt_Field +Rim_Of_Endeavour,Rim_Of_Endeavour_Crater +Roosevelt,Roosevelt_Field +Rub_Al_Khali,Rub_Al_Khali_Plains +Santacatarina,Santa_Catarina +Santa_Maria,Santa_Maria_Crater +Sarcobatus_Clst,Sarcobatus_Clast +Sc,Santa_Catarina +Scf,Sergeant_Charles_Floyd +Sgtcfloyd,Sergeant_Charles_Floyd +Sgtcfloyd_2,Sergeant_Charles_Floyd_2 +Sgtcfloyd_3,Sergeant_Charles_Floyd_3 +Sgt_Charles_Floyd,Sergeant_Charles_Floyd +Sgt._Charles_Floyd,Sergeant_Charles_Floyd +Sgt_Nathaniel_Pryor,Sergeant_Nathaniel_Prior +Sgt._Nathaniel_Pryor,Sergeant_Nathaniel_Prior +Shark_Tooth,Shark's_Tooth +Shelter,Shelter_Island +Shoemaker,Shoemaker_Formation +Shoemaker_Fm,Shoemaker_Formation +Shoemakers_Patio,Shoemaker's_Patio +Si,Shelter_Island +Siahs_Swamp,Siah's_Swamp +Siahs_Swamp_2,Siah's_Swamp_2 +Solander_Pt,Solander_Point +Sosl,Spirit_of_St._Louis_Crater +Sp,Solander_Point +Spirit_Of_Saint_Louis,Spirit_Of_Saint_Louis_Crater +Spirit_Of_St._Louis,Spirit_Of_Saint_Louis_Crater +Spirit_of_St._Louis_Crater,Spirit_Of_Saint_Louis_Crater +Spongebob_Squidward,Heat_Shield_Rock +Stewart_Island,Stuart_Island +Stuart,Stuart_Island +Sutherland_Pt,Sutherland_Point +Terra_Nova,Terra_Nova_Crater +Tickbush,Tick_Bush +Tickbush_2,Tick_Bush_2 +Tome,Tomé +Trenchwall_2,Hema_Trench_Wall_2 +Vermillion_Cliffs,Vermilion_Cliffs +Victoria,Victoria_Crater +Voskhod,Voskhod_Crater +Vostock,Vostok_Crater +Vostock_Crater,Vostok_Crater +Vostok,Vostok_Crater +Voyager,Voyager_Crater +Wr,Wdowiak_Ridge diff --git a/src/generate_pds4_bundle.py b/src/generate_pds4_bundle.py index ae243aba..1e91a619 100644 --- a/src/generate_pds4_bundle.py +++ b/src/generate_pds4_bundle.py @@ -294,11 +294,14 @@ def create_inventory_files(collection_dir, bundle_template_dir, xml_file_counter = 0 for root, _, file_names in os.walk(collection_dir): for file_name in fnmatch.filter(file_names, '*.xml'): - xml_file_counter += 1 file_path = os.path.join(root, file_name) lid_vid = get_lidvid(file_path) - inventory_csv_file.write('P,%s\r\n' % lid_vid) + # Require that collection name is in lid_vid + # This prevents mer2 files showing up in mer1 inventory + if collection_name in lid_vid: + inventory_csv_file.write('P,%s\r\n' % lid_vid) + xml_file_counter += 1 inventory_csv_file.close() print '[INFO] Create inventory csv file for %s mission: %s' % \ diff --git a/src/ingest_sqlite.py b/src/ingest_sqlite.py index 66b7930f..4490591d 100755 --- a/src/ingest_sqlite.py +++ b/src/ingest_sqlite.py @@ -38,11 +38,11 @@ def read_json(jsonfile, ndocs, year=None, mission=''): else [(r['text'], mission, r['begin'], r['end']) for r in rec['metadata']['ner'] if r['label'] == 'Target']), - # Components are everything other than targets (Element, Mineral) + # Components are one of (Element, Mineral) 'components': ([] if 'ner' not in rec['metadata'].keys() else [(canonical_name(r['text']), r['label']) for r in rec['metadata']['ner'] - if r['label'] != 'Target']), + if r['label'] in ['Element', 'Mineral']]), 'contains': ([] if 'rel' not in rec['metadata'].keys() else [([t for t in r['target_names']], r['target_ids'], diff --git a/src/pds4_bundle_template/bundle_mars_target_encyclopedia.txml b/src/pds4_bundle_template/bundle_mars_target_encyclopedia.txml index 7b5cd9a1..c69e79c1 100644 --- a/src/pds4_bundle_template/bundle_mars_target_encyclopedia.txml +++ b/src/pds4_bundle_template/bundle_mars_target_encyclopedia.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia - 2.0 + 3.1 Mars Target Encyclopedia Database Bundle 1.14.0.0 Product_Bundle @@ -22,6 +22,18 @@ $today + 3.1 + Update aliases and targets tables in data_mer1 collection. + + + + 2022-08-08 + 3.0 + Add data_mer1 collection; minor + updates to the data_mer2 collection. + + + 2022-03-24 2.0 Add data_mer2 collection; added aliases table to data_mpf and data_phx collections. diff --git a/src/pds4_bundle_template/collection_mer1_inventory.txml b/src/pds4_bundle_template/collection_mer1_inventory.txml index a6c6e74c..262cee9c 100644 --- a/src/pds4_bundle_template/collection_mer1_inventory.txml +++ b/src/pds4_bundle_template/collection_mer1_inventory.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/collection_mer2_inventory.txml b/src/pds4_bundle_template/collection_mer2_inventory.txml index 5f083a52..8f131aa9 100644 --- a/src/pds4_bundle_template/collection_mer2_inventory.txml +++ b/src/pds4_bundle_template/collection_mer2_inventory.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2 - 1.0 + 1.1 Mars Target Encyclopedia MER-2 Collection 1.14.0.0 Product_Collection @@ -21,7 +21,14 @@ - $today + 2022-08-08 + 1.1 + Minor updates to contains, documents, + has_property, mentions, properties, sentences, and + targets tables. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/collection_mpf_inventory.txml b/src/pds4_bundle_template/collection_mpf_inventory.txml index 54bbda1a..dc83e5dc 100644 --- a/src/pds4_bundle_template/collection_mpf_inventory.txml +++ b/src/pds4_bundle_template/collection_mpf_inventory.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Add aliases table and use ADS for document metadata. diff --git a/src/pds4_bundle_template/collection_phx_inventory.txml b/src/pds4_bundle_template/collection_phx_inventory.txml index 716990f3..03473c74 100644 --- a/src/pds4_bundle_template/collection_phx_inventory.txml +++ b/src/pds4_bundle_template/collection_phx_inventory.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Add aliases table and use ADS for document metadata. diff --git a/src/pds4_bundle_template/document/collection_document_inventory.txml b/src/pds4_bundle_template/document/collection_document_inventory.txml index a20ad386..f5d193ac 100644 --- a/src/pds4_bundle_template/document/collection_document_inventory.txml +++ b/src/pds4_bundle_template/document/collection_document_inventory.txml @@ -16,7 +16,7 @@ - $today + 2022-03-24 1.3 Add mte_schema.jpg diagram and update readme.txt as needed. diff --git a/src/pds4_bundle_template/document/mte_schema.txml b/src/pds4_bundle_template/document/mte_schema.txml index 4169b7f2..2f8dfe6e 100644 --- a/src/pds4_bundle_template/document/mte_schema.txml +++ b/src/pds4_bundle_template/document/mte_schema.txml @@ -16,7 +16,7 @@ - $today + 2022-03-24 1.0 Initial version. @@ -108,7 +108,7 @@ Mars Target Encyclopedia Schema Diagram - $today + 2022-03-24 Version 1.0 English diff --git a/src/pds4_bundle_template/document/readme.txml b/src/pds4_bundle_template/document/readme.txml index f7f0026b..bb918c90 100644 --- a/src/pds4_bundle_template/document/readme.txml +++ b/src/pds4_bundle_template/document/readme.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:document:readme - 1.3 + 1.4 README of Mars Target Encyclopedia 1.14.0.0 Product_Document @@ -16,7 +16,12 @@ - $today + 2022-08-08 + 1.4 + Mention new MER-1 (Opportunity) content. + + + 2022-03-24 1.3 Add description of aliases table, pointer to schema diagram, and inclusion of MER-2 @@ -123,9 +128,9 @@ README of Mars Target Encyclopedia - $today + 2022-08-08 - Version 1.3 + Version 1.4 English 1 diff --git a/src/pds4_bundle_template/document/readme.txt b/src/pds4_bundle_template/document/readme.txt index 029b90e9..d1992f36 100644 --- a/src/pds4_bundle_template/document/readme.txt +++ b/src/pds4_bundle_template/document/readme.txt @@ -40,7 +40,7 @@ visual depiction of the relationships between tables. * The target name, for consistency, encodes spaces as underscores, capitalizes the first letter of each word, and ensures terminal numbers are separated from the name by an underscore. - * The mission code is "mpf", "phx", or "mer2" (Spirit). + * The mission code is "mpf", "phx", "mer1" (Opportunity), or "mer2" (Spirit). * The target id consists of the target name, a hyphen, and the mission code. It allows disambiguation when a target name is used independently by more than one mission. diff --git a/src/pds4_bundle_template/mer1_aliases.txml b/src/pds4_bundle_template/mer1_aliases.txml index 859de90e..f7906dfe 100644 --- a/src/pds4_bundle_template/mer1_aliases.txml +++ b/src/pds4_bundle_template/mer1_aliases.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer1:aliases - 1.0 + 1.1 MTE Mars Exploration Rover Opportunity Aliases Table 1.14.0.0 Product_Observational @@ -26,6 +26,11 @@ $today + 1.1 + Add more aliases. + + + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_components.txml b/src/pds4_bundle_template/mer1_components.txml index 95e18d92..87ddadf5 100644 --- a/src/pds4_bundle_template/mer1_components.txml +++ b/src/pds4_bundle_template/mer1_components.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_contains.txml b/src/pds4_bundle_template/mer1_contains.txml index 12fd23cf..40ab6c6e 100644 --- a/src/pds4_bundle_template/mer1_contains.txml +++ b/src/pds4_bundle_template/mer1_contains.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_documents.txml b/src/pds4_bundle_template/mer1_documents.txml index 27427a7b..ca467105 100644 --- a/src/pds4_bundle_template/mer1_documents.txml +++ b/src/pds4_bundle_template/mer1_documents.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_has_property.txml b/src/pds4_bundle_template/mer1_has_property.txml index 7538e1b4..8e93f6bd 100644 --- a/src/pds4_bundle_template/mer1_has_property.txml +++ b/src/pds4_bundle_template/mer1_has_property.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_mentions.txml b/src/pds4_bundle_template/mer1_mentions.txml index 786d2e94..184c80b2 100644 --- a/src/pds4_bundle_template/mer1_mentions.txml +++ b/src/pds4_bundle_template/mer1_mentions.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_properties.txml b/src/pds4_bundle_template/mer1_properties.txml index ea9890f3..801dbebc 100644 --- a/src/pds4_bundle_template/mer1_properties.txml +++ b/src/pds4_bundle_template/mer1_properties.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_sentences.txml b/src/pds4_bundle_template/mer1_sentences.txml index 8d344c67..49f29daf 100644 --- a/src/pds4_bundle_template/mer1_sentences.txml +++ b/src/pds4_bundle_template/mer1_sentences.txml @@ -21,7 +21,7 @@ - $today + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer1_targets.txml b/src/pds4_bundle_template/mer1_targets.txml index ce277d61..8b203b85 100644 --- a/src/pds4_bundle_template/mer1_targets.txml +++ b/src/pds4_bundle_template/mer1_targets.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer1:targets - 1.0 + 1.1 MTE Mars Exploration Rover Opportunity Targets Table 1.14.0.0 Product_Observational @@ -29,6 +29,12 @@ $today + 1.1 + Add five more targets based on canonical + names added to aliases. + + + 2022-08-08 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_aliases.txml b/src/pds4_bundle_template/mer2_aliases.txml index 84257c7c..5cf2a877 100644 --- a/src/pds4_bundle_template/mer2_aliases.txml +++ b/src/pds4_bundle_template/mer2_aliases.txml @@ -25,7 +25,7 @@ - $today + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_components.txml b/src/pds4_bundle_template/mer2_components.txml index 90ccfe50..e91b8651 100644 --- a/src/pds4_bundle_template/mer2_components.txml +++ b/src/pds4_bundle_template/mer2_components.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_contains.txml b/src/pds4_bundle_template/mer2_contains.txml index f3f7d0de..16773cda 100644 --- a/src/pds4_bundle_template/mer2_contains.txml +++ b/src/pds4_bundle_template/mer2_contains.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2:contains - 1.0 + 1.1 MTE Mars Exploration Rover Spirit Contains Table 1.14.0.0 Product_Observational @@ -21,7 +21,12 @@ - $today + 2022-08-08 + 1.1 + Add one relation. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_documents.txml b/src/pds4_bundle_template/mer2_documents.txml index 084e5027..0c0cb0a7 100644 --- a/src/pds4_bundle_template/mer2_documents.txml +++ b/src/pds4_bundle_template/mer2_documents.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2:documents - 1.0 + 1.1 MTE Mars Exploration Rover Spirit Documents Table 1.14.0.0 Product_Observational @@ -21,7 +21,12 @@ - $today + 2022-08-08 + 1.1 + Remove one document. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_has_property.txml b/src/pds4_bundle_template/mer2_has_property.txml index f4304701..b6b704a5 100644 --- a/src/pds4_bundle_template/mer2_has_property.txml +++ b/src/pds4_bundle_template/mer2_has_property.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2:has_property - 1.0 + 1.1 MTE Mars Exploration Rover Spirit Has_Property Table 1.14.0.0 Product_Observational @@ -21,7 +21,12 @@ - $today + 2022-08-08 + 1.1 + Remove 3 and add 4 relations. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_mentions.txml b/src/pds4_bundle_template/mer2_mentions.txml index 042e15a1..0e03f73c 100644 --- a/src/pds4_bundle_template/mer2_mentions.txml +++ b/src/pds4_bundle_template/mer2_mentions.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2:mentions - 1.0 + 1.1 MTE Mars Exploration Rover Spirit Mentions Table 1.14.0.0 Product_Observational @@ -21,7 +21,12 @@ - $today + 2022-08-08 + 1.1 + Remove 1 and add 6 mentions. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_properties.txml b/src/pds4_bundle_template/mer2_properties.txml index ba93b4d4..7e9b6736 100644 --- a/src/pds4_bundle_template/mer2_properties.txml +++ b/src/pds4_bundle_template/mer2_properties.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2:properties - 1.0 + 1.1 MTE Mars Exploration Rover Spirit Properties Table 1.14.0.0 Product_Observational @@ -21,7 +21,12 @@ - $today + 2022-08-08 + 1.1 + Remove one property. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_sentences.txml b/src/pds4_bundle_template/mer2_sentences.txml index 846f59be..89e2a417 100644 --- a/src/pds4_bundle_template/mer2_sentences.txml +++ b/src/pds4_bundle_template/mer2_sentences.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2:sentences - 1.0 + 1.1 MTE Mars Exploration Rover Spirit Sentences Table 1.14.0.0 Product_Observational @@ -21,7 +21,12 @@ - $today + 2022-08-08 + 1.1 + Remove 1 and add 5 sentences. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mer2_targets.txml b/src/pds4_bundle_template/mer2_targets.txml index 00d4298a..94f253a4 100644 --- a/src/pds4_bundle_template/mer2_targets.txml +++ b/src/pds4_bundle_template/mer2_targets.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_mer2:targets - 1.0 + 1.1 MTE Mars Exploration Rover Spirit Targets Table 1.14.0.0 Product_Observational @@ -28,7 +28,12 @@ - $today + 2022-08-08 + 1.1 + Remove 1 and add 1 target. + + + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mpf_aliases.txml b/src/pds4_bundle_template/mpf_aliases.txml index 647a5596..798afc14 100644 --- a/src/pds4_bundle_template/mpf_aliases.txml +++ b/src/pds4_bundle_template/mpf_aliases.txml @@ -25,7 +25,7 @@ - $today + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/mpf_documents.txml b/src/pds4_bundle_template/mpf_documents.txml index 2e83516d..7f4e9692 100644 --- a/src/pds4_bundle_template/mpf_documents.txml +++ b/src/pds4_bundle_template/mpf_documents.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Use ADS for document meta-data. diff --git a/src/pds4_bundle_template/mpf_has_property.txml b/src/pds4_bundle_template/mpf_has_property.txml index 860763be..c6d22460 100644 --- a/src/pds4_bundle_template/mpf_has_property.txml +++ b/src/pds4_bundle_template/mpf_has_property.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Addition of aliases table enabled use of target names as they appear in the documents. diff --git a/src/pds4_bundle_template/mpf_mentions.txml b/src/pds4_bundle_template/mpf_mentions.txml index afbfe8ec..74a16b64 100644 --- a/src/pds4_bundle_template/mpf_mentions.txml +++ b/src/pds4_bundle_template/mpf_mentions.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Addition of aliases table enabled use of target names as they appear in the documents. diff --git a/src/pds4_bundle_template/mpf_properties.txml b/src/pds4_bundle_template/mpf_properties.txml index a58a4d07..2b9d44cc 100644 --- a/src/pds4_bundle_template/mpf_properties.txml +++ b/src/pds4_bundle_template/mpf_properties.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Remove unnecessary enclosing double quotes. diff --git a/src/pds4_bundle_template/mpf_sentences.txml b/src/pds4_bundle_template/mpf_sentences.txml index 337e8357..7b8c61e1 100644 --- a/src/pds4_bundle_template/mpf_sentences.txml +++ b/src/pds4_bundle_template/mpf_sentences.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Remove unnecessary enclosing double quotes. diff --git a/src/pds4_bundle_template/mpf_targets.txml b/src/pds4_bundle_template/mpf_targets.txml index fce8e1c2..7ab8abfd 100644 --- a/src/pds4_bundle_template/mpf_targets.txml +++ b/src/pds4_bundle_template/mpf_targets.txml @@ -28,7 +28,7 @@ - $today + 2022-03-24 1.3 Addition of aliases table enabled use of target names as they appear in the documents. Targets diff --git a/src/pds4_bundle_template/phx_aliases.txml b/src/pds4_bundle_template/phx_aliases.txml index 84b12b6c..8d98df8e 100644 --- a/src/pds4_bundle_template/phx_aliases.txml +++ b/src/pds4_bundle_template/phx_aliases.txml @@ -25,7 +25,7 @@ - $today + 2022-03-24 1.0 Initial version. diff --git a/src/pds4_bundle_template/phx_contains.txml b/src/pds4_bundle_template/phx_contains.txml index 5c142d2e..e88602d2 100644 --- a/src/pds4_bundle_template/phx_contains.txml +++ b/src/pds4_bundle_template/phx_contains.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Addition of aliases table enabled use of target names as they appear in the documents. diff --git a/src/pds4_bundle_template/phx_documents.txml b/src/pds4_bundle_template/phx_documents.txml index 489d5d96..186bcf3e 100644 --- a/src/pds4_bundle_template/phx_documents.txml +++ b/src/pds4_bundle_template/phx_documents.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Use ADS for document meta-data. diff --git a/src/pds4_bundle_template/phx_has_property.txml b/src/pds4_bundle_template/phx_has_property.txml index 5bdfe4b4..54880feb 100644 --- a/src/pds4_bundle_template/phx_has_property.txml +++ b/src/pds4_bundle_template/phx_has_property.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Addition of aliases table enabled use of target names as they appear in the documents. diff --git a/src/pds4_bundle_template/phx_mentions.txml b/src/pds4_bundle_template/phx_mentions.txml index 879ae43f..21ea6d9a 100644 --- a/src/pds4_bundle_template/phx_mentions.txml +++ b/src/pds4_bundle_template/phx_mentions.txml @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Addition of aliases table enabled use of target names as they appear in the documents. diff --git a/src/pds4_bundle_template/phx_sentences.txml b/src/pds4_bundle_template/phx_sentences.txml index 9d741791..ca349391 100644 --- a/src/pds4_bundle_template/phx_sentences.txml +++ b/src/pds4_bundle_template/phx_sentences.txml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1E00.xsd"> urn:nasa:pds:mars_target_encyclopedia:data_phx:sentences - 1.2 + 1.3 MTE Mars Phoenix Sentences Table 1.14.0.0 Product_Observational @@ -21,7 +21,7 @@ - $today + 2022-03-24 1.3 Remove unnecessary enclosing double quotes. diff --git a/src/pds4_bundle_template/phx_targets.txml b/src/pds4_bundle_template/phx_targets.txml index b9f7f37c..804db2f4 100644 --- a/src/pds4_bundle_template/phx_targets.txml +++ b/src/pds4_bundle_template/phx_targets.txml @@ -28,7 +28,7 @@ - $today + 2022-03-24 1.3 Addition of aliases table enabled use of target names as they appear in the documents. Targets diff --git a/src/update_sqlite.py b/src/update_sqlite.py index 1547d010..2fdbc4cd 100755 --- a/src/update_sqlite.py +++ b/src/update_sqlite.py @@ -9,6 +9,7 @@ import os import sys +import csv from sqlite_mte import MteDb from brat_annotation_sqlite import BratDocument from name_utils import standardize_target_name @@ -105,21 +106,22 @@ def main(ann_dir, db_file, mission, aliases_file, reviewer, remove_orphans, sys.exit(1) with open(aliases_file, 'r') as f: - aliases = f.readlines() - aliases = [a.strip().split(',') for a in aliases] + aliases = csv.reader(f) - for standardized_verbatim_target, canonical_target in aliases: - #print '%s %s' % (standardized_verbatim_target, canonical_target) - mte_db.add_alias(standardized_verbatim_target, - canonical_target.decode('utf8')) + n_aliases = 0 + for standardized_verbatim_target, canonical_target in aliases: + #print '%s %s' % (standardized_verbatim_target, canonical_target) + mte_db.add_alias(standardized_verbatim_target.decode('utf8'), + canonical_target.decode('utf8')) - # Ensure all canonical target names appear in the targets table - mte_db.add_known_target(canonical_target.decode('utf8'), mission) + # Ensure all canonical target names appear in the targets table + mte_db.add_known_target(canonical_target.decode('utf8'), mission) + n_aliases += 1 print '[INFO] The DB aliases table has been populated with ' \ '%d aliases from CSV file %s, and all canonical target names ' \ 'have been added to the target table' % \ - (len(aliases), os.path.abspath(aliases_file)) + (n_aliases, os.path.abspath(aliases_file)) mte_db.close() print '[INFO] DONE.'