1 father dias aris father dias dionysus father Slides: 14 Download presentation Πρόγραμμα 1: Γεγονότα • • • • father (dias, aris) father (dias, dionysus) father (aris, armonia) father (kadmos, semeli) mother (eva, aris) mother (armonia, semeli) mother (semeli, dionysus) mother (aphrodite, armonia) woman (era) woman (semeli) woman (aphrodite) man (aris) man (dias) man (dionysus) man (kadmos) 5 Eρωτήσεις • Σύνθετες (Conjunctive Queries) • Π. χ. ? father (aris, armonia), woman (armonia). – Yes %Query with two calls (κλήσεις) • Ερωτήσεις με μεταβλητές (Queries with variables) • Π. χ. ? mother (era , X), man(X). – X = aris; – no • Π. χ. ? mother (era , X), man(Y). – – X = aris Y= aris; X = aris Y = dias; X = aris Y = dionysus; no – Η μεταβλητή Χ είναι κοινή (shared) 7 Γενικευμένα Γεγονότα likes (music, X). |? - likes (music, tom) Yes |? - likes (music, mary) Yes |? - likes (music, car) Yes 10 Αναδρομικοί κανόνες (Recursive rules) a→b c→d→e edge (a, b) edge (c, d) edge (a, c) f g edge (d, e) edge (b, d) edge (f, g) connected (Node, Node). connected (Node 1, Node 2) ← edge(Node 1, Link), connected (Link, Node 2). |? - connected (a, e) yes |? - connected (c, f) no 11