Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rustam Mehmandarov — Semantic Wizardry, Logic [Zebra] Puzzles, and Java

Rustam Mehmandarov — Semantic Wizardry, Logic [Zebra] Puzzles, and Java

What is it all about? Ever heard of Zebra Puzzles?
Those logical puzzles that are claimed to be invented by Albert Einstein as a little boy?
Those that are based on simple logical facts and go something like this: “The Brit lives in the Red house. The Swede keeps dogs as pets. The Dane drinks tea… Who owns the zebra?”

Some claim that only 2% of the population can solve it without any help.
However, with the help of semantic technologies, we can solve it in (almost) no time.

Of course, you have to know RDF, OWL, Jena, reasoning, inference.
The good news is that I will be showing you how it works in this session.
Later, I will also post a link to the code for the rest of you to try all that at home.

Moscow JUG

April 05, 2018
Tweet

More Decks by Moscow JUG

Other Decks in Programming

Transcript

  1. @RMEHMANDAROV THE PUZZLE 1. There are five houses. 2. The

    Englishman lives in the red house. 3. The Spaniard owns the dog. 4. Coffee is drunk in the green house. 5. The Ukrainian drinks tea. 6. The green house is immediately to the right of the ivory house. 7. The Fuji owner owns snails. 8. The Giant owner lives in the yellow house. 9. Milk is drunk in the middle house. 10. The Norwegian lives in the first house. 11. The man who owns Kona lives in the house next to the man with the fox. 12. The Giant owner lives in a house next to the house where the horse is kept. 13. The Scott owner drinks orange juice. 14. The Japanese owns Trek. 15. The Norwegian lives next to the blue house. Now, who drinks water? Who owns the zebra? 7
  2. @RMEHMANDAROV RDF, RDFS, OWL RDF RDFS OWL Vocabulary Data Interchange

    + rdfs:Class rdfs:subClassOf rdfs:domain / rdfs:range + owl:Restriction owl:intersectionOf owl:equivalentClass 12
  3. @RMEHMANDAROV EXAMPLE 1 1. Read a simple "Hello, World!" statement

    in RDF (in Turtle format) from file. 2. Print all individuals in the model with Jena. 3. Verify that we have only one individual that looks like this: (:Joe :hasSentMessage 'Hello World!'^^http://www.w3.org/2001/XMLSchema#string) 4. Achievement unlocked! 17
  4. @RMEHMANDAROV EXAMPLE 2 1. Recreate the model from Exercise 1

    with Jena 2. Print the model in RDF (TTL) => Same as Exercise 1 3. Achievement unlocked! Jena level 1. The basics of Jena mastered you have, young Padawan. 20