Skip to content

Commit

Permalink
Revert "Add RIS citation stub to published output"
Browse files Browse the repository at this point in the history
This reverts commit 28c94a2.
  • Loading branch information
marksparkza committed Dec 18, 2023
1 parent 1004fa6 commit a037378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
4 changes: 0 additions & 4 deletions migrate/systemdata/schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ SchemaOrg.Dataset:
type: metadata
uri: https://odp.saeon.ac.za/schema/metadata/schema.org/dataset

RIS.Citation:
type: metadata
uri: https://odp.saeon.ac.za/schema/metadata/ris/citation

Tag.Collection.Infrastructure:
type: tag
uri: https://odp.saeon.ac.za/schema/tag/collection/infrastructure
Expand Down
24 changes: 3 additions & 21 deletions odp/catalog/saeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def create_published_record(self, record_model: RecordModel) -> PublishedRecordM
timestamp=record_model.timestamp,
)

def _create_published_metadata(self, record_model: RecordModel) -> list[PublishedMetadataModel]:
@staticmethod
def _create_published_metadata(record_model: RecordModel) -> list[PublishedMetadataModel]:
"""Create the published metadata outputs for a record."""
published_metadata = [
PublishedMetadataModel(
Expand All @@ -39,10 +40,7 @@ def _create_published_metadata(self, record_model: RecordModel) -> list[Publishe
)
]

if record_model.schema_id == ODPMetadataSchema.SAEON_DATACITE4:
datacite_metadata = record_model.metadata

elif record_model.schema_id == ODPMetadataSchema.SAEON_ISO19115:
if record_model.schema_id == ODPMetadataSchema.SAEON_ISO19115:
iso19115_schemaobj = Session.get(Schema, (ODPMetadataSchema.SAEON_ISO19115, SchemaType.metadata))
datacite_schemaobj = Session.get(Schema, (ODPMetadataSchema.SAEON_DATACITE4, SchemaType.metadata))

Expand All @@ -63,24 +61,8 @@ def _create_published_metadata(self, record_model: RecordModel) -> list[Publishe
)
]

# add an RIS citation record
ris_schema = Session.get(Schema, (ODPMetadataSchema.RIS_CITATION, SchemaType.metadata))
published_metadata += [
PublishedMetadataModel(
schema_id=ris_schema.id,
schema_uri=ris_schema.uri,
metadata={'ris': self._create_ris_citation(datacite_metadata)}
)
]

return published_metadata

@staticmethod
def _create_ris_citation(datacite_metadata: dict) -> str:
"""Create an RIS citation from the DataCite metadata for a record."""
return '''
'''

@staticmethod
def _create_published_tags(record_model: RecordModel) -> list[PublishedTagInstanceModel]:
"""Create the published tags for a record."""
Expand Down

0 comments on commit a037378

Please sign in to comment.