ABSTRACT

In previous chapters, we learned about a number of possibilities for specifying information in a machine-readable way. RDF allows us to structure and relate pieces of information, and RDFS and OWL introduced further expressive means for describing more complex logical relations. The latter was further extended by means of logical rules that could be combined with OWL. For each of those description languages, we also introduced a notion of logical entailment: RDF(S) documents may entail other documents (Chapter 3), and OWL knowledge bases – possibly augmented with rules – can imply new axioms (Chapters 4, 5, 6). But how exactly are we going to access in practice information which is thus

specified? In principle, logical conclusions can be used for this purpose as well. As an example, one can query whether a knowledge base logically entails that the book “Foundations of Semantic Web Technologies” was published by CRC Press. To this end, one could cast the question into a triple like the following:

An RDF processing tool now could check whether the RDF graph constituted by this single triple is actually entailed by a given RDF document. This approach can be used to formulate a number of queries, using RDF or OWL as the basic query language the semantics of which is clearly specified by the established semantics of these languages. In practice, however, much more is often required. On the one hand, only a

rather restricted set of questions can be asked, especially in simple formalisms such as RDF. We will see in this chapter that there are a number of interesting questions that cannot be expressed in either RDF or OWL. On the other hand, retrieving information from a knowledge base is not just a question of query expressivity, but must also address practical requirements such as post-processing and formatting of results. Typically a large knowledge base is not queried for all instances of a given class, but only for a limited number. Moreover, it is sometimes desirable to filter results using criteria that are not represented in the logical semantics of the underlying language. For instance, one might look for all English language literals specified in an RDF document

and has no separate representation that could be queried in RDF. In this chapter, we have a closer look at some important query languages for

RDF and OWL. For RDF, this query language is SPARQL, while for OWL DL we have to be content with so-called conjunctive queries as a basic formalism that is not part of a standardized query language yet. We will see that the latter is also closely related to the kind of rules introduced in Chapter 6.