Two things.
First, if you structure the facts as you suggest, it will be difficult to match them. A rule trying to match:
parent_child($parent, $child, $score)
would only match your third example, and not the other 3 because of the different number of arguments.
You might consider making each parent-child relationship a separate fact. Thus your examples would become:
parent_child(1, 2, 90)
parent_child(1, 3, 80)
parent_child(2, 1, 80)
parent_child(2, 3, 90)
parent_child(2, 4, 50)
parent_child(3, 4, 85)
Then the above rule would be able to match all of the facts.
But note the omission of parent 4. If you want to know what all of the parents are, you could also have parent facts that simply identify the parents (or whatever these things are):
parent(1)
parent(2)
parent(3)
parent(4)
Second, you have two options about how to get this information into pyke.
The easiest would be write a function to read the json files and asserting the information in a
fact base with either add_case_specific_fact or add_universal_fact.
Use add_case_specific_fact if you want to possibly assert different facts for each run of the rule engine. In that case, you would have to run your function each time before running the run engine. This might be useful, for example, if different runs of the rule engine should use different json files.
On the other hand, if you use add_universal_fact, you would only need to run your function once, and then those facts would be available to all runs of the rule engine.
The other way to get the json information into pyke would be to develop your own knowledge base. Pyke has been written to allow you to develop your own kind of knowledge bases, as is mentioned in the third bullet
here. This would be more work, and may not perform as well since pyke does a good job indexing the facts in a fact base. You would need to consult the pyke source code to see how to do this.
-Bruce