Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BDRSPS-1133 Update IRI patterns for Agents #374

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions abis_mapping/templates/incidental_occurrence_data_v3/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ def apply_mapping_row(
provider_record_id_source: str = row["providerRecordIDSource"]

# Create URIs
provider_identified = utils.iri_patterns.agent_iri(row["identifiedBy"])
provider_identified = utils.iri_patterns.agent_iri("org", row["identifiedBy"])
sample_specimen = utils.iri_patterns.sample_iri(base_iri, "specimen", provider_record_id)
sampling_specimen = utils.iri_patterns.sampling_iri(base_iri, "specimen", provider_record_id)
sample_sequence = utils.iri_patterns.sample_iri(base_iri, "sequence", provider_record_id)
sampling_sequencing = utils.iri_patterns.sampling_iri(base_iri, "sequencing", provider_record_id)
provider_determined_by = utils.iri_patterns.agent_iri(row["threatStatusDeterminedBy"])
provider_determined_by = utils.iri_patterns.agent_iri("org", row["threatStatusDeterminedBy"])

provider_record_id_datatype = utils.iri_patterns.datatype_iri("recordID", provider_record_id_source)
provider_record_id_agent = utils.iri_patterns.agent_iri(provider_record_id_source)
provider_record_id_agent = utils.iri_patterns.agent_iri("org", provider_record_id_source)
provider_record_id_attribution = utils.iri_patterns.attribution_iri(
base_iri, "resourceProvider", provider_record_id_source
)
Expand Down Expand Up @@ -250,7 +250,7 @@ def apply_mapping_row(
# Conditionally create uris dependent on ownerRecordIDSource field
if owner_record_id_source := row["ownerRecordIDSource"]:
owner_record_id_datatype = utils.iri_patterns.datatype_iri("recordID", owner_record_id_source)
owner_record_id_provider = utils.iri_patterns.agent_iri(owner_record_id_source)
owner_record_id_provider = utils.iri_patterns.agent_iri("org", owner_record_id_source)
owner_record_id_attribution = utils.iri_patterns.attribution_iri(base_iri, "owner", owner_record_id_source)
else:
owner_record_id_datatype = None
Expand Down Expand Up @@ -288,7 +288,7 @@ def apply_mapping_row(
# Conditionally create uri's dependent on recordedBy field.
if recorded_by := row["recordedBy"]:
record_number_datatype = utils.iri_patterns.datatype_iri("recordNumber", recorded_by)
provider_recorded_by = utils.iri_patterns.agent_iri(recorded_by)
provider_recorded_by = utils.iri_patterns.agent_iri("org", recorded_by)
else:
record_number_datatype = None
provider_recorded_by = None
Expand All @@ -306,7 +306,7 @@ def apply_mapping_row(
# Conditionally create uris dependent on catalogNumberSource field.
if catalog_number_source := row["catalogNumberSource"]:
catalog_number_datatype = utils.iri_patterns.datatype_iri("catalogNumber", catalog_number_source)
catalog_number_provider = utils.iri_patterns.agent_iri(catalog_number_source)
catalog_number_provider = utils.iri_patterns.agent_iri("org", catalog_number_source)
else:
catalog_number_datatype = None
catalog_number_provider = None
Expand All @@ -316,7 +316,7 @@ def apply_mapping_row(
other_catalog_numbers_datatype = utils.iri_patterns.datatype_iri(
"catalogNumber", other_catalog_numbers_source
)
other_catalog_numbers_provider = utils.iri_patterns.agent_iri(other_catalog_numbers_source)
other_catalog_numbers_provider = utils.iri_patterns.agent_iri("org", other_catalog_numbers_source)
else:
other_catalog_numbers_datatype = None
other_catalog_numbers_provider = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
<https://linked.data.gov.au/dataset/bdr/datatypes/surveyID/CSIRO> a rdfs:Datatype ;
skos:prefLabel "surveyID source" ;
prov:qualifiedAttribution [ a prov:Attribution ;
prov:agent <https://linked.data.gov.au/dataset/bdr/orgs/CSIRO> ;
prov:agent <https://linked.data.gov.au/dataset/bdr/org/CSIRO> ;
prov:hadRole <https://linked.data.gov.au/def/data-roles/principalInvestigator> ] .

<https://linked.data.gov.au/dataset/bdr/datatypes/surveyID/NSW-Department-of-Planning-Industry-and-Environment> a rdfs:Datatype ;
skos:prefLabel "surveyID source" ;
prov:qualifiedAttribution [ a prov:Attribution ;
prov:agent <https://linked.data.gov.au/dataset/bdr/orgs/NSW-Department-of-Planning-Industry-and-Environment> ;
prov:agent <https://linked.data.gov.au/dataset/bdr/org/NSW-Department-of-Planning-Industry-and-Environment> ;
prov:hadRole <https://linked.data.gov.au/def/data-roles/principalInvestigator> ] .

<https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/attribute/surveyType/Wet-pitfall-trapping> a tern:Attribute ;
Expand Down Expand Up @@ -110,10 +110,10 @@
rdfs:label "Insecta" ;
rdf:value <https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/bdr-cv/attribute/targetTaxonomicScope/Insecta> .

<https://linked.data.gov.au/dataset/bdr/orgs/CSIRO> a prov:Agent ;
<https://linked.data.gov.au/dataset/bdr/org/CSIRO> a prov:Agent ;
schema:name "CSIRO" .

<https://linked.data.gov.au/dataset/bdr/orgs/NSW-Department-of-Planning-Industry-and-Environment> a prov:Agent ;
<https://linked.data.gov.au/dataset/bdr/org/NSW-Department-of-Planning-Industry-and-Environment> a prov:Agent ;
schema:name "NSW Department of Planning, Industry and Environment" .

<https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/Survey/COL1> a tern:Survey ;
Expand Down
2 changes: 1 addition & 1 deletion abis_mapping/templates/survey_metadata_v2/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def apply_mapping_row(
SurveyIDDatatype(
name=raw_org,
datatype=utils.iri_patterns.datatype_iri("surveyID", raw_org),
agent=utils.iri_patterns.agent_iri(raw_org),
agent=utils.iri_patterns.agent_iri("org", raw_org),
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@
tern:hasValue <https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/value/targetTaxonomicScope/Insecta> .

<https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/attribution/CSIRO/principalInvestigator> a prov:Attribution ;
prov:agent <https://linked.data.gov.au/dataset/bdr/orgs/CSIRO> ;
prov:agent <https://linked.data.gov.au/dataset/bdr/org/CSIRO> ;
prov:hadRole <https://linked.data.gov.au/def/data-roles/principalInvestigator> .

<https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/attribution/NSW-Department-of-Planning-Industry-and-Environment/principalInvestigator> a prov:Attribution ;
prov:agent <https://linked.data.gov.au/dataset/bdr/orgs/NSW-Department-of-Planning-Industry-and-Environment> ;
prov:agent <https://linked.data.gov.au/dataset/bdr/org/NSW-Department-of-Planning-Industry-and-Environment> ;
prov:hadRole <https://linked.data.gov.au/def/data-roles/principalInvestigator> .

<https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/bdr-cv/attribute/targetTaxonomicScope/Coleoptera> a skos:Concept ;
Expand Down Expand Up @@ -124,10 +124,10 @@
rdfs:label "Insecta" ;
rdf:value <https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/bdr-cv/attribute/targetTaxonomicScope/Insecta> .

<https://linked.data.gov.au/dataset/bdr/orgs/CSIRO> a prov:Agent ;
<https://linked.data.gov.au/dataset/bdr/org/CSIRO> a prov:Agent ;
schema:name "CSIRO" .

<https://linked.data.gov.au/dataset/bdr/orgs/NSW-Department-of-Planning-Industry-and-Environment> a prov:Agent ;
<https://linked.data.gov.au/dataset/bdr/org/NSW-Department-of-Planning-Industry-and-Environment> a prov:Agent ;
schema:name "NSW Department of Planning, Industry and Environment" .

<https://linked.data.gov.au/dataset/bdr/00000000-0000-0000-0000-000000000000/Survey/COL1> a tern:Survey ;
Expand Down
2 changes: 1 addition & 1 deletion abis_mapping/templates/survey_metadata_v3/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def apply_mapping_row(
name=raw_org,
datatype=utils.iri_patterns.datatype_iri("surveyID", raw_org),
attribution=utils.iri_patterns.attribution_iri(base_iri, "principalInvestigator", raw_org),
agent=utils.iri_patterns.agent_iri(raw_org),
agent=utils.iri_patterns.agent_iri("org", raw_org),
)
)

Expand Down
Loading
Loading