Creating nodes from a distinct query

We have run into a situation where we need to create a master node for certain templates.

We can get the distinct templates easy enough:

match (b {KDM:'TemplateParameter'}) return distinct(b.Label)

But I am not clear on how I would create 1 node from each distinct(b.Label). Tried this one

match (b {KDM:'TemplateParameter'}) distinct(b.Label) as Templates
with Templates merge (a:LibNode {Label:Templates.Label})

We need some of the properties from the b nodes in addition to the label but that is easy to do later

Well we already had the distinct. So the first query in my question returns a set of unique templates. The query you gave was really no improvement on that UNLESS

propertyvalues can somehow be used directly in the create ? Can't use APOC here.

Try this:

with collect (distinct b.Label) as Templates
FOREACH (plates in Templates |
	merge (a:LibNode {Label:plates})

That was nicely done. Loved the alliteration on "plates". Thank you

Thanks for your appreciation!