Why need for "wikidata"?
I am not sure why do you need wikidata parameter, since you can look it up. Let's say you are in Category:Richard Stallman then you can either:
- query somehow wikidata to see which record lists Category:Richard Stallman as d:Property:P373 and you find d:Q7439 or
- you find associated wikidata category page: d:Q19981000 and look up d:Property:P301 and you find d:Q7439 or
- you follow old fashion interwiki links to Richard_Stallman wikipedia article and look up corresponding d:Q7439