Put the ricotta in a large bowl. Stir in the cheeses. Add the green onion to cheese mixture. Stir in the rosemary, egg, salt and pepper. Cover and refrigerate until ready to use.
Preheat oven to 350°F.
Melt the butter in a small saucepan. Lightly brush a large rimmed baking sheet with about 1 tablespoon of the melted butter.
Place 1 phyllo sheet on a work surface with the short end close to you (keep the remaining phyllo covered with plastic wrap and a damp kitchen towel.) Brush the phyllo lightly with melted butter, then cut lengthwise into 3 equal strips, each about 4 inches wide. Place 1 tablespoon of cheese mixture at bottom end of each strip. Fold a corner of phyllo over filling and repeat folding as you would fold a flag until entire strip is folded, brushing with melted butter as you go along. Place the triangles on a baking sheet and brush the tops with melted butter. Repeat the process until you have 24 triangles.
Bake until golden brown and crisp, about 20 minutes.