Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Add more details
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 18, 2024
1 parent 0c41e8c commit 3b0fba3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/records/schemas/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def toJSON(self):
class Record(Details):
type: str = "record"
ref: str | None = None
iaid: str | None = None
former_ref: str | None = None
title: str | None = None
description: str | None = None
Expand All @@ -36,6 +37,7 @@ def __init__(self, id: str):

class Aggregation(Details):
type: str = "aggregation"
ref: str | None = None
iaid: str | None = None
title: str | None = None
description: str | None = None
Expand Down
2 changes: 2 additions & 0 deletions app/sources/rosetta/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def parse_results(self, raw_results, source_url):
if parsed_data.type() == "record":
record = Record(parsed_data.id())
record.ref = parsed_data.identifier()
record.iaid = parsed_data.iaid()
record.former_ref = parsed_data.former_identifier()
record.title = parsed_data.title()
record.description = parsed_data.description()
Expand All @@ -108,6 +109,7 @@ def parse_results(self, raw_results, source_url):
return record.toJSON()
if parsed_data.type() == "aggregation":
record = Aggregation(parsed_data.id())
record.ref = parsed_data.identifier()
record.iaid = parsed_data.iaid()
record.title = parsed_data.title()
record.description = parsed_data.description()
Expand Down
4 changes: 2 additions & 2 deletions app/sources/rosetta/lib/response_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, rosetta_data_source):
self.source = rosetta_data_source

def strip_scope_and_content(self, markup):
document = PyQuery(markup)
document = PyQuery(markup.replace("<p/>", ""))
return str(document("span.scopecontent").contents())

def strip_wrapper_and_split_span(self, markup):
Expand Down Expand Up @@ -431,7 +431,7 @@ def administrative_background(self) -> str | None:
None,
):
document = PyQuery(administrative_background)
return str(document("span.bioghist").contents().eq(0))
return str(document("span.bioghist").contents())
return None

def functions(self) -> str | None:
Expand Down

0 comments on commit 3b0fba3

Please sign in to comment.