Assigning materials from string attribute
The gist of it:
To get a material assigned automatically to a lop primitive, the string attribute that needs to be on the sop primitives is called usdmaterialpath. It must point to the material in the scene graph, not the material node itself.
Here there are 2 materials. In order to be visible in the scene graph, we need to add them in the material library parameter tab.
Linking the material to the object
To get the usdmaterialpath attribute to actually be used in solaris, we need to change the bind material parameter of the sop import to Create and Bind Material Based on Imported Attributes". This will create an empty lop primitive and we can see the "blue" material is assigned to the object. BUT the material is currently only an empty primitive. Not a problem, when checking the material library node where the actual material lives, since the path is the same, i.e /materials/blue, the empty primitive gets populated with the material and the object is now blue.
Other workflows:
I personally prefer the workflow above, as I like having my sop imports in different branches, merged together and then have a material library, but if we place the material library first and then add the sop import, we don't need to set the bind material parameter to Create and Bind Material Based on Imported Attributes". Since the materials already exist, we don't need to create an empty one. The sop import will find it and assign the object to it with the "Bind Material Based on Imported Attribute" option of the bind material parameter.