diff --git a/abis_mapping/templates/incidental_occurrence_data_v3/examples/margaret_river_flora/margaret_river_flora.ttl b/abis_mapping/templates/incidental_occurrence_data_v3/examples/margaret_river_flora/margaret_river_flora.ttl index a7cf27b4..790e956a 100644 --- a/abis_mapping/templates/incidental_occurrence_data_v3/examples/margaret_river_flora/margaret_river_flora.ttl +++ b/abis_mapping/templates/incidental_occurrence_data_v3/examples/margaret_river_flora/margaret_river_flora.ttl @@ -138,63 +138,78 @@ a abis:BiodiversityRecord ; schema:about ; - schema:identifier "1"^^ . + schema:identifier "1"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "10"^^ . + schema:identifier "10"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "11"^^ . + schema:identifier "11"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "12"^^ . + schema:identifier "12"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "13"^^ . + schema:identifier "13"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "14"^^ . + schema:identifier "14"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "2"^^ . + schema:identifier "2"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "3"^^ . + schema:identifier "3"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "4"^^ . + schema:identifier "4"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "5"^^ . + schema:identifier "5"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "6"^^ . + schema:identifier "6"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "7"^^ . + schema:identifier "7"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "8"^^ . + schema:identifier "8"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "8022FSJMJ079c5cf"^^ . + schema:identifier "8022FSJMJ079c5cf"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "9"^^ . + schema:identifier "9"^^ ; + schema:isPartOf . a rdfs:Datatype ; skos:definition "An identifier for the dataset" ; @@ -1066,7 +1081,8 @@ a abis:BiodiversityRecord ; schema:about ; - schema:identifier "ABC123"^^ . + schema:identifier "ABC123"^^ ; + schema:isPartOf . a tern:Observation ; void:inDataset ; diff --git a/abis_mapping/templates/incidental_occurrence_data_v3/mapping.py b/abis_mapping/templates/incidental_occurrence_data_v3/mapping.py index 79b83171..4012bb9d 100644 --- a/abis_mapping/templates/incidental_occurrence_data_v3/mapping.py +++ b/abis_mapping/templates/incidental_occurrence_data_v3/mapping.py @@ -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, ) @@ -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: @@ -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. """ @@ -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, diff --git a/abis_mapping/templates/survey_occurrence_data_v2/examples/margaret_river_flora/margaret_river_flora.ttl b/abis_mapping/templates/survey_occurrence_data_v2/examples/margaret_river_flora/margaret_river_flora.ttl index 31e5103e..c6f41d31 100644 --- a/abis_mapping/templates/survey_occurrence_data_v2/examples/margaret_river_flora/margaret_river_flora.ttl +++ b/abis_mapping/templates/survey_occurrence_data_v2/examples/margaret_river_flora/margaret_river_flora.ttl @@ -139,59 +139,73 @@ a abis:BiodiversityRecord ; schema:about ; - schema:identifier "1"^^ . + schema:identifier "1"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "10"^^ . + schema:identifier "10"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "11"^^ . + schema:identifier "11"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "12"^^ . + schema:identifier "12"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "13"^^ . + schema:identifier "13"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "14"^^ . + schema:identifier "14"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "2"^^ . + schema:identifier "2"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "3"^^ . + schema:identifier "3"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "4"^^ . + schema:identifier "4"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "5"^^ . + schema:identifier "5"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "6"^^ . + schema:identifier "6"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "7"^^ . + schema:identifier "7"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "8"^^ . + schema:identifier "8"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "9"^^ . + schema:identifier "9"^^ ; + schema:isPartOf . a rdfs:Datatype ; skos:definition "An identifier for the dataset" ; @@ -1053,11 +1067,13 @@ a abis:BiodiversityRecord ; schema:about ; - schema:identifier "8022FSJMJ079c5cf"^^ . + schema:identifier "8022FSJMJ079c5cf"^^ ; + schema:isPartOf . a abis:BiodiversityRecord ; schema:about ; - schema:identifier "ABC123"^^ . + schema:identifier "ABC123"^^ ; + schema:isPartOf . a tern:Observation ; void:inDataset ; diff --git a/abis_mapping/templates/survey_occurrence_data_v2/examples/organism_qty.ttl b/abis_mapping/templates/survey_occurrence_data_v2/examples/organism_qty.ttl index 5d89d242..1bf788fb 100644 --- a/abis_mapping/templates/survey_occurrence_data_v2/examples/organism_qty.ttl +++ b/abis_mapping/templates/survey_occurrence_data_v2/examples/organism_qty.ttl @@ -14,7 +14,8 @@ a abis:BiodiversityRecord ; schema:about ; - schema:identifier "A0010"^^ . + schema:identifier "A0010"^^ ; + schema:isPartOf . a rdfs:Datatype ; skos:definition "An identifier for the dataset" ; diff --git a/abis_mapping/templates/survey_occurrence_data_v2/mapping.py b/abis_mapping/templates/survey_occurrence_data_v2/mapping.py index 66f4a9f3..4d618021 100644 --- a/abis_mapping/templates/survey_occurrence_data_v2/mapping.py +++ b/abis_mapping/templates/survey_occurrence_data_v2/mapping.py @@ -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, ) @@ -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: @@ -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. """ @@ -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,