I need to get mediaWiki IDs of the french Wikipedia pages which are about men or woman. For instance, the ID of the page about "Antoine Meillet" (https://fr.wikipedia.org/wiki/Antoine_Meillet) is 3, and the ID of the page about Arlette Laguiller is 139. I would need data structured like this (but I can refactor of course) :
[["Antoine Meillet",3,"male"], ["Arlette Laguillet", 139, "female"]]
Can you show me a way to do it with a SPARQL request into WikiData ?
I don't think you can achieve this using just WQS since, AFAIK, Wikipedia pages IDs are not stored on Wikidata. Nevertheless, you can actually slove the problem in the following way:
For step 1 you can run a simple SPARQL query on WQS:
Depending on system's available resources, it may return a timeout error. In my case, it was capable to execute the query, returning 691,251 results.
For step 2 you can run a just-as-simple SQL query on Quarry (quarry.wmcloud.org):
Here you can find the query execution (which currently returns 3,147,443 results). You can download the results of the last query run: