Aplicatii web semantice - Cursuri Automatica si Calculatoare

Download Report

Transcript Aplicatii web semantice - Cursuri Automatica si Calculatoare

Aplicatii web semantice
Modelarea cunostintelor
Curs 2
define: semantic
• semantics - the meaning of a word, phrase,
sentence, or text; "a petty argument about
semantics"
wordnetweb.princeton.edu/perl/webwn
• Semantics is the study of meaning, usually in
language. The word "semantics" itself denotes a
range of ideas, from the popular to the highly
technical. It is often used in ordinary language to
denote a problem of understanding that comes
down to word selection or connotation. ...
en.wikipedia.org/wiki/Semantic
• Idea of the semantic web
– Man and machine must interpret data in the same
way
• Man and man must interpret data in the same
way
• => need to have shared understanding inside
a community
Astronommers’ community
Programmers’ community
• The knowledge model must express relations
and constraints
Animals with

Is-a
Is-a
feet
Is-a
Lives in
(part of)
• Need to be able to represent implicit
knowledge
- Would you find the page that says
where the mess hall is?
-That's not in the book, sir.
-You mean you've never had a meal?
-Three square meals a day, sir.
-How did you find the mess hall,
if it's not in this book?
-I guess I just followed the crowd.
[ A few good men 1992]
Computers do not understand what for us is
implicit knowledge
People outside our community do not
understand what for us is implicit
knowledge
Define: ontology
• ontology ((computer science) a rigorous and
exhaustive organization of some knowledge
domain that is usually hierarchical and
contains all the relevant entities and their
relations)
• A formal, explicit specification of a shared
conceptualisation [Gruber 93]
Characteristics of an ontology
• Coverage - extent to which the primitives
mobilized by the scenarios are covered by the
ontology
• Specificity - the extend to which ontological
primitives are precisely identified
• Granularity - the extend to which primitives
are precisely and formally defined.
• Formality - the extend to which primitives are
described in a formal language.
Role of ontologies in the semantic
web
Glossary of terms
• Top level ontology – ontology that defines general
concepts that are the same across all domains
• Domain ontology – ontology that defines terms
specific to a domain
• TBOX "terminological component"—a vocabulary
associated with a set of facts ABox – classes and
properties
• ABOX – an "assertion component"—a fact associated
with a terminological vocabulary within a knowledge
base. (usually associated with instances)
• Knowledge base = TBox+ABox
Glossary of terms
• Closed world assumption – every sentence that we
don’t know to be true is false
• Open world assumption – if the truth value of a
sentence is not known we can’t assume it to be
either true or false (used in the semantic web)
• classconcept type category
• instance individual
• property slot relation attribute role
How to build an ontology
• Domain is called ontology engineering
• Multiple methodologies for building
ontologies
– Methondology
– TOVE
– Activity First Method
– Agile Methodology - RapidOWL
Methontology
• Specification – purpose of the ontology, level of formality
(highly informal, semi-formal, formal), scope (set of terms to
be described)
• Knowledge acquisition – discussions with experts, text
analysis
• Conceptualisation
– Build glossary of terms
– Analyze separately concepts and verbs
• Integration
– Search for similar terms in higher level ontologies
• Implementation
• Validation
• Documentation
Methondology - Conceptualisation
• For concepts specify
– Table of instant attributes – which are the
attributes possible for the instances of the
concepts
– Table of instances
– Table of constants
– Attribute classification trees – which are the
relations between attributes and constants
Methontology – Conceptualisation
(2)
• For verbs specify:
– Verbs dictionary – meaning of the verbs in a
declarative way
– Table of conditions – need to be satisfied before
or after action is performed
• Tables of formulas
• Tables of rules
TOVE methodology
• Define a set of Motivating Scenarios
• Define a set of Informal Competency Questions that
the ontology must answers in order to support the
motivating scenarios
• Using First-Order Logic, define the Terminology of
the ontology
• Formally redefine the Competency Questions using
the terminology and first-order logic
• Define the semantics and constraints on the
terminology using first-order logic
TOVE
Informal competency questions = requirements in form of questions that the
ontology must be able to answer
Axioms specify the definitions of concepts and constraints
Completeness theorems= the conditions under which the solutions to the
questions are complete
AFM – Activity First Method
• method of building task and domain ontologies from
technical documents
• Extraction of task-units:
– Divide the text in the technical documents into small blocks to extract
vocabulary easier.
– Extract task-units which contain only one process(action) from these
blocks.
– Make a flow chart called a concrete task-flow by combining taskunits.
• Organization of task-activities
– Conceptualize task-activities from verbs in the task-units.
– Organize the task-activities in an is-a hierarchy.
– Define role-concepts, called task-activity roles, which appear in the
input/output of these task-activities.
AFM – Activity First Method
• Analysis of task-structure:
– Generalize the concrete task-flows to obtain general task-flows.
– Describe the object-flows, which clearly express relations between
inputs and outputs of the task-activities, in the general task-flows
obtained above.
– Define the task-context roles on the basis of these object-flows. By
task-context roles, we mean the role-concepts dependent on the
whole process of a task.
– Extract the domain terms which play a task-context role.
• Organization of domain concepts
– Discriminate between the roles dependent on the domain concepts
and the basic concepts.
– Organize the domain concepts in an is-a hierarchy
RapidOWL – Agile methodology
• domain experts initially express all facts they assume
as true by means of statements
• More experienced domain experts assist in
restructuring, interlinking and consolidating the
gathered data
• Knowledge engineers can support such a community
of domain experts with advice for reasonable
representation methods and by providing ontology
evolution and data migration strategies.
• Knowledge engineers can further enrich the
knowledge base with logical ontology axioms
Practical development guide
Ontology 101
• Determine the domain and scope of the ontology
– Competency questions for determining scope
• Consider reusing existing ontologies
• Enumerate important terms in the ontology
• Define the classes and the class hierarchy
– Top-down approach – from the most general concepts to
the most specific
– Bottom-up approach
– Combination (middle-out)
• Define the properties of classes - slots
Practical development guide
Ontology 101
• Define the facets of slots
– Slot cardinality
– Slot-value type (Number, String, Instance,…)
– Domain and range
• Create instances
Methodology conclusions
• Most methodologies depend on what you
need to do. Establish this first!
• Work in teams to gather concepts in the
ontology
• Group terms according to properties and
create the is-a hierarchy
• Establish the relations between concepts and
the relation properties
• Validate the ontology + create a
documentation
Conclusions and practical
observations
• How the development process should look like
• How the actual process takes place
Middle layer guidelines
• (Generic constraints and guidelines which specify
major steps )
• Concepts rather than terms
• Mixed and flexible strategies of Top-down, Bottomup and Middle-out is strongly suggested
• Top-level category should be identified in the early
phase of the development process to govern the rest
of the steps.
• Note that you cannot define any concept completely
in theory. Therefore, do not stick to the definition of
each term too much.
Middle layer guidelines
• When you deal with a concept, identify its main
components; that is, “part-of” relation as well as its
main attributes.
• Arrange and resolve the terminological issues(how to
name a concept) at the last step.
• Put a higher priority on is-a hierarchy construction
than term definition. Carefully designed is-a
hierarchy gives you a correct context to define a
term.
Bottom layer guidelines
• Determine an essential property for each concept
and instance. Having an essential property of each
concept help you a lot.
• Each subclass of a super class is distinguished by the
values of exactly one attribute of the super class.
• Proper use of is-a relation should inherit the
“Essential” property of its super classes.
• Clear and consistent differentiation between basic
concepts (man, rice, oil, etc.) and role concepts
(teacher, food, fuel, etc.)
Bottom layer guidelines
• Do not worry about the vagueness of the boundary
between similar concepts. Most boundaries between
concepts are vague.
• Class partition is not a part-of relation. Ex. Male is
not part-of human.
• When you notice you do not have an appropriate
term to represent a concept you identify, do not
hesitate to coin a new term. The new term could be
temporary which will be fixed at the last stage.
• Consult a reliable upper ontology when you find the
necessity of a general and high level distinction of
categories.
Usual problems
• Class or individual?
– A set of individuals is countable
– Every individual has a clear identity
– If 2 concepts have equivalent descriptions then
they represent the same concept
– Descriptions of individuals can change
– Changes of individuals do not alter the class
hierarchy
– Choosing class vs. individual depends on
granularity
Usual problems
• Concept or property
– Person = concept
– Mother is not a concept. It only exists as a concept
if we consider the relation between 2 persons.
– There are usually conventions for choosing
property names: hasMother, hasGenre
– Properties that change over time – extrinsic
– Properties that don’t change over time - intrinsic
Usual problems
• Difficult to reason about individuals
• Reasoning is usually performed at the
concept/class level
Practical example - PC ontology
• Objectives
– We’ll define the notion of computer and of computer part
as well as the relations between computer parts and
compatibility constraints that appear when putting a
computer together
• Competency questions
– Which of the processors in stock is compatible with the
following motherboard?
– Having a configuration we need to establish if it is correct
– Build a configuration with given constraints and using
components with lowest prices
Practical example - PC ontology
• Extracting the concept
ontologies
– No similar ontologies
– Using taxonomies from ecommerce web sites
• Ex: concept of motherboard
Shop 1
Shop 2
Shop 3
Manufacture Manufacture Manufacture
r
r
r
Model
Name
Cod
producer,
Platform
Socket
CPU
Socket
Chipset
Chipset
Chipset
I/O
FSB/ HTT
BUS
Sound
Audio
Sound
Slots
PCIe,
AGP/PCI
IDE/SATA
Connectors
PATA,
Connectors
SATA
IDE/SATA
Memory
Memory
Memory
LAN
Retea
LAN
Price
Price
Price
Concept list
• Speakers, WebCam, Carcasa, Card Reader,
HeadPhones, Microphone, Cooler, FaxModem, Floppy Disk, Hard Disk, Printer,
Memory, Monitor, Mouse, Motherboard,
Soundcard….
properties
•
Model, number of speakers, Resolution, FPS, Sensor type,
Interface, Format, card type, RPM, airFlow, sound level,
Chipset, Dimension, Capacity, Cache, printing speed, Printer
type, Mhz, reading speed(MB/s), writing speed(MB/s),
Frequency (min, max), Color, Dot pitch, Socket, I/O, Sound,
Memory, Slot, LAN, IDE/SATA, Connectors, CacheL2, CacheL1,
FSB, Tehnology, Color depth, has Remote, Format TV, Format
Capture,…
Defining classes
• Top-down :
– Component
• Motherboard
– Motherboard with socket 939
– Motherboard with socket 754
• Processor
•…
Defining properties + constraints
• Component: Producer
– Processor: socket, frecquency
• Constraints:
– Cardinalitaty: 1 component has 1 producer
– Domain-range: hasProducer has domain
Component and has range Company
References
• Methontology http://speech.inesc.pt/~joana/prc/artigos/06c%20METHONTOLOGY%20fr
om%20Ontological%20Art%20towards%20Ontological%20Engineering%20
-%20Fernandez,%20Perez,%20Juristo%20-%20AAAI%20-%201997.pdf
• TOVE - https://eprints.kfupm.edu.sa/50622/1/50622.pdf
• Guidelines - http://www.ei.sanken.osaka-u.ac.jp/pub/miz/Part2V3.pdf
• RapidOWL http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.60.1894&rep=
rep1&type=pdf
• Ontology Development 101 http://protege.stanford.edu/publications/ontology_development/ontolog
y101-noy-mcguinness.html