Database Reference
In-Depth Information
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > .
@prefix ex: < http://example.org/NWDW# > .
@prefix xsd: < http://www.w3.org/2001/XMLSchema# > .
ex:iri ex:hasEmployee ex:employee1 .
ex:employee1 rdf:type ex:Employee ; ex:FirstName '' Nancy '' ∧∧ xsd:string ;
ex:LastName '' Davolio '' ∧∧ xsd:string ; ex:HireDate '' 1992-05-01 '' ∧∧ xsd:date .
To further simplify the notation, Turtle allows rdf:type to be replaced with
' a '. Thus, instead of
ex:employee1 rdf:type ex:Employee ;
we could write
ex:employee1 a ex:Employee ;
Also, the xml:lang attribute allows us to indicate the language of the text
in the triple. For example, to indicate that the name of the employee is an
English name, we may write in Turtle:
ex:employee1 ex:FirstName '' Nancy '' @en ; ex:LastName '' Davolio '' @en .
Finally, blank nodes are represented either explicitly with a blank node
identifier of the form :name or with no name using square brackets. The latter
is used if the identifier is not needed elsewhere in the document. For example,
the following triples state that the employee identified by ex:employee1 ,who
corresponds to Nancy Davolio in the triples above, has a supervisor who is
an employee called Andrew Fuller:
ex:employee1 a ex:Employee ;
ex:Supervisor [ a ex:Employee ; ex:FirstName '' Andrew '' ;ex:LastName '' Fuller '' ].
In this case, the blank node is used as object, and this object is an anonymous
resource; we are not interested in who this person is.
A blank node can be used as subject in triples. If we need to use the blank
node in other part of the document, we may use the following Turtle notation:
ex:employee1 a ex:Employee ; ex:Supervisor :employee2 .
:employee2 a ex:Employee ; ex:FirstName '' Andrew '' ;ex:LastName '' Fuller '' .
14.1.3 RDF Representation of Relational Data
In this section, we describe how relational data can be represented in RDF
in order to be used and shared on the semantic web.
Suppose that the Northwind company wants to share their warehouse data
on the web, for example, to be accessible to all their branches. The Northwind
data warehouse is stored in a relational database. For our example, we will
use the Sales fact table and the Product dimension table of Fig. 14.2 ,which
are simplified versions of the corresponding data warehouse tables. Note that
we added an identifier SalesKey for each tuple in the Sales fact table.
 
Search WWH ::




Custom Search