One way to achieve this can be a triple nested hash map. Or a hashmap of hashmaps of hashmaps.
The pseudo-code for the request will be something like this:
string query(string param1, string param2, string param3)
{
if param1 != WILDCARD
then subquery1(hashmap[param1], string param2, string param3);
else for each x in hashmap, subquery1(x,string param2, string param3)
}
string subquery1(hashmap[hashmap[]] maps, string param2, string param3)
{
if param2 != WILDCARD
then subquery2(maps[param2], string param3);
else for each x in maps, subquery2(x, string param3)
}
string subquery2(hashmap[] maps, string param3)
{
if param3 != WILDCARD
then return maps[param3]
else for each x in maps, return maps[param3]
}
, , . , 3 ? , , , , , .
, .
key1, key2, key3 = value1
key1, key2, key4 = value2
key1, *, key3, value1.
key1, *, *, 1, value2 .
Update:
( "1", "," 3"),
param1 ( ), subquery1 (hashmap [ "key1" ], "," key3");
, 1, hashMap [ "key1" ] , hashmap,
hashmap hashmap2 []. , 1 (hashmap2 [], "*", "key3" );
1.
param2 "*", hashmap2 [],
hashmap3 [] hashmap2 [], subquery3 (hashmap3 [], "key3" );
, param3 , hashmap3 [ "key3" ], value1;