mirror of https://github.com/tdwg/dwc.git
WIP: Generate extension for audiovisual core.
Initially reproduce the existing extension.
This commit is contained in:
parent
3ff51687b3
commit
7d4f8fd361
|
@ -11,7 +11,7 @@ github_baseUri = 'https://raw.githubusercontent.com/tdwg/rs.tdwg.org/' + github_
|
||||||
|
|
||||||
# This is a Python list of the database names of the term version lists to be included in the document.
|
# This is a Python list of the database names of the term version lists to be included in the document.
|
||||||
#term_lists = ['iri']
|
#term_lists = ['iri']
|
||||||
term_lists = ['terms', 'iri', 'dc-for-dwc', 'dcterms-for-dwc', 'curatorial', 'dwcore', 'dwctype', 'geospatial']
|
term_lists = ['terms', 'iri', 'dc-for-dwc', 'dcterms-for-dwc', 'curatorial', 'dwcore', 'dwctype', 'geospatial', 'audubon']
|
||||||
|
|
||||||
column_mappings = [
|
column_mappings = [
|
||||||
{'norm': 'iri', 'accum': 'version'},
|
{'norm': 'iri', 'accum': 'version'},
|
||||||
|
@ -55,7 +55,7 @@ for term_list_index in range(len(term_lists)):
|
||||||
accumulated_frame = versions_df.copy()
|
accumulated_frame = versions_df.copy()
|
||||||
else:
|
else:
|
||||||
# append subsequent term lists data to the DataFrame
|
# append subsequent term lists data to the DataFrame
|
||||||
accumulated_frame = accumulated_frame.append(versions_df.copy(), sort=True)
|
accumulated_frame = accumulated_frame._append(versions_df.copy(), sort=True)
|
||||||
|
|
||||||
# Special procedure for obsolete terms
|
# Special procedure for obsolete terms
|
||||||
# Retrieve versions metadata
|
# Retrieve versions metadata
|
||||||
|
@ -81,10 +81,10 @@ for row_index,row in versions_df.iterrows():
|
||||||
# Add the current term IRI from the join data row to the list
|
# Add the current term IRI from the join data row to the list
|
||||||
term_iri_list.append(term_iri_row['term'])
|
term_iri_list.append(term_iri_row['term'])
|
||||||
'''
|
'''
|
||||||
# Add the curren term IRI list to the DataFrame as the term_iri column
|
# Add the current term IRI list to the DataFrame as the term_iri column
|
||||||
versions_df['term_iri'] = term_iri_list
|
versions_df['term_iri'] = term_iri_list
|
||||||
# Add the obsolete terms DataFrame to the accumulated DataFrame
|
# Add the obsolete terms DataFrame to the accumulated DataFrame
|
||||||
accumulated_frame = accumulated_frame.append(versions_df.copy(), sort=True)
|
accumulated_frame = accumulated_frame._append(versions_df.copy(), sort=True)
|
||||||
|
|
||||||
accumulated_frame.reset_index(drop=True, inplace=True) # reset the row indices to consecutive starting with zero
|
accumulated_frame.reset_index(drop=True, inplace=True) # reset the row indices to consecutive starting with zero
|
||||||
accumulated_frame.fillna('', inplace=True) # replace all missing values with empty strings
|
accumulated_frame.fillna('', inplace=True) # replace all missing values with empty strings
|
||||||
|
@ -166,7 +166,7 @@ for qrg_index,qrg_row in qrg_df.iterrows():
|
||||||
for row_index,row in normative_doc_df.iterrows():
|
for row_index,row in normative_doc_df.iterrows():
|
||||||
if (qrg_row['recommended_term_iri'] == row['term_iri']) and (row['status'] == 'recommended'):
|
if (qrg_row['recommended_term_iri'] == row['term_iri']) and (row['status'] == 'recommended'):
|
||||||
found = True
|
found = True
|
||||||
built_rows_df = built_rows_df.append(row)
|
built_rows_df = built_rows_df._append(row)
|
||||||
remaining_rows_df.drop(row['iri'], axis=0, inplace=True)
|
remaining_rows_df.drop(row['iri'], axis=0, inplace=True)
|
||||||
break
|
break
|
||||||
if not found:
|
if not found:
|
||||||
|
@ -178,7 +178,7 @@ sorted_output = remaining_rows_df.iloc[remaining_rows_df.iri.str.lower().argsort
|
||||||
|
|
||||||
# Concatenate ordered terms and remaining versions
|
# Concatenate ordered terms and remaining versions
|
||||||
#normative_doc_df = built_rows_df.append(remaining_rows_df)
|
#normative_doc_df = built_rows_df.append(remaining_rows_df)
|
||||||
normative_doc_df = built_rows_df.append(sorted_output)
|
normative_doc_df = built_rows_df._append(sorted_output)
|
||||||
|
|
||||||
# Save the normative document DataFrame as a CSV
|
# Save the normative document DataFrame as a CSV
|
||||||
normative_doc_df.to_csv('../vocabulary/term_versions.csv', index = False)
|
normative_doc_df.to_csv('../vocabulary/term_versions.csv', index = False)
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<?xml-stylesheet type='text/xsl' href='/style/human.xsl'?>
|
||||||
|
<extension xmlns='http://rs.gbif.org/extension/'
|
||||||
|
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
|
||||||
|
xmlns:dc='http://purl.org/dc/terms/'
|
||||||
|
xsi:schemaLocation='http://rs.gbif.org/extension/ http://rs.gbif.org/schema/extension.xsd'
|
||||||
|
dc:title='Audiovisual Core'
|
||||||
|
name='Multimedia' namespace='http://rs.tdwg.org/ac/terms/'
|
||||||
|
rowType='http://rs.tdwg.org/ac/terms/Multimedia'
|
||||||
|
dc:issued='2024-02-19'
|
||||||
|
dc:relation='http://rs.tdwg.org/ac/doc/termlist/'
|
||||||
|
dc:description='Extended support for Audiovisual records associated with a Darwin Core Occurrence, Event or Taxon core.'>
|
|
@ -0,0 +1,97 @@
|
||||||
|
group,iri,type,thesaurus,description,comments,examples,required
|
||||||
|
Management Vocabulary,http://purl.org/dc/terms/identifier,,,,,,true
|
||||||
|
Management Vocabulary,http://purl.org/dc/elements/1.1/type,,,,,,
|
||||||
|
Management Vocabulary,http://purl.org/dc/terms/type,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/subtypeLiteral,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/subtype,,,,,,
|
||||||
|
Management Vocabulary,http://purl.org/dc/terms/title,,,,,,
|
||||||
|
Management Vocabulary,http://purl.org/dc/terms/modified,,,,,,
|
||||||
|
Management Vocabulary,http://ns.adobe.com/xap/1.0/MetadataDate,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/metadataLanguageLiteral,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/metadataLanguage,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/providerManagedID,,,,,,
|
||||||
|
Management Vocabulary,http://ns.adobe.com/xap/1.0/Rating,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/commenterLiteral,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/commenter,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/comments,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/reviewerLiteral,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/reviewer,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/reviewerComments,,,,,,
|
||||||
|
Management Vocabulary,http://purl.org/dc/terms/available,,,,,,
|
||||||
|
Management Vocabulary,http://rs.tdwg.org/ac/terms/hasServiceAccessPoint,,,,,,
|
||||||
|
Attribution Vocabulary,http://purl.org/dc/elements/1.1/rights,,,,,,
|
||||||
|
Attribution Vocabulary,http://purl.org/dc/terms/rights,,,,,,
|
||||||
|
Attribution Vocabulary,http://ns.adobe.com/xap/1.0/rights/Owner,,,,,,
|
||||||
|
Attribution Vocabulary,http://ns.adobe.com/xap/1.0/rights/UsageTerms,,,,,,
|
||||||
|
Attribution Vocabulary,http://ns.adobe.com/xap/1.0/rights/WebStatement,,,,,,
|
||||||
|
Attribution Vocabulary,http://rs.tdwg.org/ac/terms/licenseLogoURL,,,,,,
|
||||||
|
Attribution Vocabulary,http://ns.adobe.com/photoshop/1.0/Credit,,,,,,
|
||||||
|
Attribution Vocabulary,http://rs.tdwg.org/ac/terms/attributionLogoURL,,,,,,
|
||||||
|
Attribution Vocabulary,http://rs.tdwg.org/ac/terms/attributionLinkURL,,,,,,
|
||||||
|
Attribution Vocabulary,http://rs.tdwg.org/ac/terms/fundingAttribution,,,,,,
|
||||||
|
Attribution Vocabulary,http://purl.org/dc/elements/1.1/source,,,,,,
|
||||||
|
Attribution Vocabulary,http://purl.org/dc/terms/source,,,,,,
|
||||||
|
Agents Vocabulary,http://purl.org/dc/elements/1.1/creator,,,,,,
|
||||||
|
Agents Vocabulary,http://purl.org/dc/terms/creator,,,,,,
|
||||||
|
Agents Vocabulary,http://rs.tdwg.org/ac/terms/providerLiteral,,,,,,
|
||||||
|
Agents Vocabulary,http://rs.tdwg.org/ac/terms/provider,,,,,,
|
||||||
|
Agents Vocabulary,http://rs.tdwg.org/ac/terms/metadataCreatorLiteral,,,,,,
|
||||||
|
Agents Vocabulary,http://rs.tdwg.org/ac/terms/metadataCreator,,,,,,
|
||||||
|
Agents Vocabulary,http://rs.tdwg.org/ac/terms/metadataProviderLiteral,,,,,,
|
||||||
|
Agents Vocabulary,http://rs.tdwg.org/ac/terms/metadataProvider,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://purl.org/dc/terms/description,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://rs.tdwg.org/ac/terms/caption,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://purl.org/dc/elements/1.1/language,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://purl.org/dc/terms/language,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://rs.tdwg.org/ac/terms/physicalSetting,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/CVterm,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://rs.tdwg.org/ac/terms/subjectCategoryVocabulary,,,,,,
|
||||||
|
Content Coverage Vocabulary,http://rs.tdwg.org/ac/terms/tag,,,,,,
|
||||||
|
Geography Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/LocationShown,,,,,,
|
||||||
|
Geography Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/WorldRegion,,,,,,
|
||||||
|
Geography Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/CountryCode,,,,,,
|
||||||
|
Geography Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/CountryName,,,,,,
|
||||||
|
Geography Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/ProvinceState,,,,,,
|
||||||
|
Geography Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/City,,,,,,
|
||||||
|
Geography Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/Sublocation,,,,,,
|
||||||
|
Temporal Coverage Vocabulary,http://purl.org/dc/terms/temporal,,,,,,
|
||||||
|
Temporal Coverage Vocabulary,http://ns.adobe.com/xap/1.0/CreateDate,,,,,,
|
||||||
|
Temporal Coverage Vocabulary,http://rs.tdwg.org/ac/terms/timeOfDay,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/ac/terms/taxonCoverage,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/scientificName,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/identificationQualifier,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/vernacularName,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/nameAccordingTo,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/scientificNameID,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/ac/terms/otherScientificName,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/identifiedBy,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/dateIdentified,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/ac/terms/taxonCount,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/ac/terms/subjectPart,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/sex,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/lifeStage,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/ac/terms/subjectOrientation,,,,,,
|
||||||
|
Taxonomic Coverage Vocabulary,http://rs.tdwg.org/dwc/terms/preparations,,,,,,
|
||||||
|
Resource Creation Vocabulary,http://iptc.org/std/Iptc4xmpExt/2008-02-29/LocationCreated,,,,,,
|
||||||
|
Resource Creation Vocabulary,http://rs.tdwg.org/ac/terms/digitizationDate,,,,,,
|
||||||
|
Resource Creation Vocabulary,http://rs.tdwg.org/ac/terms/captureDevice,,,,,,
|
||||||
|
Resource Creation Vocabulary,http://rs.tdwg.org/ac/terms/resourceCreationTechnique,,,,,,
|
||||||
|
Related Resources Vocabulary,http://rs.tdwg.org/ac/terms/IDofContainingCollection,,,,,,
|
||||||
|
Related Resources Vocabulary,http://rs.tdwg.org/ac/terms/relatedResourceID,,,,,,
|
||||||
|
Related Resources Vocabulary,http://rs.tdwg.org/ac/terms/providerID,,,,,,
|
||||||
|
Related Resources Vocabulary,http://rs.tdwg.org/ac/terms/derivedFrom,,,,,,
|
||||||
|
Related Resources Vocabulary,http://rs.tdwg.org/ac/terms/associatedSpecimenReference,,,,,,
|
||||||
|
Related Resources Vocabulary,http://rs.tdwg.org/ac/terms/associatedObservationReference,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/accessURI,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://purl.org/dc/elements/1.1/format,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://purl.org/dc/terms/format,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/variantLiteral,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/variant,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/variantDescription,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/furtherInformationURL,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/licensingException,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/serviceExpectation,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/hashFunction,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://rs.tdwg.org/ac/terms/hashValue,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://ns.adobe.com/exif/1.0/PixelXDimension,,,,,,
|
||||||
|
Service Access Point Vocabulary,http://ns.adobe.com/exif/1.0/PixelYDimension,,,,,,
|
|
|
@ -35,7 +35,8 @@ NAMESPACES = {
|
||||||
'http://rs.tdwg.org/eco/terms/' : 'eco',
|
'http://rs.tdwg.org/eco/terms/' : 'eco',
|
||||||
'http://purl.org/dc/elements/1.1/' : 'dc',
|
'http://purl.org/dc/elements/1.1/' : 'dc',
|
||||||
'http://purl.org/dc/terms/' : 'dcterms',
|
'http://purl.org/dc/terms/' : 'dcterms',
|
||||||
'http://rs.tdwg.org/dwc/terms/attributes/' : 'tdwgutility'}
|
'http://rs.tdwg.org/dwc/terms/attributes/' : 'tdwgutility',
|
||||||
|
'http://rs.tdwg.org/ac/terms/' : 'ac'}
|
||||||
|
|
||||||
class ProvidedTermsError(Exception):
|
class ProvidedTermsError(Exception):
|
||||||
"""inconsistency in the available terms Error"""
|
"""inconsistency in the available terms Error"""
|
||||||
|
@ -418,6 +419,9 @@ class DwcDigester(object):
|
||||||
elif namespace=='http://rs.tdwg.org/eco/terms/':
|
elif namespace=='http://rs.tdwg.org/eco/terms/':
|
||||||
# Example: https://tdwg.github.io/eco/terms/#eco:samplingPerformedBy
|
# Example: https://tdwg.github.io/eco/terms/#eco:samplingPerformedBy
|
||||||
dc_relation = f'https://eco.tdwg.org/terms/#eco:{name}'
|
dc_relation = f'https://eco.tdwg.org/terms/#eco:{name}'
|
||||||
|
elif namespace=='http://rs.tdwg.org/ac/terms/':
|
||||||
|
# Example: https://ac.tdwg.org/terms/#ac:hasServiceAccessPointPerformedBy
|
||||||
|
dc_relation = f'https://ac.tdwg.org/termlist/#ac:{name}'
|
||||||
|
|
||||||
# Get the term definition (dc:description) from the description field of
|
# Get the term definition (dc:description) from the description field of
|
||||||
# the Extension term list file. Later we'll check if this is blank, and
|
# the Extension term list file. Later we'll check if this is blank, and
|
||||||
|
|
Loading…
Reference in New Issue