Download Building Ontologies for Artificial Intelligence: A Step-by-Step Guide and more Study notes Computer Science in PDF only on Docsity! Artificial Intelligence Programming Ontologies Chris Brooks Department of Computer Science University of San Francisco Department of Computer Science — University of San Francisco – p.1/?? 11-0: Review of FOL Some more FOL samples ... Department of Computer Science — University of San Francisco – p.2/?? 11-3: Ontologies An ontology is a vocabulary that describes all the objects of interest in the domain and the relations between them. Ontologies allow knowledge about a domain to be shared between agents (including humans) Allows knowledge to be re-used more easily.. Allows an agent to perform inference about current knowledge. Department of Computer Science — University of San Francisco – p.5/?? 11-4: Vocabulary An ontology consists of: A set of concepts or classes Professor(Brooks), ∀ x Professor(x) → USFEmployee(x) Features or attributes of these classes, often called slots or properties or roles. Salary(Brooks, $500), Name(Brooks,′ Chris′) Restrictions on slots (sometimes called facets) ∀x, y Professor(x) ∧ Salary(x, y) → x < $1000 Instances of classes. Department of Computer Science — University of San Francisco – p.6/?? 11-5: Ontologies vs OO design Classes are the focus of ontology design. In many ways, this looks like object-oriented design. We have classes and subclasses, and properties of classes that look like data members. However, slots have richer semantics than data members. A slot may attach to several classes at once. We can specify constraints on the values in a slot’s range. Slots can exist without being assigned to a class. Department of Computer Science — University of San Francisco – p.7/?? 11-8: Inference in a Semantic Net Inference becomes easy in a semantic net; to answer questions about John, we follow the labeled edges emanating from the John node. This is the same sort of inference done by modern OO languages to resolve inheritance. Strengths: Knowledge is easily visualized, relationships between objects are clearer. Weaknesses: only binary relations, no negation, disjunction, or existential quantifiers. We can extend semantic nets to include these features, but we lose the transparency. Instead, use a semantic net to model class/slot relations, and FOL (or something similar) to model rules. Department of Computer Science — University of San Francisco – p.10/?? 11-9: Protege Protege is a Java-based graphical tool for constructing ontologies. Has plugins for Jess (a rule-based inference engine) and Jython Can export data in RDF and OWL for use with the Semantic Web. Department of Computer Science — University of San Francisco – p.11/?? 11-10: Using Protege to build a simple ontology Let’s make a simple ontology to describe the USF CS department. We begin by asking competency questions - these are questions we’d like our KB to be able to answer. Who is taking CS662? Which professors teach classes on Monday? How many students are taking both CS662 and CS601? What classes should one take before taking CS662? Which professors assign the most work? Department of Computer Science — University of San Francisco – p.12/?? 11-13: Instances Now we can begin to populate our knowledge base with instances of the classes we’ve created. To begin, add ’Brooks’ as a Professor with salary $100,000 (I wish!) We can create a course object on the fly to represent CS 662. Next, create a student (use your own name). Department of Computer Science — University of San Francisco – p.15/?? 11-14: Forms We can now enter instances, but the default editor settings are not very helpful. In particular, seeing the symbol names for each instance is unhelpful. Forms will let us change that. Forms also let you customize or modify the UI that a domain expert will use to add instances. Department of Computer Science — University of San Francisco – p.16/?? 11-15: Querying our KB The query pane lets us create, save and retrieve queries We can specify either AND or OR. Try finding all students enrolled in CS662. Department of Computer Science — University of San Francisco – p.17/??