Skip to content

Commit

Permalink
Merge pull request #339 from gaiaresources/BDRSPS-1044
Browse files Browse the repository at this point in the history
BDRSPS-1044 Add basic Survey nodes to site visit template mapping
  • Loading branch information
joecrowleygaia authored Nov 19, 2024
2 parents 096648a + 0a294b3 commit 19c82bc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@
void:inDataset <http://createme.org/dataset/Example-Systematic-Survey-Site-Visit-Dataset> ;
schema:identifier "P1"^^<https://linked.data.gov.au/dataset/bdr/datatypes/siteID/WAM> .

<http://createme.org/Survey/TIS-24-03> a tern:Survey ;
void:inDataset <http://createme.org/dataset/Example-Systematic-Survey-Site-Visit-Dataset> .

<https://linked.data.gov.au/dataset/bdr/orgs/WAM> a prov:Agent,
prov:Organization ;
schema:name "WAM" .
Expand Down
27 changes: 27 additions & 0 deletions abis_mapping/templates/survey_site_visit_data_v2/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ def apply_mapping_row(
graph=graph,
)

# Add survey
self.add_survey(
uri=uri_survey,
dataset=dataset,
graph=graph,
)

# Add site
self.add_site(
uri=uri_site,
Expand Down Expand Up @@ -586,6 +593,26 @@ def add_site_visit_activity(
# Add link to Site Visit Plan
graph.add((uri, rdflib.PROV.hadPlan, uri_site_visit_plan))

def add_survey(
self,
uri: rdflib.URIRef,
dataset: rdflib.URIRef,
graph: rdflib.Graph,
) -> None:
"""Adds the basics of the Survey node to the graph.
The other properties for the node come from the survey metadata.
Args:
uri: The URI for the Survey node
dataset: The dataset URI
graph: The graph to update
"""
# Add type
graph.add((uri, a, utils.namespaces.TERN.Survey))
# Add dataset link
graph.add((uri, rdflib.VOID.inDataset, dataset))

def add_site(
self,
*,
Expand Down

0 comments on commit 19c82bc

Please sign in to comment.