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-857 Schema update for site visist data template v2 #228

Merged
merged 4 commits into from
Oct 3, 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
@@ -0,0 +1,3 @@
siteID,siteIDSource,siteType,siteName,siteDescription,habitat,relatedSiteID,relationshipToRelatedSite,locality,decimalLatitude,decimalLongitude,footprintWKT,geodeticDatum,coordinateUncertaintyInMeters,dataGeneralizations
P1,WAM,Plot,Plot 1,Fine woody debris.,,,,Cowaramup Bay Road,-34.036,146.363,"LINESTRING (146.363 -34.036, 146.363 -34.037)",WGS84,50,
P1,WAM,Plot,Plot 1,Fine woody debris.,,,,Cowaramup Bay Road,-34.036,146.363,"LINESTRING (146.363 -34.036, 146.363 -34.037)",WGS84,50,
4 changes: 1 addition & 3 deletions abis_mapping/templates/survey_site_visit_data_v2/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"type": "string",
"format": "default",
"constraints": {
"required": true,
"unique": true
"required": true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joecrowleygaia do you agree with removing unique: true from siteID? Otherwise you won't be able to have multiple visits per site in the template

}
},
{
Expand Down Expand Up @@ -113,7 +112,6 @@
}
},
{
"_comment": "can we do a flexible vocabulary while I do the recon to establish the concepts?",
"name": "protocolName",
"title": "Protocol Name",
"description": "Categorical descriptive name for the method used during the Site Visit.",
Expand Down
1 change: 1 addition & 0 deletions abis_mapping/types/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Constraints(pydantic.BaseModel):
"""The constraints of a schema field primarily defined by frictionless."""

required: bool
unique: bool | None = None
minimum: float | int | None = None
maximum: float | int | None = None
enum: list[str] | None = None
Expand Down
9 changes: 9 additions & 0 deletions tests/templates/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ class TemplateTestParameters:
should_validate=False,
expected_error_codes={"row-constraint"},
),
MappingParameters(
scenario_name="duplicate-site-ids",
data=pathlib.Path(
"abis_mapping/templates/survey_site_data_v2/examples/minimal-error-duplicate-site-ids.csv"
),
expected=None,
should_validate=False,
expected_error_codes={"unique-error", "primary-key"},
),
],
metadata_sampling_type="systematic survey",
allows_extra_cols=True,
Expand Down