You could check the addon "http://www.esoui.com/downloads/info265-AIResearchGrid.html" or "CraftStore" to see how they chreck if the motif/style is learned.
Not sure what the patternIndex is but check this page in the WIKI:
http://wiki.esoui.com/StyleItemIndex
With ESO API 100009 the patch notes state:
Crafting Styles
It is now possible to learn specific patterns from a style without learning every pattern in a style. This has led to a few API changes.
Changed Functions
IsSmithingStyleKnown
Now requires a pattern index in addition to the style index
Hints from Ayantir:
http://www.esoui.com/forums/showthread.php?t=6549
IsSmithingStyleKnown(styleItemIndex, patternIndex) :
But you need to interact with a crafting station and be on the good mode. (weapons / armors).