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 .