Well, I can see creatures using dousing or divining as a technique for finding materials.
I'd wager that when magic finally rolls around you'll see a modular system that develops spell and magical effects via research. Divination could be a class of magic that allows for dousing. Say you have a diviner (racial specific name, if you'd prefer) They could research in their library (theological or thaumaturgical) a Detect <stonetype> spell. This would give that dwarf the relative ability to detect that particular mineral within a certain distance of where you designate them to cast it. If the spell works successfully, all tiles that contain that mineral within range are revealed.
This could be used in another way as well. Say you have a rock layer that consists primarily of gneiss. You research a detect gneiss spell that reveals all gneiss tiles within range. Therefore you can locate undiscovered stone-types that aren't gneiss.
Obviously, there should be some cost for using the spell. The simplest way would be to do an endurance check to resist some minor damage or simply increase the Thirst, Hunger, and Exhaustion values of the caster. The more potent the spell, the more it drains your caster. Research and cast a spell that's beyond your caster's abilities and you might find that it drained them to death by starvation, thirst, or exhaustion.
You could expand this further by making any number of spells that simply edit small variables in the game:
* Alteration/Transmutation spells that alter material properties like weight, mass, boiling point, and so on. (Transmute Oak into Ebony, Transmute Lead into Gold, Flesh into Stone, Weightlessness, Evaporate Granite, etc.)
* Evocation spells that create raw matter/energy temporarily (Not just fireballs. Imagine being able to cast a force wall to block off HIDDEN FUN STUFF or summon walls of natural obsidian.) An invoker could invoke ice storms, change weather patterns, throw fireballs, and all that traditional magic jazz.
* Conjuration/Dimensional to summon allies, food supplies, create portals between key locations and so on. The key factors being the MODVALUE and SIZE ratings of whatever is summoned. Higher valued things are more difficult to summon and so on. Longer distance teleportation sustains more energy loss and so on.
* Necromancy for dealing with life/death/undeath. Resurrection, Healing, Animate Dead and manipulating organic materials and so on. Obviously, the deciding factor here is what creature is affected. The more specific the effect, the less energy it uses to cast. Making a zombie dragon is significantly harder than making a zombie cardinal. Reviving a dwarf is harder than reviving a kitten and so on. Critical failures could result in injuries, hostile undead or destruction of a corpse.
* Abjuration magic could create wards to forbid particular things ie. Cat Ward, Goblin Ward, Block Ward, Magic Ward, Arrow Ward, Blood ward, Giant Cave Spider Ward, and so on. Wards could be placed much like furniture and shields could be cast directly on dwarves to protect them from contact with hazards.
* Illusions could be made to perform specific functions. You can make illusory furniture or terrain that give dwarves happy thoughts or fool AI pathfinding (perhaps a [TRUESIGHT] token that allows creatures to ignore illusions like they ignore traps) The quality of the illusionary object is determined by the caster's Illusion skill. The created illusions have no substance and don't contribute to fortress value but will still be admired by citizens.
Artifacts could be tied to a specific spell to channel the energy more efficiently and expand a spell's effect. Take divination for example. You could build an artifact statue that could be linked to a divination spell that detects gold. Whenever the detect gold spell is cast by any allied spellcaster it would greatly expand the range/success rate/overall effect of a spell. Alternately, it could also reduce costs associated with a spell. You could have an artifact sulphur chest that reduces the drain on fireball or acid rain spells. Once an artifact is linked to a researched spell it cannot be unlinked. So choose wisely.