Skip to content

Glossary

Null semantics

Null semantics defines what an absent, unknown, inapplicable, or deliberately withheld value means.

Evaluation

Null semantics is the declared interpretation of a value that is absent or marked with a special state. A blank may mean unknown, not yet researched, not applicable, withheld, or known to have no value; these are different claims. SQL NULL represents missing information in a particular data model, but a bare NULL does not identify which real-world reason applies. Codd's work on missing information made this ambiguity a central database concern.

A practical vocabulary separates states and records the evidence or policy behind each one. 'Not found' should state the search scope and date; 'not applicable' needs a reason the property does not arise; 'blocked' should identify an access limitation where disclosure permits. Missing values must survive transformations and exports without collapsing into a false negative or a default value. Query behavior, especially comparisons and aggregations, should be tested for each state.

For a defensible record, explicit null semantics prevents a gap from being mistaken for a conclusion. It also lets reviewers see whether a value could change after new evidence or access arrives. The open-world assumption warns against inferring falsity from absence in an incomplete collection, while a closed-world assumption may permit that inference inside a declared complete domain. Abstention is one response when the current null state cannot support a substantive answer.

Example

Halden Therapeutics AG (fictional) has no recorded permit number because access to the relevant registry is blocked; the state is not 'no permit exists'.

Three-valued logic in databases

SQL uses a null marker for a value that is missing or unknown, and extends logic to three values: true, false and unknown. A comparison with null yields unknown, not false, so that a filter on equality never selects a null row and a filter on inequality does not either. The PostgreSQL documentation describes the special predicates, IS NULL and IS DISTINCT FROM, that treat null explicitly, and the Wikipedia article on null in SQL lists the consequences, such as aggregates ignoring nulls and the surprising behaviour of NOT IN when a null is present in the list. Codd's work on extending the relational model recognised that a single null conflates different situations, and proposed distinguishing missing-but-applicable from inapplicable; SQL did not adopt the distinction.

Graph and semantic web systems have their own forms. In RDF there is no null: a property is simply absent, and under the open-world reading of OWL its absence says nothing. In SPARQL an optional pattern can leave a variable unbound, and in SHACL a minimum cardinality turns absence into a violation. The same blank therefore carries different meaning in different technologies, and moving data between them without a rule changes its meaning.

Distinguishing the kinds of absence

A well-designed record separates at least five situations: not applicable, because the attribute does not exist for this entity; not yet known, because it has not been collected; unknown after search, because it was looked for and not found; withheld, because it exists but may not be shown to this reader; and not asserted by any source, because the sources are silent. Each has different consequences for a decision. Not applicable can be treated as settled. Not yet known calls for collection. Unknown after search is itself a finding that deserves a date and a record of where was searched. Withheld requires that the system say so and not suggest that nothing exists.

Represent these states explicitly, with an enumerated status beside the value or a typed marker, and not with sentinel values such as zero, an empty string or a date in 1900, which get averaged, sorted and charted as if they were data. The article on open-world systems develops the logic, and the one on knowledge graph completion shows what happens to evaluation when unknown triples are treated as false.

A worked example

A table of studies of Halden Therapeutics AG (fictional) has an enrolment target column. A null appears in three rows. One is a registry-only entry for an observational study with no target by design: not applicable. One is a study announced last week, for which the sponsor has not yet published a target: not yet known. One is a study for which the registry and the sponsor's site were searched on 3 June and neither gives a target: unknown after search, dated. A report that averages the column ignores all three nulls, which may be right. A report that counts studies with no target treats all three alike and tells the reader that three studies lack a target, when the correct statement distinguishes them. A report that filters for target equal to zero would silently drop them. Stating the status removes the ambiguity.

Checks a reviewer can run

For each nullable field ask what a blank means and whether the schema can say. Search for sentinel values such as 0, 9999 or empty strings that stand in for unknown. Test queries that use NOT IN and joins on nullable columns. Check that data exports keep the distinction between absent and empty. Check that withheld values are labelled withheld.

Related terms and boundaries

Null semantics is the data-level face of the open-world and closed-world assumptions. It underlies abstention, shapes what a slot-filling system may return when nothing is found, and interacts with valid time, since a value that has not begun or has ended is absent for a different reason from one never recorded.

Common misreadings

  • Using blank, false, and not applicable interchangeably.
  • Calling a search result 'not found' without defining its scope.
  • Replacing missing values with defaults during export.

Related terms

Appears in

Found an error on this page? See corrections for what counts as one, how to report it and the dated log.

Enquiry

Where does "Null semantics" bear on a decision of yours?

This entry sits under evaluation. If a decision in your organization turns on it, send the entity concerned, the sources you fuse to describe it and who may read which of them. We reply with what a first record would cover.

Or write to [email protected] in your own words.