It helps to take those words apart to understand them. The prefix gives you the grammatical meaning:
- a- = that, used for relative pronouns
- se(m)- = no-
- vala- = some-/any-
And combining them with the respective question words in that fashion gives the following meanings:
- mennyi - how much?
- amennyi - that much
- semennyi - no amount of
- valamennyi - some amount of
- hány - how many?
- ahány - that many
- sehány - none, no number of
- valahány - some number of
- melyik - which?
- amelyik - that one
- semelyik - none (of them)
- valamelyik - one of them
- milyen - what kind of?
- amilyen - that kind of
- semmilyen - no kind of
- valamilyen - some kind of
- mi - what?
- ami - what (As in "I see what you are doing")
- semmi - nothing
- valami - something
And so on.
The issue is that "The children from the school, one of which was in my garden" is not a complete sentence. You have the subject "the children from the school" and then a relative clause defining the children more, "one of which was in my garden". But the rest of the main clause is missing. You're lacking the predicate, what's happening with the children. Like in "The children from the school, one of which was in my garden, went to look for berries today." However, the Hungarian sentence doesn't want to talk about what the children from the school are doing, but what one single child is doing.
The Hungarian sentence "Valamelyik gyerek az iskolából a kertemben volt" is complete like that. There's no relative clause going on here. You have the subject "valamelyik gyerek az iskolából" ("one of the children from the school"), and the predicate "a kertemben volt" ("was in my garden"). That's the important thing you want to say. What is that one child doing?
Also: I might have misunderstood your comment. :´)
So, second try: why can't valamelyik be used in a construction like "The children from the school, one of which was in my garden, were looking for berries"?
Valamelyik simply isn't a relative pronoun. Instead it's an indefinite pronoun, and works in much the same way like English "someone", "somewhere", "something", etc. Just with the difference that you can use it as an adjective, so maybe "some child".
Not quite. I think. "One of which" sounds like a relative construction to me, but valamelyik is not a relative pronoun. An example:
- Valamelyik gyerek az iskolából a kertemben volt. - One of the children from the school was in my garden. (or maybe "some child")
You can't use "one of which" here, because there is no relative clause in this sentence. "One of which" would be realised differently in Hungarian, usually with a construction similar to "amelyek közül az egyik" (lit. "from among which the one..."):
- Néztünk nehány madarat, amelyek közül az egyik repült a rossz irányba. - We were watching a couple of birds, one of which was flying in the wrong direction.
The first sounds good, the second doesn't work. Semennyi is basically the adjective to fű, so you can't separate them. You can say "Semennyi fű sincs a kertben", though.
There are three word groups in this sentence that need to stay intact: "Semennyi fű", "nincs" and "a kertben". You can juggle those around pretty freely, resulting in multiple sentences with various degrees of naturalness. The given sentence, "Nincs a kertben semennyi fű", doesn't even sound that proper to me, but then again I still have my issues with negations. :´)