• No results found

1.6 Thesis structure

2.1.2 RDF Schema

The RDF provides a data model to represent relationships among resources, using typed properties and values. However, as Figure2.1introduces, the RDF data model does not describe the nature of the relationships, but it only details them. Indeed, in the same example we used a class dbpedia-owl:Person and dbpedia-owl:birthDate, and used properties such as dbpprop:name to describe the relationships. RDF itself provides no means for defining such domain specific classes and properties. Instead, these classes and properties are described as an RDF vocabulary, using extensions to RDF provided by the RDF Schema [19]. However, the RDF Schema does not provides the facilities needed to model the conceptualization of the relationships of a domain context, but instead provides the facilities needed to describe such classes and properties, and to indicate which classes and properties are expected to be used together. To summarize, the RDF Schema provides a type system for RDF.

The RDF Schema facilities are themselves provided in the form of an RDF vocabulary; that is, as a specialized set of predefined RDF resources with their own special meanings. The resources in the RDF Schema vocabulary have URIs with the prefix http://www.w3.org/2000/01/rdf-schema# (conventionally associated with

2.1 – Resource Description Framework

are compliant RDF graphs. Hence, this allows backward compatibility with all the software that are not aware of the RDF Schema, but they can still interpret it as a legal RDF graph consisting of various resources and properties, but they do not “understand” the additional built-in meanings of the RDF Schema terms. To understand these additional meanings, RDF software have to be written to process an extended language that includes not only the rdf: vocabulary, but also the rdfs: vocabulary, together with their built-in meanings.

A basic step in any kind of description process is identifying the different types of things to describe. The RDF Schema refers to these “kinds of things” as classes. A class in RDF Schema corresponds to a generic concept of a Thing, something like the notion of a class in object-oriented programming languages. RDF classes can be used to represent almost any category of thing, such as Web pages, people, document types, databases or abstract concepts. Classes are described using the RDF Schema resources rdfs:Class and rdfs:Resource, and the properties rdf:type and rdfs:subClassOf. Let’s consider the example shown in Figure 2.1. The URI

http://dbpedia.org/resource/Giacomo_Leopardi points to an individual and it

refers to a person, actually Giacomo Leopardi. This individual belongs to a class Person, so we can define formally the type of this URI as:

dbpedia−owl : P e r s o n r d f : t y p e r d f s : C l a s s .

In the example, the property rdf:type is used to indicate that a resource is an instance of a class. For the sake of brevity, we used the rdfs schema instead of owl (as it happens for the real definition). In such a way, we extend the meaning of the class Person, making it compliant with the OWL Full (see section2.2). This serialization shows how the class Person is linked to the vocabulary it uses: dbpedia-owl (further explanations are in Section 2.2). Now, we suppose that the Person class is a class inherited by the Thing class: we model this relationship through the rdfs:subClassOf property.

dbpedia−owl : P e r s o n r d f : t y p e r d f s : C l a s s ; r d f s : s u b C l a s s O f owl : Thing .

The rdf:Property is used when we define the property of an attribute. Following the same example, we have:

dbpedia−owl : P e r s o n r d f : t y p e r d f s : C l a s s ; r d f s : s u b C l a s s O f owl : Thing . dbpprop : name r d f : t y p e r d f : P r o p e r t y .

To define the relationship between a class and a property, we use the rdfs:domain, while the rdfs:range defines the value type which the property has; the previous example becomes:

dbpedia−owl : P e r s o n r d f : t y p e r d f s : C l a s s ; r d f s : s u b C l a s s O f c o n t a c t : Thing . dbpprop : name r d f : t y p e r d f : P r o p e r t y .

dbpedia−owl : b i r t h D a t e r d f : t y p e owl : D a t a t y p e P r o p e r t y ; r d f : t y p e owl : F u n c t i o n a l P r o p e r t y ; r d f s : domain dbpedia−owl : P e r s o n ; r d f s : r a n g e xsd : d a t e .

The RDF Schema type system is similar in some aspects to the type systems of object-oriented programming languages. However, the RDF differs from most programming language type systems in several important aspects. One important difference is that instead of describing a class as having a collection of specific properties, an RDF Schema describes properties as applying to specific classes of resources, using domain and range properties. This enables to have a property that may be used by other classes and the modification on that is propagated on all the other classes. So, property descriptions are, by default, independent by the class definition.