Ontological Modeling: Part 2

Similar documents
Ontological Modeling: Part 11

Ontological Modeling: Part 7

Ontological Modeling: Part 8

Ontological Modeling: Part 14

Ontological Modeling: Part 13

2. RDF Semantic Web Basics Semantic Web

Semantic Web In Depth: Resource Description Framework. Dr Nicholas Gibbins 32/4037

Verbalizing Business Rules: Part 10

RDF /RDF-S Providing Framework Support to OWL Ontologies

Ontological Modeling: Part 15

XML and Semantic Web Technologies. III. Semantic Web / 1. Ressource Description Framework (RDF)

2. Knowledge Representation Applied Artificial Intelligence

Logical Data Modeling: Part 1

Verbalizing Business Rules: Part 9

Using RDF to Model the Structure and Process of Systems

Today: RDF syntax. + conjunctive queries for OWL. KR4SW Winter 2010 Pascal Hitzler 3

Formalising the Semantic Web. (These slides have been written by Axel Polleres, WU Vienna)

H1 Spring B. Programmers need to learn the SOAP schema so as to offer and use Web services.

Knowledge Representation for the Semantic Web

LECTURE 09 RDF: SCHEMA - AN INTRODUCTION

Bridging the Gap between Semantic Web and Networked Sensors: A Position Paper

RDF. Mario Arrigoni Neri

Developing markup metaschemas to support interoperation among resources with different markup schemas

SEMANTIC WEB 03 RDF DATA MODEL RESOURCE DESCRIPTION FRAMEWORK IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

Multi-agent and Semantic Web Systems: RDF Data Structures

Making BioPAX SPARQL

The Formal Syntax and Semantics of Web-PDDL

Programming Languages Third Edition

X-KIF New Knowledge Modeling Language

Unit 1 a Bird s Eye View on RDF(S), OWL & SPARQL

Web 2.0 Lecture 8: Resource Description Framework

Semantic Web Fundamentals

Orchestrating Music Queries via the Semantic Web

Semantic Web Test

An Introduction to the Semantic Web. Jeff Heflin Lehigh University

Knowledge Representation RDF Turtle Namespace

KNOWLEDGE GRAPHS. Lecture 3: Modelling in RDF/Introduction to SPARQL. TU Dresden, 30th Oct Markus Krötzsch Knowledge-Based Systems

GTM Level 1 Proposal. July 2, slide 1

Entity Relationship modeling from an ORM perspective: Part 2

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Logical Data Modeling: Part 12

Simplified RDF Syntax for Power System Model Exchange

CS Knowledge Representation and Reasoning (for the Semantic Web)

Contents. G52IWS: The Semantic Web. The Semantic Web. Semantic web elements. Semantic Web technologies. Semantic Web Services

Design and Implementation of an RDF Triple Store

Semantic Web Engineering

Multi-agent Semantic Web Systems: RDF Models

Semantic Web. MPRI : Web Data Management. Antoine Amarilli Friday, January 11th 1/29

Semantic Web Fundamentals

Knowledge Representation for the Semantic Web

SPARQL: An RDF Query Language

Unit 2 RDF Formal Semantics in Detail

Flat triples approach to RDF graphs in JSON

Toward Analytics for RDF Graphs

RDF Schema. Mario Arrigoni Neri

UML data models from an ORM perspective: Part 4

Mustafa Jarrar: Lecture Notes on RDF Schema Birzeit University, Version 3. RDFS RDF Schema. Mustafa Jarrar. Birzeit University

RDF. Charlie Abela Department of Artificial Intelligence

RDF AND SPARQL. Part III: Semantics of RDF(S) Dresden, August Sebastian Rudolph ICCL Summer School

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

OWL a glimpse. OWL a glimpse (2) requirements for ontology languages. requirements for ontology languages

SWAD-Europe Deliverable 8.1 Core RDF Vocabularies for Thesauri

Semantic Web. RDF and RDF Schema. Morteza Amini. Sharif University of Technology Spring 90-91

Proposal for Implementing Linked Open Data on Libraries Catalogue

a paradigm for the Semantic Web RDF Data Model Angelica Lo Duca IIT-CNR Linked Open Data:

Semantic Technologies and CDISC Standards. Frederik Malfait, Information Architect, IMOS Consulting Scott Bahlavooni, Independent

Helmi Ben Hmida Hannover University, Germany

11/6/17. Functional programming. FP Foundations, Scheme (2) LISP Data Types. LISP Data Types. LISP Data Types. Scheme. LISP: John McCarthy 1958 MIT

XML Perspectives on RDF Querying: Towards integrated Access to Data and Metadata on the Web

INF3580/4580 Semantic Technologies Spring 2017

The PCAT Programming Language Reference Manual

6. RDFS Modeling Patterns Semantic Web

Knowledge Representations. How else can we represent knowledge in addition to formal logic?

a paradigm for the Introduction to Semantic Web Semantic Web Angelica Lo Duca IIT-CNR Linked Open Data:

Semantic Days 2011 Tutorial Semantic Web Technologies

B4M36DS2, BE4M36DS2: Database Systems 2

Today s Plan. INF3580 Semantic Technologies Spring Model-theoretic semantics, a quick recap. Outline

Linked Data and RDF. COMP60421 Sean Bechhofer

The Semantic Web. Mansooreh Jalalyazdi

KNOWLEDGE GRAPHS. Lecture 2: Encoding Graphs with RDF. TU Dresden, 23th Oct Markus Krötzsch Knowledge-Based Systems

A Technique for Automatic Construction of Ontology from Existing Database to Facilitate Semantic Web

Towards a Semantic Web Modeling Language

Logical reconstruction of RDF and ontology languages

The Resource Description Framework and its Schema

Outline RDF. RDF Schema (RDFS) RDF Storing. Semantic Web and Metadata What is RDF and what is not? Why use RDF? RDF Elements

Logic and Reasoning in the Semantic Web (part I RDF/RDFS)

OSM Lecture (14:45-16:15) Takahira Yamaguchi. OSM Exercise (16:30-18:00) Susumu Tamagawa

JENA: A Java API for Ontology Management

Linked Data and RDF. COMP60421 Sean Bechhofer

From the Web to the Semantic Web: RDF and RDF Schema

IEEE LANGUAGE REFERENCE MANUAL Std P1076a /D3

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

EMERGING TECHNOLOGIES. XML Documents and Schemas for XML documents

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

Querying the Semantic Web

Semantic Web Technologies

The Semantic Web Revisited. Nigel Shadbolt Tim Berners-Lee Wendy Hall

Part I Logic programming paradigm

OWL DL / Full Compatability

FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES

Transcription:

Ontological Modeling: Part 2 Terry Halpin LogicBlox This is the second in a series of articles on ontology-based approaches to modeling. The main focus is on popular ontology languages proposed for the Semantic Web, such as the Resource Description Framework (RDF), RDF Schema (RDFS), and the Web Ontology Language (OWL). OWL is based on description logic. A later series of articles will explore other logic-based languages such as Datalog. The previous article [2] provided a simple introduction to ontologies and the Semantic Web, and covered most of the basic concepts in the Resource Description Framework (RDF), contrasting them with other data modeling approaches. This second article discusses the N3 notation for RDF, and covers the basics of RDF Schema. Notation 3 for RDF (N3) As discussed in the previous article [2], RDF statements are essentially binary relationship instances represented as (subject, predicate, object) triples. Subjects and predicates are treated as resources, so are identified by Uniform Resource Identifier references (URIrefs), which provide document-independent, global identifiers, composed of a Uniform Resource Indicator (URI), optionally followed by # and a local fragment identifier (e.g. http://www.w3.org/tr/rdf-primer/#basicconcepts). Objects are either resources or literals (constants). Literals may be untyped (e.g. Australia ) or typed (e.g. 63: xsd;nonnegativeinteger). While facilitating exchange, the lengthy identifiers provided by URIrefs lead to long-winded statement formulations. For example, the following statement, spread over three lines, might be used to declare CS600 as a course in a program offered at Galactic University. http://www.galacticuni.edu/programs#cs600 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.galacticuni.edu/programs#course Notice that the URI typically consumes most of the identifier. In this example, each URI is a Uniform Resource Location (URL). Imagine storing thousands of statements about academic programs at Galactic University in a single document housed at http://www.galacticuni.edu/programs. Almost all of these statements would use the same URL (http://www.galacticuni.edu/programs), which effectively provides a namespace in which names such as CS600 are locally identifying. It would be painful to keep on entering the same URL for all those statements. Mainly to save writing and improve readability, Tim Berners-Lee introduced a simplified notation for RDF called Notation 3 (N3). Among other tasks, Tim is the editor of a World Wide Web Consortium (W3C) committee that oversees the specification of the notation [3]. In N3, you can predeclare namespace prefixes to denote URI namespaces, and then use those prefixes later as shorthand for full URIs when identifying resources. The prefixes are declared using an @prefix command to introduce a prefix name and the URI it abbreviates, with the URI (including #) delimited in angle brackets, i.e. @prefix namespaceprefix <URI#>. Identifiers using such namespace prefixes are called qualified names (qnames), and are formed by prepending the prefix to a colon : followed by the local identifier. The BNF syntax is: qname ::= namespaceprefix : name When qnames are used, statement triples are terminated by a period.. For example, suppose we declare the prefixes rdf and gup as follows: 1

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> @prefix gup: < http://www.galacticuni.edu/programs#> The previous fact about CS600 may now be formulated more briefly as follows. gup:cs600 rdf:type gup:course. Using the previous prefix declarations, this N3 statement is interpreted as equivalent to the longer RDF statement mentioned earlier. N3 treats a as a reserved word that is shorthand for rdf:type, so the above statement may be shortened even further to: gup:cs600 a gup:course. In English, you can read this as In the context of the gup namespace, CS600 is a Course, where is a means is an instance of. Here the terms CS600, a, and Course are effectively being used within the declared namespace to denote a resource. They are like individual constants within the scope of the declared namespace. Informally, you probably thought of CS600 as a course code, but the RDF statement doesn t actually tell us this. If you want to state this explicitly, you could add a statement such as: gup:cs600 gup:hascoursecode CS600. There is no requirement in RDF to identify the type of a resource. So we could make a statement such as the following without knowing that CS600 is a course. gup:cs600 gup:hascreditpointvalue 10. Notice that this way of making statements about things that could be untyped is very different from the way things are done in information modeling approaches such as Object-Role Modeling (ORM), the Unified Modeling Language (UML) and Entity Relationship modeling (ER) [1]. In each of those approaches, we would declare a Course type (e.g. a Course entity type or a Course class) and treat CS600 as a course code of an instance of that type. In N3, the prefix in a qname may be empty, so the qname starts with a colon (e.g. :CS600). By default, the empty prefix treats the namespace to be the local document. For example, if we are currently at the location http://www.galacticuni.edu/programs, then the following three statements gup:cs600 a gup:course. gup:cs600 gup:hastitle Advanced Informatics. gup:cs600 gup:hascreditpointvalue 10. may be written more briefly as :CS600 a :Course. :CS600 :hastitle Advanced Informatics. :CS600 :hascreditpointvalue 10. As a further abbreviation, N3 allows use of a semicolon to assume the same subject. So the above three statements about the subject CS600 may be declared more briefly thus: :CS600 a :Course; :hastitle Advanced Informatics ; :hascreditpointvalue 10. In general, a statement list of the form subject 1 predicate 1 object 1. subject 1 predicate 2 object 2. subject 1 predicate n object n. may be abbreviated to subject 1 predicate 1 object 1 ; predicate 2 object 2 ; predicate n object n. 2

As another abbreviation, N3 allows use of a comma to assume the same subject and predicate. In other words, you can use a comma as a separator in an object list. Consider, for example, the following two statements (presumably made in a biblical namespace): :Adam :isfatherof :Cain. :Adam :isfatherof :Abel. Here we have the same subject and predicate applied to two objects. Using a comma to separate the objects, these two statements may be abbreviated thus: :Adam :isfatherof :Cain, :Abel. Before introducing the next aspect of N3, let s review some basic logic. Suppose we are given the following dictionary, where a is an individual constant, P is a unary predicate, and B is a binary predicate. a = Australia Px = x is a person xby = x was born in y The proposition Somebody was born in Australia may be expressed in predicate logic as follows, using for the existential quantifier (there exists), and & for conjunction (logical and). x(px & xba) Using the dictionary supplied, you can read this as: there exists something (let s call it x), such that x is a person and x was born in Australia. N3 has various ways to support existential quantifiers. The most common way is to use square brackets to enclose triples that have the same blank node as their subject. The term blank node may be shortened to bnode. A blank node in RDF is like an anonymous variable in Prolog or Datalog, and may be read as something. However, in N3 you can have multiple anonymous variables (e.g. _:x, _:y) using the same variable within a formula to indicate binding to the same existential quantifier. This can also be accomplished by the square bracket notation, since all predicate-object pairs within the same square brackets are understood to be bound to the same, implicit, existential quantifier. For example, assuming the namespace is the current document, the proposition Somebody was born in Australia (i.e. x(x is a person & x was born in Australia)) may be expressed in N3 using a blank node thus: [ a :Person; :wasbornin :Australia ]. In general, a blank node formula is equivalent to an existentially quantified formula as shown below. A blank node has scope only within its immediate expression. No nesting of blank node expressions is permitted. [ predicate object ] x(x predicate object) If a blank node expression is used as the object of an outer predicate, then the existential quantifier is understood to prepend the outer subject. Using a for the initial subject, R and S for predicates, and b for the final object, the following equivalence applies. a R [ S b ] x(arx & xsb) i.e., a R [ S b ] may be read as a R s something that S s b. For example, assuming the local namespace, the following expression may be used to translate the proposition Terry is a parent of somebody who was born in Australia : :Terry :isparentof [ a :Person; :wasbornin :Australia]. As an example with two blank nodes, and assuming the local namespace, the following expression translates the proposition Somebody with family name Obama is president of some country : [ a :Person; :hasfamilyname Obama ] :ispresidentof [ a :Country]. In predicate logic this corresponds to x(person x & x hasfamilyname Obama & y(x ispresidentof y & Country y)) 3

Note that relational databases as well as popular information modeling approaches such as ORM, UML and ER typically do not store existential statements like those just considered. Such statements can easily be derived from more specific data, but it would be highly unusual to store them in that form. This again reflects the freedom in RDF to basically say whatever you want. In addition to providing a more compact and readable syntax for RDF, N3 includes quantifiers (e.g. @forall and @forsome) to facilitate the formulation of rules, and it also allows braces {, } to be used for quoting so that statements can be made about statements. Further details about these and other features may be found on the N3 Website [3]. Basics of RDF Schema (RDFS) RDF Schema (RDFS) builds on RDF by adding formal support for classes and subclassing, which we now discuss. In addition, RDFS supports specialization and subsetting of predicates (see next article). The full specification of RDFS is available on a W3C Website [4]. Resources may be typed as instances of classes using the predefined rdfs:class. For example, Person and Book may be declared to be classes thus: :Person rdf:type rdfs:class. :Book rdf:type rdfs:class. Using N3 s a to abbreviate rdf:type, these type declarations may be rendered more briefly thus: :Person a rdfs:class. :Book a rdfs:class. In RDFS, use of the rdf:type (or N3 a ) predicate implies that the object is a class. For example, the following statement asserts not only that the resource :Elvis is an instance of the resource :Singer, but also that :Singer is a class. :Elvis a :Singer. RDFS predefines the rdfs:subclassof predicate to indicate that the subject is a subclass of the object. A statement of the form A rdfs:subclassof B also implies that both A and B are classes. The rdfs:subclassof predicate is transitive, allowing simple inferences to be drawn. For example, given any resources A, B and C, the following two statements A rdfs:subclassof B B rdfs:subclassof C enable us to infer A rdfs:subclassof C. For example, given :MaleSinger a :Singer. :Singer a :Person. we may infer :MaleSinger a :Person. Using for is a subclass of, & for and, and for implies, this transitivity rule may be written thus: (A B & B C) A C. We can picture this graphically as shown in Figure 1. C BA A e.g. Person Singer MaleSinger Figure 1 Subclassing is transitive: (A B & B C) A C. 4

Further inferences may be drawn by using the rdf:type and rdfs:subclassof predicates in combination. Given any resources a, B and C, where a is in instance of B, and B is a subclass of C, we may infer that a is an instance of C. For example, from :Elvis a :Singer. :Singer rdfs:subclassof :Person. we may infer :Elvis a Person. Using for is an instance of and for is a subclass of, this composite transitivity rule may be written thus: (a B & B C) a C. We can picture this graphically as shown in Figure 2. C C Person Person B a a e.g. Singer Elvis Elvis Figure 2 Composite transitivity: (a B & B C) a C. In mathematics, binary relations are often treated as sets of ordered pairs, indicating how elements in the domain (the set of elements on the left-hand side) map to elements in the range (the set of elements on the right-hand side of the relation). Figure 3(a) depicts an abstract example of a many-to-one (n:1) relation where one or more items in the domain map to a single item in the range. Binary relations may also be 1:n, m:n, or 1:1. Figure 3(b) depicts a concrete example, using the binary predicate has_square, where the domain is the set of numbers {-2, -1, 0, 1, 2} and the range is the set {0, 1, 4}. (a) (b) R e.g. 1-1 0 2-2 has square 1 0 4 Domain Range Domain Range Figure 3. A binary relation maps domain items to range items. RDFS effectively allows predicates to be typed, by restricting their domain and range to a specified class. The predefined predicate rdfs:domain (meaning has domain ) is used to restrict a predicate s subject to a given domain. The predefined predicate rdfs:range (meaning has range ) is used to restrict a predicate s object to a given domain. The syntax is thus: predicate rdfs:domain domain. predicate rdfs:range range. For example, consider Person drives Car as an ORM fact type, ER relationship, or UML association. In RDFS you can declare this roughly as follows: :drives rdfs:domain :Person. :drives rdfs:range :Car. The object of an rdfs:domain predicate or rdfs:range predicate is implied to be a class, so the above two statements imply that :Person and :Car are classes. RDFS allows the same predicate to be assigned multiple domains; in which case, instances of its subject are restricted to the intersection of those domains. Similarly, a predicate may be assigned multiple 5

ranges, thus satisfying all of them. Hence each declared subject of a predicate is known to belong to the domain(s) of that predicate, and each declared object of a predicate is known to belong to the range(s) of that predicate. For example, from the following three statements :sings rdfs:domain :Person. :sings rdfs:range :Song. :Elvis :sings :AllShookUp. we may infer the following two statements: :Elvis a :Person. :AllShookUp a :Song. Conclusion This article introduced the N3 notation for the Resource Description Framework (RDF), and then discussed basic features of RDF Schema (RDFS). The next article will complete the coverage of RDFS, and provide an overview of different flavors of the Web Ontology language (OWL). Later articles will examine OWL in some depth. References 1. Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, 2 nd edition, Morgan Kaufmann, San Francisco. 2. Halpin, T. 2009, Ontological Modeling: Part 1, Business Rules Journal, Vol. 10, No. 9 (Sep. 2009), URL: http://www.brcommunity.com/a2009/b496.html. 3. W3C 2006, Notation 3 (N3): A Readable RDF Syntax, Ed. T. Berners-Lee, URL: http://www.w3.org/designissues/notation3. 4. W3C 2004, RDF Vocabulary Description Language 1.0: RDF Schema, URL: http://www.w3.org/tr/rdf-schema/. 6