Skip to content

Commit

Permalink
Merge pull request #356 from gaiaresources/BDRSPS-1088
Browse files Browse the repository at this point in the history
BDRSPS-1088 Swap `schema:identifier` for `schema:name` for attribute Collections
  • Loading branch information
chungvl authored Dec 2, 2024
2 parents e47780a + 821f02b commit dce6117
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 80 deletions.
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jobs:
needs: [poetry-lock]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,127 +12,127 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://createme.org/OccurrenceCollection/basisOfRecord/HumanObservation> a schema:Collection ;
schema:identifier "Occurrence Collection - Basis Of Record - HumanObservation" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/occurrence/14> ;
schema:name "Occurrence Collection - Basis Of Record - HumanObservation" ;
tern:hasAttribute <http://createme.org/attribute/basisOfRecord/HumanObservation> .

<http://createme.org/OccurrenceCollection/basisOfRecord/PreservedSpecimen> a schema:Collection ;
schema:identifier "Occurrence Collection - Basis Of Record - PreservedSpecimen" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/sample/specimen/13>,
<http://createme.org/sample/specimen/8022FSJMJ079c5cf> ;
schema:name "Occurrence Collection - Basis Of Record - PreservedSpecimen" ;
tern:hasAttribute <http://createme.org/attribute/basisOfRecord/PreservedSpecimen> .

<http://createme.org/OccurrenceCollection/basisOfRecord/new-basis-of-record> a schema:Collection ;
schema:identifier "Occurrence Collection - Basis Of Record - new basis of record" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/sample/specimen/ABC123> ;
schema:name "Occurrence Collection - Basis Of Record - new basis of record" ;
tern:hasAttribute <http://createme.org/attribute/basisOfRecord/new-basis-of-record> .

<http://createme.org/OccurrenceCollection/conservationAuthority/WA> a schema:Collection ;
schema:identifier "Occurrence Collection - Conservation Authority - WA" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/threatStatus/8022FSJMJ079c5cf>,
<http://createme.org/observation/threatStatus/ABC123> ;
schema:name "Occurrence Collection - Conservation Authority - WA" ;
tern:hasAttribute <http://createme.org/attribute/conservationAuthority/WA> .

<http://createme.org/OccurrenceCollection/dataGeneralizations/Coordinates-generalised> a schema:Collection ;
schema:identifier "Occurrence Collection - Data Generalizations - Coordinates generalised" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/occurrence/ABC123> ;
schema:name "Occurrence Collection - Data Generalizations - Coordinates generalised" ;
tern:hasAttribute <http://createme.org/attribute/dataGeneralizations/Coordinates-generalised> .

<http://createme.org/OccurrenceCollection/dataGeneralizations/Coordinates-rounded-to-the-nearest-10-km-for-conservation-concern> a schema:Collection ;
schema:identifier "Occurrence Collection - Data Generalizations - Coordinates rounded to the nearest 10 km for conservation concern" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/occurrence/14>,
<http://createme.org/occurrence/8022FSJMJ079c5cf> ;
schema:name "Occurrence Collection - Data Generalizations - Coordinates rounded to the nearest 10 km for conservation concern" ;
tern:hasAttribute <http://createme.org/attribute/dataGeneralizations/Coordinates-rounded-to-the-nearest-10-km-for-conservation-concern> .

<http://createme.org/OccurrenceCollection/habitat/Closed-forest-of-Melaleuca-lanceolata-White-grey-or-brown-sand-sandy-loam> a schema:Collection ;
schema:identifier "Occurrence Collection - Habitat - Closed forest of Melaleuca lanceolata. White, grey or brown sand, sandy loam." ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/occurrence/8022FSJMJ079c5cf> ;
schema:name "Occurrence Collection - Habitat - Closed forest of Melaleuca lanceolata. White, grey or brown sand, sandy loam." ;
tern:hasAttribute <http://createme.org/attribute/habitat/Closed-forest-of-Melaleuca-lanceolata-White-grey-or-brown-sand-sandy-loam> .

<http://createme.org/OccurrenceCollection/habitat/new-habitat> a schema:Collection ;
schema:identifier "Occurrence Collection - Habitat - new habitat" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/occurrence/ABC123> ;
schema:name "Occurrence Collection - Habitat - new habitat" ;
tern:hasAttribute <http://createme.org/attribute/habitat/new-habitat> .

<http://createme.org/OccurrenceCollection/identificationQualifier/> a schema:Collection ;
schema:identifier "Occurrence Collection - Identification Qualifier - ?" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/11>,
<http://createme.org/observation/scientificName/14> ;
schema:name "Occurrence Collection - Identification Qualifier - ?" ;
tern:hasAttribute <http://createme.org/attribute/identificationQualifier/> .

<http://createme.org/OccurrenceCollection/identificationQualifier/new-identification-qualifier> a schema:Collection ;
schema:identifier "Occurrence Collection - Identification Qualifier - new identification qualifier" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/ABC123> ;
schema:name "Occurrence Collection - Identification Qualifier - new identification qualifier" ;
tern:hasAttribute <http://createme.org/attribute/identificationQualifier/new-identification-qualifier> .

<http://createme.org/OccurrenceCollection/identificationQualifier/species-incerta> a schema:Collection ;
schema:identifier "Occurrence Collection - Identification Qualifier - species incerta" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/8022FSJMJ079c5cf> ;
schema:name "Occurrence Collection - Identification Qualifier - species incerta" ;
tern:hasAttribute <http://createme.org/attribute/identificationQualifier/species-incerta> .

<http://createme.org/OccurrenceCollection/identificationRemarks/Could-not-confirm-the-ID-due-to-damaged-flower> a schema:Collection ;
schema:identifier "Occurrence Collection - Identification Remarks - Could not confirm the ID due to damaged flower" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/14> ;
schema:name "Occurrence Collection - Identification Remarks - Could not confirm the ID due to damaged flower" ;
tern:hasAttribute <http://createme.org/attribute/identificationRemarks/Could-not-confirm-the-ID-due-to-damaged-flower> .

<http://createme.org/OccurrenceCollection/identificationRemarks/One-unopened-flower-when-recorded-and-one-leaf-only-ID-not-confirmed> a schema:Collection ;
schema:identifier "Occurrence Collection - Identification Remarks - One unopened flower when recorded and one leaf only. ID not confirmed" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/11> ;
schema:name "Occurrence Collection - Identification Remarks - One unopened flower when recorded and one leaf only. ID not confirmed" ;
tern:hasAttribute <http://createme.org/attribute/identificationRemarks/One-unopened-flower-when-recorded-and-one-leaf-only-ID-not-confirmed> .

<http://createme.org/OccurrenceCollection/identificationRemarks/new-remarks> a schema:Collection ;
schema:identifier "Occurrence Collection - Identification Remarks - new remarks" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/ABC123> ;
schema:name "Occurrence Collection - Identification Remarks - new remarks" ;
tern:hasAttribute <http://createme.org/attribute/identificationRemarks/new-remarks> .

<http://createme.org/OccurrenceCollection/identificationRemarks/no-flowers-present> a schema:Collection ;
schema:identifier "Occurrence Collection - Identification Remarks - no flowers present" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/8022FSJMJ079c5cf> ;
schema:name "Occurrence Collection - Identification Remarks - no flowers present" ;
tern:hasAttribute <http://createme.org/attribute/identificationRemarks/no-flowers-present> .

<http://createme.org/OccurrenceCollection/preparations/Wet-in-ethanol-or-some-other-preservative> a schema:Collection ;
schema:identifier "Occurrence Collection - Preparations - Wet (in ethanol or some other preservative)" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/sample/specimen/8022FSJMJ079c5cf> ;
schema:name "Occurrence Collection - Preparations - Wet (in ethanol or some other preservative)" ;
tern:hasAttribute <http://createme.org/attribute/preparations/Wet-in-ethanol-or-some-other-preservative> .

<http://createme.org/OccurrenceCollection/preparations/new-preparations> a schema:Collection ;
schema:identifier "Occurrence Collection - Preparations - new preparations" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/sample/specimen/ABC123> ;
schema:name "Occurrence Collection - Preparations - new preparations" ;
tern:hasAttribute <http://createme.org/attribute/preparations/new-preparations> .

<http://createme.org/OccurrenceCollection/sensitivityCategory/Category-1> a schema:Collection ;
schema:identifier "Occurrence Collection - Sensitivity Category - Category 1" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/biodiversityRecord/ABC123> ;
schema:name "Occurrence Collection - Sensitivity Category - Category 1" ;
tern:hasAttribute <http://createme.org/attribute/sensitivityCategory/Category-1> .

<http://createme.org/OccurrenceCollection/taxonRank/new-taxon-rank> a schema:Collection ;
schema:identifier "Occurrence Collection - Taxon Rank - new taxon rank" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/ABC123> ;
schema:name "Occurrence Collection - Taxon Rank - new taxon rank" ;
tern:hasAttribute <http://createme.org/attribute/taxonRank/new-taxon-rank> .

<http://createme.org/OccurrenceCollection/taxonRank/species> a schema:Collection ;
schema:identifier "Occurrence Collection - Taxon Rank - species" ;
schema:isPartOf <http://createme.org/dataset/Example-Incidental-Occurrence-Dataset> ;
schema:member <http://createme.org/observation/scientificName/8022FSJMJ079c5cf> ;
schema:name "Occurrence Collection - Taxon Rank - species" ;
tern:hasAttribute <http://createme.org/attribute/taxonRank/species> .

<http://createme.org/biodiversityRecord/1> a abis:BiodiversityRecord ;
Expand Down
18 changes: 9 additions & 9 deletions abis_mapping/templates/incidental_occurrence_data_v3/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ def add_id_qualifier_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Occurrence Collection - Identification Qualifier - {id_qualifier}"),
)
)
Expand Down Expand Up @@ -1635,7 +1635,7 @@ def add_id_remarks_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Occurrence Collection - Identification Remarks - {id_remarks}"),
)
)
Expand Down Expand Up @@ -2018,7 +2018,7 @@ def add_data_generalizations_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(
f"Occurrence Collection - Data Generalizations - {data_generalizations}",
),
Expand Down Expand Up @@ -2129,7 +2129,7 @@ def add_taxon_rank_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Occurrence Collection - Taxon Rank - {taxon_rank}"),
)
)
Expand Down Expand Up @@ -2490,7 +2490,7 @@ def add_habitat_collection(
graph.add((uri, a, rdflib.SDO.Collection))
# Add identifier
if habitat:
graph.add((uri, rdflib.SDO.identifier, rdflib.Literal(f"Occurrence Collection - Habitat - {habitat}")))
graph.add((uri, rdflib.SDO.name, rdflib.Literal(f"Occurrence Collection - Habitat - {habitat}")))
# Add link to dataset
graph.add((uri, rdflib.SDO.isPartOf, dataset))
# add link to the sample field
Expand Down Expand Up @@ -2601,7 +2601,7 @@ def add_basis_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Occurrence Collection - Basis Of Record - {basis_of_record}"),
)
)
Expand Down Expand Up @@ -2814,7 +2814,7 @@ def add_preparations_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Occurrence Collection - Preparations - {preparations}"),
)
)
Expand Down Expand Up @@ -3618,7 +3618,7 @@ def add_conservation_authority_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Occurrence Collection - Conservation Authority - {conservation_authority}"),
)
)
Expand Down Expand Up @@ -3736,7 +3736,7 @@ def add_sensitivity_category_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Occurrence Collection - Sensitivity Category - {sensitivity_category}"),
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bdrsh:GeneralCollectionShape
sh:class tern:Dataset ;
] ;
sh:property [
sh:path schema:identifier ;
sh:path schema:name ;
sh:nodeKind sh:Literal ;
sh:pattern "^Occurrence Collection - (?:Identification Qualifier|Identification Remarks|Data Generalizations|Taxon Rank|Habitat|Basis Of Record|Preparations|Conservation Authority) - " ;
sh:datatype xsd:string ;
Expand All @@ -169,7 +169,7 @@ bdrsh:SensitivityCategoryCollectionShape
sh:class tern:Dataset ;
] ;
sh:property [
sh:path schema:identifier ;
sh:path schema:name ;
sh:nodeKind sh:Literal ;
sh:pattern "^Occurrence Collection - Sensitivity Category - " ;
sh:datatype xsd:string ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://createme.org/SurveyCollection/surveyType/Wet-pitfall-trapping> a schema:Collection ;
schema:identifier "Survey Collection - Survey Type - Wet pitfall trapping" ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Metadata-Dataset> ;
schema:member <http://createme.org/survey/plan/COL1> ;
schema:name "Survey Collection - Survey Type - Wet pitfall trapping" ;
tern:hasAttribute <http://createme.org/attribute/surveyType/Wet-pitfall-trapping> .

<http://createme.org/SurveyCollection/targetHabitatScope/Woodland> a schema:Collection ;
schema:identifier "Survey Collection - Target Habitat Scope - Woodland" ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Metadata-Dataset> ;
schema:member <http://createme.org/survey/plan/COL1> ;
schema:name "Survey Collection - Target Habitat Scope - Woodland" ;
tern:hasAttribute <http://createme.org/attribute/targetHabitatScope/Woodland> .

<http://createme.org/SurveyCollection/targetTaxonomicScope/Coleoptera> a schema:Collection ;
schema:identifier "Survey Collection - Target Taxonomic Scope - Coleoptera" ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Metadata-Dataset> ;
schema:member <http://createme.org/survey/plan/COL1> ;
schema:name "Survey Collection - Target Taxonomic Scope - Coleoptera" ;
tern:hasAttribute <http://createme.org/attribute/targetTaxonomicScope/Coleoptera> .

<http://createme.org/SurveyCollection/targetTaxonomicScope/Insecta> a schema:Collection ;
schema:identifier "Survey Collection - Target Taxonomic Scope - Insecta" ;
schema:isPartOf <http://createme.org/dataset/Example-Systematic-Survey-Metadata-Dataset> ;
schema:member <http://createme.org/survey/plan/COL1> ;
schema:name "Survey Collection - Target Taxonomic Scope - Insecta" ;
tern:hasAttribute <http://createme.org/attribute/targetTaxonomicScope/Insecta> .

<http://createme.org/datatype/datasetID/Gaia-Resources> a rdfs:Datatype ;
Expand Down
6 changes: 3 additions & 3 deletions abis_mapping/templates/survey_metadata_v2/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def add_survey_type_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Survey Collection - Survey Type - {row_survey_type}"),
)
)
Expand Down Expand Up @@ -860,7 +860,7 @@ def add_target_habitat_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Survey Collection - Target Habitat Scope - {raw_value}"),
)
)
Expand Down Expand Up @@ -959,7 +959,7 @@ def add_target_taxonomic_scope_collection(
graph.add(
(
uri,
rdflib.SDO.identifier,
rdflib.SDO.name,
rdflib.Literal(f"Survey Collection - Target Taxonomic Scope - {raw_value}"),
)
)
Expand Down
Loading

0 comments on commit dce6117

Please sign in to comment.