Does the `mdls` terminal command access metadata in resource forks?

Solution 1:

Yes, some of the meta data is stored in so called extended file attributes. The extended file attributes are stored in a named fork.

So in essence forks are still very much used on OS X. However, the specific "resource fork" as managed by the Resource Manager API is deprecated, as you describe.

Note that other parts of the metadata can come from a wide range of data sources - some stored on disk, others generated upon import (for example by consulting cloud services when dealing with files stored in iCloud or similar service).

mdls uses the Spotlight API in order to retrieve the metadata for display. The Spotlight API draws upon sources such as file system data, file system meta data, extended attributes, and many other places. In particular it has a system of importer plugins that are responsible for parsing various file types, contacting various cloud services, etc.