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-1082 Add link to dataset from BiodiversityRecord #351

Merged
merged 1 commit into from
Nov 29, 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
Original file line number Diff line number Diff line change
Expand Up @@ -138,63 +138,78 @@

<http://createme.org/biodiversityRecord/1> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/1> ;
schema:identifier "1"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "1"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/10> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/10> ;
schema:identifier "10"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "10"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/11> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/11> ;
schema:identifier "11"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "11"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/12> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/12> ;
schema:identifier "12"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "12"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/13> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/13> ;
schema:identifier "13"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "13"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/14> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/14> ;
schema:identifier "14"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "14"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/2> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/2> ;
schema:identifier "2"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "2"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/3> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/3> ;
schema:identifier "3"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "3"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/4> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/4> ;
schema:identifier "4"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "4"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/5> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/5> ;
schema:identifier "5"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "5"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/6> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/6> ;
schema:identifier "6"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "6"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/7> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/7> ;
schema:identifier "7"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "7"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/8> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/8> ;
schema:identifier "8"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "8"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/8022FSJMJ079c5cf> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/8022FSJMJ079c5cf> ;
schema:identifier "8022FSJMJ079c5cf"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "8022FSJMJ079c5cf"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/9> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/9> ;
schema:identifier "9"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "9"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/datatype/datasetID/Gaia-Resources> a rdfs:Datatype ;
skos:definition "An identifier for the dataset" ;
Expand Down Expand Up @@ -1066,7 +1081,8 @@

<http://createme.org/biodiversityRecord/ABC123> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/ABC123> ;
schema:identifier "ABC123"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "ABC123"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> .

<http://createme.org/observation/threatStatus/8022FSJMJ079c5cf> a tern:Observation ;
void:inDataset <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ def apply_mapping_row(
uri=provider_record_id_biodiversity_record,
provider_record_id_datatype=provider_record_id_datatype,
provider_record_id_occurrence=provider_record_id_occurrence,
dataset=dataset,
row=row,
graph=graph,
)
Expand Down Expand Up @@ -3748,6 +3749,7 @@ def add_biodiversity_record(
uri: rdflib.URIRef,
provider_record_id_datatype: rdflib.URIRef,
provider_record_id_occurrence: rdflib.URIRef,
dataset: rdflib.URIRef,
row: frictionless.Row,
graph: rdflib.Graph,
) -> None:
Expand All @@ -3759,6 +3761,7 @@ def add_biodiversity_record(
the provider record id.
provider_record_id_occurrence: Reference to the occurrence
of the row.
dataset: The uri for the dateset node.
row: Raw data for row.
graph: Graph to be modified.
"""
Expand All @@ -3770,6 +3773,8 @@ def add_biodiversity_record(
)
# Add about property
graph.add((uri, rdflib.SDO.about, provider_record_id_occurrence))
# Add link to dataset
graph.add((uri, rdflib.SDO.isPartOf, dataset))

def add_occurrence(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,59 +139,73 @@

<http://createme.org/biodiversityRecord/1> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/1> ;
schema:identifier "1"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "1"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/10> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/10> ;
schema:identifier "10"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "10"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/11> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/11> ;
schema:identifier "11"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "11"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/12> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/12> ;
schema:identifier "12"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "12"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/13> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/13> ;
schema:identifier "13"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "13"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/14> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/14> ;
schema:identifier "14"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "14"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/2> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/2> ;
schema:identifier "2"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "2"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/3> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/3> ;
schema:identifier "3"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "3"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/4> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/4> ;
schema:identifier "4"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "4"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/5> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/5> ;
schema:identifier "5"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "5"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/6> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/6> ;
schema:identifier "6"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "6"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/7> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/7> ;
schema:identifier "7"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "7"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/8> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/8> ;
schema:identifier "8"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "8"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/9> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/9> ;
schema:identifier "9"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "9"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/datatype/datasetID/Gaia-Resources> a rdfs:Datatype ;
skos:definition "An identifier for the dataset" ;
Expand Down Expand Up @@ -1053,11 +1067,13 @@

<http://createme.org/biodiversityRecord/8022FSJMJ079c5cf> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/8022FSJMJ079c5cf> ;
schema:identifier "8022FSJMJ079c5cf"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "8022FSJMJ079c5cf"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/biodiversityRecord/ABC123> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/ABC123> ;
schema:identifier "ABC123"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> .
schema:identifier "ABC123"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/WAM> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/observation/threatStatus/8022FSJMJ079c5cf> a tern:Observation ;
void:inDataset <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

<http://createme.org/biodiversityRecord/A0010> a abis:BiodiversityRecord ;
schema:about <http://createme.org/occurrence/A0010> ;
schema:identifier "A0010"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/Gaia-Resources> .
schema:identifier "A0010"^^<https://linked.data.gov.au/dataset/bdr/datatypes/recordID/Gaia-Resources> ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Occurrence-Dataset> .

<http://createme.org/datatype/datasetID/Gaia-Resources> a rdfs:Datatype ;
skos:definition "An identifier for the dataset" ;
Expand Down
5 changes: 5 additions & 0 deletions abis_mapping/templates/survey_occurrence_data_v2/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,7 @@ def apply_mapping_row(
uri=provider_record_id_biodiversity_record,
provider_record_id_datatype=provider_record_id_datatype,
provider_record_id_occurrence=provider_record_id_occurrence,
dataset=dataset,
row=row,
graph=graph,
)
Expand Down Expand Up @@ -4381,6 +4382,7 @@ def add_biodiversity_record(
uri: rdflib.URIRef,
provider_record_id_datatype: rdflib.URIRef,
provider_record_id_occurrence: rdflib.URIRef,
dataset: rdflib.URIRef,
row: frictionless.Row,
graph: rdflib.Graph,
) -> None:
Expand All @@ -4392,6 +4394,7 @@ def add_biodiversity_record(
the provider record id.
provider_record_id_occurrence: Reference to the occurrence
of the row.
dataset: The uri for the dateset node.
row: Raw data for row.
graph: Graph to be modified.
"""
Expand All @@ -4403,6 +4406,8 @@ def add_biodiversity_record(
)
# Add about property
graph.add((uri, rdflib.SDO.about, provider_record_id_occurrence))
# Add link to dataset
graph.add((uri, rdflib.SDO.isPartOf, dataset))

def add_occurrence(
self,
Expand Down