Semantic Web for the Working Ontologist. Dean Allemang

Читать онлайн книгу.

Semantic Web for the Working Ontologist - Dean  Allemang


Скачать книгу
lit:Shakespeare rdf:type lit:Playwright lit:Ibsen rdf:type lit:Playwright lit:Simon rdf:type lit:Playwright lit:Miller rdf:type lit:Playwright lit:Marlowe rdf:type lit:Playwright lit:Wilder rdf:type lit:Playwright

      rdfs: Indicates identifiers used for the RDFS. The scope and semantics of the symbols in this namespace are the topics of future chapters. The global URI for the rdfs namespace is http://www.w3.org/2000/01/rdf-schema#.

      skos: Indicates identifiers used for the Simple Knowledge Organization System (SKOS), a schema for distributed management of vocabularies on the Web. Chapter 11 provides a detailed discussion on SKOS and its use. The global URI for SKOS is http://www.w3.org/2004/02/skos/core#.

      owl: Indicates identifiers used for OWL. The scope and semantics of the symbols in this namespace are the topics of future chapters. The global URI for the OWL namespace is http://www.w3.org/2002/07/owl#.

      These URIs provide a good example of the interaction between a URI and a URL. For modeling purposes, any URI in one of these namespaces (for example, http://www.w3.org/2000/01/rdf-schema#subClassOf, or rdfs:subClassOf for short) refers to a particular term that the W3C makes some statements about in the RDFS standard. But the term can also be dereferenced—that is, if we look at the server www.w3.org, there is a page at the location 2000/01/rdf-schema with an entry about subClassOf, giving supplemental information about this resource. From the point of view of modeling, it is not necessary that it be possible to dereference this URI, but from the point of view of Web integration, it is critical that it is. The underlying standards and principles to weave such a web of linked data will be detailed in Chapter 5.

      The RDF data model specifies the notion of triples and the idea of merging sets of triples as just shown. With the introduction of namespaces, RDF uses the infrastructure of the Web to represent agreements on how to refer to a particular entity. The RDF standard itself takes advantage of the namespace infrastructure to define a small number of standard identifiers in a namespace defined in the standard, a namespace called rdf.

Subject Predicate Object
lit:Playwright rdf:type bus:Profession
bus:Profession rdf:type hr:Compensation
Subject Predicate Object
lit:wrote rdf:type rdf:Property
geo:partOf rdf:type rdf:Property
bio:married rdf:type rdf:Property
bio:livedIn rdf:type rdf:Property
bio:livedWith rdf:type rdf:Property
geo:isIn rdf:type rdf:Property

      rdf:type is a property that provides an elementary typing system in RDF. For example, we can express the relationship between several playwrights using type information, as shown in Table 3.9. The subject of rdf:type in these triples can be any identifier, and the object is understood to be a type. There is no restriction on the usage of rdf:type with types; types can have types ad infinitum, as shown in Table 3.10.

      When we read a triple out loud (or just to ourselves), it is understandably tempting to read it (in English, anyway) in subject/predicate/object order so that the first triple in Table 3.9 would read, “Shakespeare type Playwright.” Unfortunately, this is pretty fractured syntax no matter how you inflect it. It would be better to have something like “Shakespeare has type Playwright” or maybe “The type of Shakespeare is Playwright.”

      This issue really has to do with the choice of name for the rdf:type resource; if it had been called rdf:isInstanceOf instead, it would have been much easier to read out loud in English. But since we never have control over how other entities (in this case, the W3C) chose their names, we don’t have the luxury of changing these names. When we read out loud, we just have to take some liberties in adding in connecting words. So this triple can be pronounced, “Shakespeare [has] type Playwright,” adding in the “has” (or sometimes, the word “is” works better) to make the sentence into somewhat correct English. Later in this chapter, we’ll see the Turtle syntax for writing RDF, in which a shortcut has been introduced for this particular case: the keyword “a” can be used instead of rdf:type which makes the reading ever easier “Shakespeare [is] a Playwright”.

      rdf:Property is an identifier that is used as a type in RDF to indicate when another identifier is to be used as a predicate rather than as a subject or an object. We can declare all the identifiers we have used as predicates so far in this chapter as shown in Table 3.11.

      We began this chapter by motivating RDF as a way to distribute data over the Web—in particular, tabular data. Now that we have all of the detailed mechanisms of RDF (including namespaces and triples) in place, we can revisit tabular data and show how to represent it consistently in RDF.

       Challenge 1

      Given a table from a relational database, describing products, suppliers, and stocking information about the products (see Table 3.12), produce an RDF graph that reflects its contents in such a way that the information intent is preserved but the data are now amenable for RDF operations like merging an RDF query.

       Solution

      Each row in the table describes a single entity, all of the same type. That type is given by the name of the table itself, Product. We know certain information about each of these items, based on the columns in the table itself, such


Скачать книгу