accept_suggestion
accept_suggestion(
review,
column=None,
role=None,
rank=1,
table=None,
code_value=None,
iri=None,
)Record that a candidate is the right term for a slot.
Pipe-friendly: takes a review and returns a new one, so a whole review is an ordinary, re-runnable script. Nothing is written until :func:apply_sdp_semantics is called.
This is the call :func:review_semantics prints. Pasting the printed line is the intended workflow, and it is what makes the decision reproducible: the script is the audit trail.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| review | SemanticReview | A :class:SemanticReview from :func:review_semantics. |
required |
| column | Optional[str] | Column name of the slot. Omit it for a table-level slot (tables.csv – observation_unit_iri), which has no column; pass table instead. :func:review_semantics prints the right spelling either way. |
None |
| role | Optional[str] | Semantic role of the slot ("variable", "property", "entity", "unit", "constraint", "statistical_modifier"). |
None |
| rank | int | Rank of the candidate to accept, as printed in the shortlist. | 1 |
| table | Optional[str] | Table identifier; needed only when the column name appears in more than one table. | None |
| code_value | Optional[str] | Code value; needed only for code-level slots. Pass "" (pd.NA and NaN mean the same) to select a column’s own slot when codes of that column have slots with the same role, as a measurement column’s codes do: leaving code_value out, which is what None means, matches those code slots too. A blank never selects a code’s slot. A codes.csv row that leaves code_value empty because it supplies vocabulary_iri has no slot at all: it gets no semantic target, having no code value for a term to represent. :func:review_semantics prints code_value whenever it is needed. |
None |
| iri | Optional[str] | Optional IRI to accept instead of a shortlisted candidate – for the case where the right term exists but retrieval did not surface it. An iri that a shortlisted candidate in the slot carries is recorded as that candidate, exactly as its rank would be. |
None |
Returns
| Name | Type | Description |
|---|---|---|
| SemanticReview | The review, with the decision recorded. |