Wednesday, December 16, 2015

Protégé - Example Ontology file

Please find the Example Ontology file, we created in the lab course for the exercise Modelling the Facts in Protégé from exercise sheet 7.

You can find the same in the material folder as well.

Atoms, Atomic Formulas, and Functions

 © 2015 by Sidney Harris
Thanks again for pointing out ambiguities and lacks of clarity in the lecture material!

In the lab course today, we were discussing atoms vs. atomic formulas in FOL.

Usually, atoms and atomic formulas are used equivalently in FOL to denote formulas that contain no logical connectives and quantifiers, or equivalently, formulas that do not contain any strict subformulas. Atoms (atomic formulas) are the simplest well-formed formulas in FOL.

For example, consider the following (composite) formula:
∀x. P (x) ∧ ∃y. Q (y, f (x)) ∨ ∃z. R (z)

where x,y,z denote variables, f denotes a function symbol, and P, Q, R denote predicates.

The atoms (atomic formulas) contained in this formula are:
  • P (x) 
  • Q (y, f (x))
  • R (z)
In the lecture slides, we only gave a brief summary for the definition of FOL based on examples. For an extensive definition of FOL, please refer to [1].

Thus, whenever we are talking about atoms, as e.g. when we were talking about rules, we refer to atomic formulas.

Then there was the question, whether a function like e.g. mother(x) is an atom/atomic formula?

The definition of an FOL formula says:
  1. If P is a predicate symbol of arity k, and if t1,...,tk, are terms, then P(t1,...,tk) is a formula.
  2. (Negation) For all formulas F, also ¬F is a formula
  3. (Binary Connectives) For all Formulas F,G, also F∧G,F∨G,F→ G,F↔G are formulas 
  4. (Quantifiers) If x is a variable and F is a formula, then also ∀x.F and ∃x.F are formulas
A function alone is only considered a term, following the definition of an FOL term:
  1. all variables are terms
  2. If f is a function symbol of arity k, and if t1,...,tk, are terms, then f(t1,...,tk) is also a term.
For a distinction, you may keep in mind that terms do not compute a truth value, a formula does.

[1] Uwe Schöning: Logik für Informatiker. Spektrum Akademischer Verlag, 2000
or in english:
[2] Uwe Schöning: Logic for computer scientists, Birkhäuser, 2008, also online availabl

Tuesday, December 8, 2015

Final Exam

The final exam will take place on
Friday, February 12, 2016 – 10:00 AM to 12:00 PM

The location will be announced.

Monday, December 7, 2015

Sample solutions (Tableaux)

I compiled one sample solution for the FOL tableaux from exercise sheet 5, thanks to Jan for his template.

And I've found another extensive example for the Mad Cow DL tableaux from exercise sheet 6, it is in German but you hopefully don't mind.

You can find both in the material folder.

Friday, November 20, 2015

Some Thoughts about Logic...

Ramon Llull (c. 1232 - c.1315),
besides many other things also a philosopher and logician

OK, let's try to find an answer to the question why are we putting so much emphasis on logic in that course..

What's the general objective of logic?

The main objective of a logic (...and there is not a unique logic but many) is to express by means of a formal language the knowledge about certain phenomena or a certain portion of the real world.  To provide a complete description of the real world is clearly impossible, and maybe also useless. However, typically one is interested only in a portion of the real world. Thus, logic serves us to create a model of the real world. For this purpose, we adopt a language. The phrases of this language are used to describe objects of the real world, their properties, and facts that hold. This language can be informal (natural language) or a formal (mathematical logic). 

So, we are creating a formal (mathematical) model of the real world that serves our purpose. The mathematical model constitutes an abstraction of a portion of the real world. It represents the real world in the shape of mathematical objects, such that sets, relations, functions, etc.

But, you might say, we don't need logic to create a model. Especially in everyday life, we don't need a mathematical model to survive.

However, in science in order to show that a certain argumentation is correct, we provide mathematical models that describe in an abstract and concise manner specific aspects of the real world. Based on these mathematical models, logic allows formally correct reasoning.

Logic allows us reasoning

For this purpose, a precise set of deterministic rules, called inference rules, provide the basic reasoning steps which are considered to be correct by everybody. A formally correct reasoning allows to show that a certain knowledge is a logical consequence of a given set of facts. Furthermore, correct reasoning chains are constructed by concatenating applications of simple inference rules, that allow to transform the initial knowledge into the conclusion one wants to derive.

The connection to the real world

The connection between the real world, the formal model and the formal language used to describe the model is the interpretation. Considering model-theoretic semantics, a formal interpretation is the mapping of our logical language to a (simpler) mathematical model (as e.g. set theory). The formal interpretation allows us to define a notion of truth. The main objective of the formal interpretation is that it allows to define when a formula is true in a model.

Finally, the goal of logic is the formalization of what is true or false on a particular world.

...and we are not the first to find out about that :)

According to medieval philosopher Ramon Llull (who also was a poet, a theologian, a mystic, a mathematician, and a martyr):
Logic is „the art and the science to distinguish between truth or lie with the help of reason, to accept truth and to reject lie.

Wednesday, November 18, 2015

Propositional Logic

We just wanted to emphasize once more, that as said today in the lab course, propositional logic (PL) does not support explicit predicates (relations) and therefore assertions have to be written as atomic formulas (symbols of the underlying alphabet).

[ There can be explicit relations among propositional formulas, but the only way to express relations is with the given logical connectives { ¬,∧,∨,→,↔,(,) } ]

The PL statement for the natural language statement "Anton likes cookies, but not cheesecake." would then be:
a ∧ ¬b
a meaning "Anton likes cookies",
b meaning "Anton likes cheesecake".

Wednesday, November 11, 2015


In the lecture yesterday, we've had the question in how far MINUS differs from NOT EXISTS in SPARQL.  NOT EXISTS and MINUS represent two different ways of thinking about negation.

  • NOT EXISTS is based on testing whether a pattern exists in the data, given the bindings already determined by the query pattern.
  • MINUS is based on removing matches based on the evaluation of two patterns. 
While in most cases both versions deliver the same result, there are some cases where both can produce different answers. Let's have a look at an example [1]:

Given the following RDF knowledge base:

@prefix : <http://example/> .
:a :b :c .

Consider the following SPARQL query with NOT EXISTS:


  ?s ?p ?o
  FILTER NOT EXISTS { ?x ?y ?z }

What would be the result in this case?
The result set of the SPARQL query has no solutions because {?x ?y ?z} matches given any ?s ?p ?o, so NOT EXISTS {?x ?y ?z} eliminates any solutions.

Now consider the same query with MINUS:


   ?s ?p ?o 
     { ?x ?y ?z }

With MINUS, there is no shared variable between the first part (?s ?p ?o) and the second (?x ?y ?z) so no bindings are eliminated.

You will find additional examples in [1]. You can also find information about this issue in the Wiki of the W3C SPARQL Working group [2].

Monday, November 9, 2015

Erratum 02

We have detected another error in the slides for RDF. In particular this refers to slide set 1.7 "Represent Simple Facts with RDF". The given example for JSON-LD was faulty. The correct version of the example should be as follows:

{ "@id" : "" ,    
  "" : { "@value" : "1930" } ,
  "" : { "@id" : ""} 


JSON-LD is not subject of the lecture. For RDF, we will use Turtle serialization. If you are further interested in JSON-LD, please refer to 

Thursday, November 5, 2015

RDF Containers vs. Collections - an interesting question

Example of an RDF collection
In the (parallel) OpenHPI course 'Knowledge Engineering With Semantic Web Technologies 2015' an interesting question came up yesterday, concerning the difference of containers and collections in RDF [1]. It addressed the notion of 'open' vs. 'closed' lists, and why there should really be a (technical) difference. In principle, of course, you are able to take both constructs and simply add additional RDF triples with new items. But, ...

The key difference of the two constructs is that in a container, you can simply continue to add new list items only by asserting new RDF triples. In difference, for a collection you first have to remove a statement before you can add new list items.

This is an important difference in particular for reasoning, esp. because reasoning in the Semantic Web employs the so-called Open World Assumption (OWA), which, put simply, states that just because a certain fact is not known that does not mean we can assume that fact to be untrue. We will talk about the OWA in subsequent lectures.

Now, you apply the OWA principle to an ('open') container, and you ask "how many items does the container have", the answer must always be "I don't know", simply because there is no way to determine how many unknown items (potentially) might be in the container. However, if we consider a collection, we have an explicit pointer for the last item in the list. Thus, we can with certainty say how many items the collection contains. There can be no unknown additional items.

[1] 1.8 RDF and Turtle Serialization, at OpenHPI 'Knowledge Engineering with Semantic Web Technologies 2015'
[2] 4.1 RDF Containers, in RDF Primer, Turtle Version, W3C, 2007.

Wednesday, November 4, 2015

Some important RDF(S) Vocabularies

In the last lab course, we've used the Dublin Core vocabulary to represent bibliographic information as well as the FOAF vocabulary to describe persons and their relationships. In general, a vocabulary usually defines a set of terms to be used. Likewise in the Semantic Web or the Web of Data, there exist a number of well established vocabularies - all based on RDF(S) or RDF(S) and OWL - that are (re-)used for the publication of (semantic) data. Here, data publishers consequently combine terms from existing vocabularies with proprietary ones covering their very specific needs. In the following, you will find some popular vocabularies that will also be used in the lecture:

Dublin Core Metadata Initiative provides a set of metadata for describing numerical and physical resources, esp. for bibliographic purposes. Widespread properties in the Web of Data include:

  • dcterms:creator to specify the maker of a resource,
  • dcterms:date to specify a date related to the resource, or
  • dcterms:description to add a description of a resource, or
  • dcterms:subject to specify the topic of a resource.

Friend-of-a-Friend project (FOAF) proposes a widespread vocabulary for the description of persons, their social links and relations to other objects. Several social networks are using FOAF vocabulary to expose their data:

FOAF data establishes a distributed social network.

Semantically-Interlinked Online Communities (SIOC) is another very important vocabulary to describe social networks. SIOC exporters exist for WordpressDrupal or vBulletin. Prominent properties in the SIOC vocabulary are, as e.g., :

  • sioc:hasCreator describes the creator of an object
  • sioc:content text-only representation of content (as e.g. a blog post)
  • sioc:topic indicating the topic of a resource.

Simple Knowledge Organisation System (SKOS) is used to describe concept hierarchies such as taxonomies, folksonomies, or thesauri. SKOS provides properties to represent subsumption hierarchies:

  • skos:narrower describes a more specific concept,
  • skos:broader describes a more general concept.

SKOS vocabulary is a powerful tool to describe domain ontologies, where the rdfs:subClassOf would be insufficient or not suited to describe a hierarchical relationship. Just take into account the following example:

Albert Dubois-Pillet: The Banks on the Marne at Dawn (c. 1888)
A pointilistic painting, which is also an impressionistic painting.
But not all pointilistic paintings are also impressionistic paintings.

Thus, Pointilistic Painters in general are not a valid subclass of Impressionistic Painters, simply because there are some pointilistic painters that are not counted as impressionistic painters, but started a new art style like Henri-Edmond Cross, who developed from Pointilism to Neo-Impressionism and went on to Fauvism. Nevertheless, the concept 'Impressionistic Painters' is a more general concept than the concept 'Pointilistic Painters', because Pointilism branched from the Impressionistic movement.

Thus we might say:

  • ex:ImpressionisticPainters skos:narrower ex:PointilisticPainters .
    ex:PointilisticPainters skos:broader ex:ImpressionisticPainters .

Monday, October 26, 2015


Sorry for the possible confusion, but we have provided a wrong link for the 'additional material' on the Learning Material page. The Link covered last year's material including a tele-task lecture recording and many references to the history of information science (which might be interesting to you but not necessarily mandatory for this year's lecture).

We have now changed the link accordingly on the Learning Material page. You will also find the relevant material for lecture 1 here.

The additional lecture material is organized in a bookmarking tool called "bibsonomy". You will recognize the correct links by the bibsonomy tag "swt1516_xx", where "xx" usually stands for the according lecture number.

Q&A Week 1

Please remember to take notes on the questions that came up during the study of the first week's learning material in the Q&A Sheet.

For your preparation, it might also be helpful for you to take the self tests in the OpenHPI lecture to check if you fully understand e.g.:
  • the difference between the web of documents and the web of data,
  • the definition, advantages, and (possible) applications of the Semantic Web,
  • the difference between Wikipedia and DBpedia, and
  • what a semantic entity is.
See you on Tuesday!

Tuesday, October 20, 2015

First Lecture - Lecture Overview

In today's lecture, I will give you an outline and an overview of the topics we will deal with during the course. We will also talk about lecture organization and lab courses. Below, you will find the presentation slides.

Usually, learning material will also be provided with the openHPI website of our course, where you will also find all the video recordings, as well as in the material section of this blog.


Thursday, September 24, 2015

Semantic Web Technologies 2015/16

The web has become an object of our daily life and the amount of information there is ever growing. Besides plain texts, multimedia such as graphics, audio or video have become a predominant part of the web's information traffic. But, how can we find useful information within this huge information space? How can we make use of the knowledge contained in those web documents?

Traditional search engines for example will reach the limits of their power, when it comes to understanding information content. The Semantic Web is an extension of the traditional web in the sense that information in the form of natural language text in the web will be complemented by its explicit semantics based on a formal knowledge representation. Thus, the meaning of information expressed in natural language can be accessed in an automated way and interpreted correctly, i.e. it can be “understood“ by machines. Semantic Web technologies enable the explicit representation of knowledge and its further processing to deduce new knowledge from implicitly hidden knowledge. Previously heterogeneous data can be mapped and combined based on common knowledge representation and schemata easily extended in a dynamic way. In this lecture, you will learn the fundamentals of Semantic Web technologies and how they are applied for knowledge representation in the Web of Data.


(1) Semantic Web Basic Architecture

RDF (Resource Description Framework), RDFS, RDFa,, microformats, SPARQL Protocol And RDF Query Language

(2) Knowledge Representation and Mathematical Logic

Ontologies, Propositional Logic, First Order Logic, Description Logics, OWL (Web Ontology Language), RIF (Rule Interchange Format)

(3) Applications in the ‚Web of Data‘

Semantic Web Programming, Ontology Engineering, Named Entity Resolution, Linked Data Engineering, Semantic Web APIs, RDF Stores, Semantic Search, Semantic Multimedia

General Information

  • Dates:
    • Tue, 13:30 – 15:00, H-E.51 (Lecture)
    • Wed, 9:15 – 10:45, H-E.51 (Lab Course)
  • SWS / Belegungspunkte:
    • 4 / 6.0 (benotet)
  • Website/Blog:

First Session
Tuesday, 20.10.2015, 13:30 – 15:00, H-E.51
(no lecture and lab course in first week!)


  • Klausur (written exam)