I want to create a Metadata Schema using Core service with two fields Keywords and title so that I can attach this Metadata Schema on the page. But I didn't find any class to create a metadata. I found a class SchemaData to create a Schema and it successfully created a schema but I did not find any method to set the type of this schema. I try to create a schema with the root element Metadata but it is giving me an error.
Invalid value for property 'Purpose'. The content of RootElementName cannot be 'Metadata' for schemas with purpose 'Component.
how can I do this?