Skip to content

Commit

Permalink
Update Python-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dalito committed Dec 4, 2024
1 parent d859826 commit e760221
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions example_resource_info.py
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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))
15 changes: 7 additions & 8 deletions explore_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
Expand All @@ -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="[email protected]",
license="CC0-1.0",
curation_contact_email="[email protected]",
)

c = p4c.Container(contains_pids=[p1])
Expand Down
9 changes: 4 additions & 5 deletions explore_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


p1_Agent = p4c.Agent(
person_orcid="0000-0000-0000-0000",
orcid="0000-0000-0000-0000",
name="Data Fuzzi",
role="TRUSTEE",
)
Expand All @@ -12,19 +12,18 @@
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(
id="lik-1",
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="[email protected]",
license="CC0-1.0",
curation_contact_email="[email protected]",
)

print(p1)
Expand Down

0 comments on commit e760221

Please sign in to comment.