Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1399
@vocab to deduplicate namespace
Active
Public
Actions
Authored by
vlorentz
on Jul 5 2022, 10:30 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
diff --git a/swh/indexer/metadata_dictionary/cff.py b/swh/indexer/metadata_dictionary/cff.py
index 48be831..b278e5c 100644
--- a/swh/indexer/metadata_dictionary/cff.py
+++ b/swh/indexer/metadata_dictionary/cff.py
@@ -38,19 +38,20 @@ def normalize_authors(self, d: List[dict]) -> Dict[str, list]:
result = []
for author in d:
author_data: Dict[str, Optional[Union[str, Dict]]] = {
- "@type": SCHEMA_URI + "Person"
+ "@context": {"@vocab": SCHEMA_URI},
+ "@type": "Person"
}
if "orcid" in author and isinstance(author["orcid"], str):
author_data["@id"] = author["orcid"]
if "affiliation" in author and isinstance(author["affiliation"], str):
- author_data[SCHEMA_URI + "affiliation"] = {
- "@type": SCHEMA_URI + "Organization",
- SCHEMA_URI + "name": author["affiliation"],
+ author_data["affiliation"] = {
+ "@type": "Organization",
+ "name": author["affiliation"],
}
if "family-names" in author and isinstance(author["family-names"], str):
- author_data[SCHEMA_URI + "familyName"] = author["family-names"]
+ author_data["familyName"] = author["family-names"]
if "given-names" in author and isinstance(author["given-names"], str):
- author_data[SCHEMA_URI + "givenName"] = author["given-names"]
+ author_data["givenName"] = author["given-names"]
result.append(author_data)
Event Timeline
vlorentz
created this paste.
Jul 5 2022, 10:30 AM
2022-07-05 10:30:32 (UTC+2)
Log In to Comment