Chapter 7A Semantic Web Primer 1 Chapter 7 Ontology Engineering Grigoris Antoniou Paul Groth Frank van Harmelen Rinke Hoekstra
Chapter 7A Semantic Web Primer 2 Lecture Outline 1. Introduction 2. Constructing Ontologies Manually 3. Reusing Existing Ontologies 4. Semiautomatic Ontology Acquisition 5. Ontology Mapping 6. Exposing Relational Databases 7. Semantic Web Application Architecture
Chapter 7A Semantic Web Primer 3 Methodological Questions – How can tools and techniques best be applied? – Which languages and tools should be used in which circumstances, and in which order? – What about issues of quality control and resource management? Many of these questions for the Semantic Web have been studied in other contexts – e.g. software engineering, object-oriented design, and knowledge engineering
Chapter 7A Semantic Web Primer 4 Lecture Outline 1. Introduction 2. Constructing Ontologies Manually 3. Reusing Existing Ontologies 4. Semiautomatic Ontology Acquisition 5. Ontology Mapping 6. Exposing Relational Databases 7. Semantic Web Application Architecture
Chapter 7A Semantic Web Primer 5 Main Stages in Ontology Development Determine scope ( 范围 ) Consider reuse ( 复用 ) Enumerate terms ( 术语 ) Define taxonomy ( 分类 ) Define properties ( 属性 ) Define facets ( 侧面 ) Define instances ( 实例 ) Check for anomalies ( 异常 ) Not a linear process!
Chapter 7A Semantic Web Primer 6 Determine Scope There is no correct ontology of a specific domain – An ontology is an abstraction of a particular domain, and there are always viable alternatives What is included in this abstraction should be determined by – the use to which the ontology will be put – by future extensions that are already anticipated
Chapter 7A Semantic Web Primer 7 Determine Scope Basic questions to be answered at this stage are: – What is the domain that the ontology will cover? – For what we are going to use the ontology? – For what types of questions should the ontology provide answers? – Who will use and maintain the ontology?
Chapter 7A Semantic Web Primer 8 Consider Reuse With the spreading deployment of the Semantic Web, ontologies will become more widely available We rarely have to start from scratch when defining an ontology – There is almost always an ontology available from a third party that provides at least a useful starting point for our own ontology
Chapter 7A Semantic Web Primer 9 Enumerate Terms Write down in an unstructured list all the relevant terms that are expected to appear in the ontology – Nouns form the basis for class names – Verbs (or verb phrases) form the basis for property names Traditional knowledge engineering tools (e.g. laddering and grid analysis ( 梯度和网格分析 ) ) can be used to obtain – the set of terms – an initial structure for these terms
Chapter 7A Semantic Web Primer 10 Define Taxonomy Relevant terms must be organized in a taxonomic hierarchy – Opinions differ on whether it is more efficient/reliable to do this in a top-down or a bottom-up fashion Ensure that hierarchy is indeed a taxonomy: – If A is a subclass of B, then every instance of A must also be an instance of B (compatible with semantics of rdfs:subClassOf
Chapter 7A Semantic Web Primer 11 Define Properties Often interleaved with the previous step The semantics of subClassOf demands that whenever A is a subclass of B, every property statement that holds for instances of B must also apply to instances of A – It makes sense to attach properties to the highest class in the hierarchy to which they apply
Chapter 7A Semantic Web Primer 12 Define Properties While attaching properties to classes, it makes sense to immediately provide statements about the domain and range of these properties There is a methodological tension here between generality ( 一般 ) and specificity ( 具体 ) : – Flexibility (inheritance to subclasses) – Detection of inconsistencies and misconceptions
Chapter 7A Semantic Web Primer 13 Define Facets: From RDFS to OWL Cardinality restrictions ( 基数限制 ) Required values ( 特定的值 ) – owl:hasValue – owl:allValuesFrom – owl:someValuesFrom Relational characteristics ( 关系特性 ) – symmetry, transitivity, inverse properties, functional values
Chapter 7A Semantic Web Primer 14 Define Instances Filling the ontologies with such instances is a separate step Number of instances >> number of classes Thus populating an ontology with instances is not done manually – Retrieved from legacy data sources (DBs) – Extracted automatically from a text corpus
Chapter 7A Semantic Web Primer 15 Check for Anomalies An important advantage of the use of OWL over RDF Schema is the possibility to detect inconsistencies – In ontology or ontology+instances Examples of common inconsistencies – incompatible domain and range definitions for transitive, symmetric, or inverse properties – cardinality properties – requirements on property values can conflict with domain and range restrictions
Chapter 7A Semantic Web Primer 16 Lecture Outline 1. Introduction 2. Constructing Ontologies Manually 3. Reusing Existing Ontologies 4. Semiautomatic Ontology Acquisition 5. Ontology Mapping 6. Exposing Relational Databases 7. Semantic Web Application Architecture
Chapter 7A Semantic Web Primer 17 Codified Bodies of Expert Knowledge (专家知识汇编) Medical domain: Cancer ontology from the National Cancer Institute in the United States Cultural domain: – Art and Architecture Thesaurus (AAT) with 125,000 terms in the cultural domain – Union List of Artist Names (ULAN), with 220,000 entries on artists – Iconclass vocabulary of 28,000 terms for describing cultural images Geographical domain: Getty Thesaurus of Geographic Names (TGN), containing over 1 million entries
Chapter 7A Semantic Web Primer 18 Integrated Vocabularies (整合词汇表) Merge independently developed vocabularies into a single large resource e.g. Unified (一体化) Medical Language System integrating 100 biomedical vocabularies – The UMLS metathesaurus contains 750,000 concepts, with over 10 million links between them The semantics of a resource that integrates many independently developed vocabularies is rather low – But very useful in many applications as starting point
Chapter 7A Semantic Web Primer 19 Upper-Level Ontologies (高层本体) Some attempts have been made to define very generally applicable ontologies ( 一般化的本体 ) – Sometimes known as upper-level ontologies Cyc (一个常识知识库), with 60,000 assertions on 6,000 concepts Standard Upperlevel Ontology (SUO)
Chapter 7A Semantic Web Primer 20 Topic Hierarchies (主题层次) Some “ontologies” do not deserve this name: – simply sets of terms, loosely organized in a hierarchy This hierarchy is typically not a strict taxonomy but rather mixes different specialization relations (e.g. is-a, part-of, contained-in)
Chapter 7A Semantic Web Primer 21 Topic Hierarchies Such resources often very useful as starting point Example: Open Directory hierarchy, containing more then 400,000 hierarchically organized categories and available in RDF format
Chapter 7A Semantic Web Primer 22 Linguistic Resources (语言学资源) Some resources were originally built not as abstractions of a particular domain, but rather as linguistic resources These have been shown to be useful as starting places for ontology development – e.g. WordNet, with over 90,000 word senses
Chapter 7A Semantic Web Primer 23 Encyclopedic Knowledge (百科全书式 的知识) Wikipedia, the community-generated encyclopedia, provides a plethora of information about a range of topics DBpedia extracts knowledge from Wikipedia and exposes it as Linked Data Yago (一种知识库) leverages Wikipedia but also contains information from WordNet and GeoNames
Chapter 7A Semantic Web Primer 24 Ontology Libraries Swoogle is the best repository of online ontologies, which has cataloged over 10,000 Semantic Web documents and indexed metadata The Sindice search index maintains an index of almost all RDF data published on the Semantic Web Prefix.cc lists the most commonly used namespace prefixes which link to the corresponding ontology they represent
Chapter 7A Semantic Web Primer 25 When Reusing Existing Ontologies Rarely existing ontologies can be reused without changes Existing concepts and properties must be refined using rdfs:subClassOf and rdfs:subPropertyOf Alternative names must be introduced which are better suited to the particular domain using owl:equivalentClass and owl:equivalentProperty We can exploit the fact that RDF and OWL allow private refinements of classes defined in other ontologies
Chapter 7A Semantic Web Primer 26 Lecture Outline 1. Introduction 2. Constructing Ontologies Manually 3. Reusing Existing Ontologies 4. Semiautomatic Ontology Acquisition 5. Ontology Mapping 6. Exposing Relational Databases 7. Semantic Web Application Architecture
Chapter 7A Semantic Web Primer 27 The Knowledge Acquisition Bottleneck Manual ontology acquisition remains a time- consuming, expensive, highly skilled, and sometimes cumbersome ( 不太方便 ) task Machine Learning (机器学习) techniques may be used for – knowledge acquisition (获取) or extraction (抽 取) – knowledge revision (修订) or maintenance (维 护)
Chapter 7A Semantic Web Primer 28 Tasks Supported by Machine Learning Extraction of ontologies from existing data on the Web Extraction of relational data and metadata from existing data on the Web Merging and mapping ontologies by analyzing extensions (外延) of concepts Maintaining ontologies by analyzing instance data Improving SW applications by observing users
Chapter 7A Semantic Web Primer 29 Machine Learning Techniques for Ontology Engineering Clustering ( 聚类 ) Incremental ontology updates ( 递增的本体更新 ) Support for the knowledge engineer ( 知识工程师 ) Improving large natural language ontologies Pure (domain) ontology learning
Chapter 7A Semantic Web Primer 30 Machine Learning Techniques for Natural Language Ontologies Natural language ontologies (NLOs) contain lexical relations (词汇关系) between language concepts – They are large in size and do not require frequent updates The state of the art in NLO learning looks quite optimistic: – A stable general-purpose (通用的) NLO exist – Techniques for automatically or semi-automatically constructing and enriching domain-specific (领域相关的) NLOs exist
Chapter 7A Semantic Web Primer 31 Machine Learning Techniques for Domain Ontologies They provide detailed descriptions (具体的描述) Usually they are constructed manually The acquisition of the domain ontologies is still guided (引导) by a human knowledge engineer – Automated learning techniques play a minor role in knowledge acquisition – They have to find statistically valid dependencies in the domain texts and suggest them to the knowledge engineer
Chapter 7A Semantic Web Primer 32 Machine Learning Techniques for Ontology Instances Ontology instances can be generated automatically and frequently updated while the ontology remains unchanged Fits nicely into a machine learning framework Successful ML applications – Are strictly dependent on the domain ontology, or – Populate the markup without relating to any domain theory – General-purpose techniques not yet available
Chapter 7A Semantic Web Primer 33 Different Uses of Ontology Learning Ontology acquisition (获取) tasks in knowledge engineering – Ontology creation from scratch by the knowledge engineer – Ontology schema extraction from Web documents – Extraction of ontology instances from Web documents Ontology maintenance (维护) tasks – Ontology integration (整合) and navigation (导航) – Updating some parts of an ontology – Ontology enrichment (丰富) or tuning (调整)
Chapter 7A Semantic Web Primer 34 Ontology Acquisition Tasks Ontology creation from scratch by the knowledge engineer – ML assists the knowledge engineer by suggesting the most important relations in the field or checking and verifying the constructed knowledge bases Ontology schema extraction from Web documents – ML takes the data and meta-knowledge (like a meta- ontology) as input and generate the ready-to-use ontology as output with the possible help of the knowledge engineer
Chapter 7A Semantic Web Primer 35 Ontology Acquisition Tasks Extraction of ontology instances from Web documents – This task extracts the instances of the ontology presented in the Web documents and populates given ontology schemas – This task is similar to information extraction and page annotation, and can apply the techniques developed in these areas
Chapter 7A Semantic Web Primer 36 Ontology Maintenance Tasks Ontology integration and navigation – Deals with reconstructing and navigating in large and possibly machine-learned knowledge bases Updating some parts of an ontology that are designed to be updated Ontology enrichment or tuning – This does not change major concepts and structures but makes an ontology more precise
Chapter 7A Semantic Web Primer 37 Potentially Applicable Machine Learning Algorithms Propositional rule ( 命题规则 ) learning algorithms Bayesian ( 贝叶斯 ) learning – generates probabilistic attribute-value rules First-order logic rules learning Clustering algorithms – They group the instances together based on the similarity or distance measures between a pair of instances defined in terms of their attribute values
Conclusion Although there is much potential, and indeed need, for these techniques to be deployed for Semantic Web engineering, this is far from a well-understood area No off-the-shelf ( 现成的 ) techniques are currently available, and it is not clear that this is likely to change in the near future Chapter 7A Semantic Web Primer 38
Chapter 7A Semantic Web Primer 39 Lecture Outline 1. Introduction 2. Constructing Ontologies Manually 3. Reusing Existing Ontologies 4. Semiautomatic Ontology Acquisition 5. Ontology Mapping 6. Exposing Relational Databases 7. Semantic Web Application Architecture
Ontology Mapping A single ontology will rarely fulfill the needs of a particular application; multiple ontologies will have to be combined This raises the problem of ontology integration (also called ontology alignment or ontology mapping) Current approaches deploy a whole host of different methods; we distinguish linguistic, statistical, structural and logical methods Chapter 7A Semantic Web Primer 40
Linguistic methods The most basic methods try to exploit the linguistic labels attached to the concepts in source and target ontology in order to discover potential matches This can be as simple as basic stemming (词干提取) techniques or calculating Hamming distances, or it can use specialized domain knowledge (In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different.) Chapter 7A Semantic Web Primer 41
Statistical Methods Some methods use instance data, to determine correspondences between concepts A significant statistical correlation (相关性) between the instances of a source concept and a target concept, gives us reason to believe that these concepts are strongly related These approaches rely on the availability of a sufficiently large corpus of instances that are classified in both the source and the target ontologies Chapter 7A Semantic Web Primer 42
Structural Methods Since ontologies have internal structure, it makes sense to exploit the graph structure of the source and the target ontologies and try to determine similarities, often in coordination with other methods − If a source concept and a target concept have similar linguistic labels, then the dissimilarity of their graph neighborhoods could be used to detect homonym (同音异 义字) problems where purely linguistic methods would falsely declare a potential mapping Chapter 7A Semantic Web Primer 43
Logical Methods The most specific to mapping ontologies An ontology is an explicit and formal specification of a shared conceptualization – It makes sense to exploit the formalization of source and target structures A serious limitation is that many practical ontologies are semantically rather lightweight and thus do not carry much logical formalism Chapter 7A Semantic Web Primer 44
Mapping Implementations There are several frameworks for ontology mapping, such as R2R Framework and LIMES The service sameas.org collects and exposes owl:sameAs mappings from several different sources The research community has run the Ontology Alignment Evaluation Initiative to encourage creating more accurate and comprehensive mappings Chapter 7A Semantic Web Primer 45
Chapter 7A Semantic Web Primer 46 Lecture Outline 1. Introduction 2. Constructing Ontologies Manually 3. Reusing Existing Ontologies 4. Semiautomatic Ontology Acquisition 5. Ontology Mapping 6. Exposing Relational Databases 7. Semantic Web Application Architecture
Chapter 7A Semantic Web Primer 47 Exposing Relational Databases Most websites are dynamically generated from data stored in a relational database Because so much data is available in relational databases, it can provide a convenient source of instance data
Chapter 7A Semantic Web Primer 48 Mapping Terminology We first revisit the terminology of a database and see how the terminology can be mapped to RDFS/OWL terms Below is a table from a real estate database (relation, attributes, and tuple) HomeIdCityPrice(Euros) 1Amsterdam Utrecht
Chapter 7A Semantic Web Primer 49 A Simple Approach Each table in the database can be considered as a class Each attribute can be considered as a property Each tuple can be considered as an instance One must create URIs for each of the entities HomeIdCityPrice(Euros) 1Amsterdam Utrecht
Chapter 7A Semantic Web Primer 50 Conversion Tools It is possible to automate much of the conversion process Most existing tools work by analyzing the structure of the relational database and then generating almost complete RDF The user is then required to modify configuration files in order to specify more appropriate URIs as well as links to existing ontologies
Chapter 7A Semantic Web Primer 51 Conversion Tools Conversion tools are often used in two capacities – One is to expose a relational databased directly as a SPARQL endpoint – The second is to convert in bulk a database to RDF, which can then be uploaded to a triple store
Chapter 7A Semantic Web Primer 52 Lecture Outline 1. Introduction 2. Constructing Ontologies Manually 3. Reusing Existing Ontologies 4. Semiautomatic Ontology Acquisition 5. Ontology Mapping 6. Exposing Relational Databases 7. Semantic Web Application Architecture
Chapter 7A Semantic Web Primer 53 SW Application Architecture Building the Semantic Web involves using – the new languages described in this course – a rather different style of engineering – a rather different approach to application integration We describe how a number of Semantic Web-related tools can be integrated in a single lightweight architecture – using Semantic Web standards to achieve interoperability between tools
Chapter 7A Semantic Web Primer 54 SPARQL
Chapter 7A Semantic Web Primer 55 Knowledge Acquisition Initially, tools must exist that use surface analysis techniques to obtain content from documents – Unstructured natural language documents: statistical techniques and shallow natural language technology ( 浅层自然语言技术 ) – Structured and semi-structured documents: induction ( 归纳 ), pattern recognition
Chapter 7A Semantic Web Primer 56 Knowledge Storage The output of the analysis tools is sets of concepts, organized in a shallow concept hierarchy ( 浅层的概 念层次 ) with at best very few cross-taxonomical relationships RDF/RDF Schema are sufficiently expressive to represent the extracted info – Store the knowledge produced by the extraction tools – Retrieve this knowledge, preferably using a structured query language (e.g. SPARQL)
Chapter 7A Semantic Web Primer 57 Knowledge Maintenance and Use A practical Semantic Web repository ( 仓库 ) must provide functionality for managing and maintaining the ontology: – change management – access and ownership rights – transaction management There must be support for both – Lightweight ontologies that are automatically generated from unstructured and semi-structured data – Human engineering of much more knowledge-intensive (知 识密集的) ontologies
Chapter 7A Semantic Web Primer 58 Knowledge Maintenance and Use Sophisticated editing environments must be able to – Retrieve ontologies from the repository – Allow a knowledge engineer to manipulate it – Place it back in the repository The ontologies and data in the repository are to be used by applications that serve an end-user External applications may access the knowledge through the exposure of data using: a SPARQL endpoint, Linked Data, or RDFa
Chapter 7A Semantic Web Primer 59 Technical Interoperability Syntactic interoperability was achieved because all components communicated in RDF Semantic interoperability was achieved because all semantics was expressed using RDF Schema Physical interoperability was achieved because all communications between components were established using simple HTTP connections
Chapter 7A Semantic Web Primer 60 Frameworks Drupal content management system Jena and Sesame are widely used and well- supported open source frameworks Companies such as Kasabi and Dydra provide hosted frameworks for building SW applications