If you want to be 100% technically correct, this latest RFC from the IETF does give precise information on all DNS terminology.
https://www.rfc-editor.org/rfc/rfc7719 "DNS Terminology".
Note that this deals with technical terms, not marketing ones.
If you search for apex in it you get:
Apex: The point in the tree at an owner of an SOA and
corresponding
authoritative NS RRset. This is also called the "zone apex".
[RFC4033] defines it as "the name at the child's side of a zone
cut". The "apex" can usefully be thought of as a data-theoretic
description of a tree structure, and "origin" is the name of the
same concept when it is implemented in zone files. The
distinction is not always maintained in use, however, and one can
find uses that conflict subtly with this definition. [RFC1034]
uses the term "top node of the zone" as a synonym of "apex", but
that term is not widely used. These days, the first sense of
"origin" (above) and "apex" are often used interchangeably.
In light of this, github definition is slightly wrong.
example.com
is the apex of the zone example.com
(because it is delegated from .com
, that we know for sure), that has www.example.com
in it.
Speaking about domains and subdomains is something opening to many perils, as you can not judge, just by looking at the string, where the zone cuts are, hence where the "subdomain" starts. Examples to study: www.dk
, www.minefi.gouv.fr
to start with.
Just by looking at www.example.com
(without doing any kind of DNS queries) you can not say if www
is just a label inside the example.com
zone, or if www.example.com
is an apex because it has been delegated from example.com
.
Of course, one might argue that www
gives an hint, but then replace it with admin
, and the mystery remains unsolved.