Hi,
I noticed that calling multiple times set_as_rule on the same Imp object will override the previous rule.
So I created multiple Imp objects but then the results are pretty weird.
Is there a way to define a list of rules ?
(code here:
https://github.com/shazz/Owlready2_sandbox/blob/master/country.py)
extract:
Imp().set_as_rule("City(?c), population(?c, ?pop), greaterThan(?pop, 200000) -> BigCity(?c)")
Imp().set_as_rule("City(?c), population(?c, ?pop), lessThan(?pop, 30000) -> SmallCity(?c)")
Imp().set_as_rule("BigCity(?c), part_of(?c, ?country), abbrev(?country, ?ab), stringEqualIgnoreCase(?ab, 'USA') -> BigCityinUSA(?c)")
Imp().set_as_rule("SmallCity(?c), part_of(?c, ?country), abbrev(?country, ?ab), stringEqualIgnoreCase(?ab, 'USA') -> SmallCityinUSA(?c)")
Results:
* Owlready * Reparenting onto_country.Montreal: {onto_country.City} => {onto_country.BigCity}
* Owlready * Reparenting onto_country.Boston: {onto_country.City} => {onto_country.BigCityinUSA}
* Owlready * Reparenting onto_country.Montpelier: {onto_country.City} => {onto_country.BigCityinUSA, onto_country.SmallCityinUSA, onto_country.SmallCity}
=> Montpelier was inferred at the same time SmallCityinUSA and BigCityinUSA but this should be disjoint
Thanks!