from pyfactxx import coras from pyfactxx.coras.cli import load_and_parse import rdflib crs = coras.Coras() load_and_parse(crs, 'people.rdf') crs.realise() def test(scope): cat_owners = crs.query('ask where { }', scope=scope) print("Cat owners like cats", list(cat_owners)) old_ladies = crs.query('ask where { }', scope=scope) print("Old ladies own cats", list(old_ladies)) mad_cow = crs.query('ask where { }', scope=scope) print("Mad cow does not exist", list(mad_cow)) pete = crs.query('ask where { }', scope=scope) print("Pete is a person", list(pete)) spike = crs.query('ask where { }', scope=scope) print("Spike is an animal", list(spike)) print('\nWithout inferences:') test('asserted') print('\nWith inferences:') test('inferred')