From b35b1d4350d159587493600d8dc00bc642513c5c Mon Sep 17 00:00:00 2001 From: David Linke Date: Thu, 5 Dec 2024 00:48:27 +0100 Subject: [PATCH] Update Python-examples --- example_resource_info.py | 4 ++-- explore_pydantic.py | 15 +++++++-------- explore_python.py | 9 ++++----- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/example_resource_info.py b/example_resource_info.py index f8c16fe..2bf02d7 100644 --- a/example_resource_info.py +++ b/example_resource_info.py @@ -1,7 +1,7 @@ from linkml_runtime.dumpers import json_dumper from pid4cat_model.datamodel import pid4cat_model_pydantic as p4c -pid1_ressource_info = p4c.ResourceInfo( +pid1_resource_info = p4c.ResourceInfo( label="Resource label", description="Resource description", resource_category=p4c.ResourceCategory.SAMPLE, @@ -11,4 +11,4 @@ schema_type="XSD", ) -print(json_dumper.dumps(pid1_ressource_info, inject_type=False)) +print(json_dumper.dumps(pid1_resource_info, inject_type=False)) diff --git a/explore_pydantic.py b/explore_pydantic.py index de23daf..67b1164 100644 --- a/explore_pydantic.py +++ b/explore_pydantic.py @@ -3,8 +3,8 @@ p1_Agent = p4c.Agent( name="Data Fuzzi", - contact_information=None, - person_orcid="0000-0000-0000-0000", + email=None, + orcid="0000-0000-0000-0000", affiliation_ror=None, role=p4c.PID4CatAgentRole.TRUSTEE, ) @@ -13,10 +13,10 @@ datetime_log="2024-02-19T00:00:00Z", has_agent=p1_Agent, changed_field=p4c.ChangeLogField.STATUS, - description="as requested in issue #123", + description="as requested in issue #234", ) -p1_ressource_info = p4c.ResourceInfo( +p1_resource_info = p4c.ResourceInfo( label="Resource label", description="Resource description", resource_category=p4c.ResourceCategory.SAMPLE, @@ -32,11 +32,10 @@ landing_page_url="https://pid4cat.example.org/lik-123", status=p4c.PID4CatStatus.REGISTERED, pid_schema_version="0.1.0", - record_version="20240219v-0", - resource_info=p1_ressource_info, + resource_info=p1_resource_info, related_identifiers=None, - dc_rights="CC0-1.0", - curation_contact="datafuzzi@example.org", + license="CC0-1.0", + curation_contact_email="datafuzzi@example.org", ) c = p4c.Container(contains_pids=[p1]) diff --git a/explore_python.py b/explore_python.py index db008b4..afe9d0c 100644 --- a/explore_python.py +++ b/explore_python.py @@ -3,7 +3,7 @@ p1_Agent = p4c.Agent( - person_orcid="0000-0000-0000-0000", + orcid="0000-0000-0000-0000", name="Data Fuzzi", role="TRUSTEE", ) @@ -12,7 +12,7 @@ datetime_log="2024-02-19T00:00:00Z", has_agent=p1_Agent, changed_field=p4c.ChangeLogField.STATUS, # "STATUS", - description="as requested in issue #123", + description="as requested in issue #234", ) p1 = p4c.PID4CatRecord( @@ -20,11 +20,10 @@ change_log=p1_log, landing_page_url="https://pid4cat.example.org/lik-1", status=p4c.PID4CatStatus.REGISTERED, # "REGISTERED", - record_version="20240219v-0", resource_info={}, related_identifiers=None, - dc_rights="CC0-1.0", - curation_contact="datafuzzi@example.org", + license="CC0-1.0", + curation_contact_email="datafuzzi@example.org", ) print(p1)