2This lecture’s agenda Metadata Introduction to Resource Description FrameworkRDF triplesRDF serialization formatsRDF SchemaRDF and relational databases
3MetadataThe term "meta" comes from a Greek word that denotes something of a higher or more fundamental nature. Metadata, then, is data about other data.The term refers to any data used to aid the identification, description and location of networked electronic resources.
4MetadataFor example, we have a file that contains some image data. Then file metadata could be the following:name of an author,the date and time a picture was taken,location where a picture was taken,model of a camera that was used,etc.
7Metadata types Metadata can describe: data contents (short summary, limitations, etc);data access history;access rights;relations between data.
8Uses of metadata Metadata can be used in: content ranking; resource searching;resource integration;define relations between intelligent agents.
9Metadata facts to remember Metadata does not have to be digitalMetadata relates to more than the description of an object.Metadata can come from a variety of sourcesMetadata continue to accrue during the life of an information object or system.One information object's metadata can simultaneously be another information object's data.
12W3C Semantic Web Activity Statement "The Resource Description Framework (RDF) is a language for representing information about resources in the World Wide Web. It is particularly intended for representing metadata about Web resources, such as the title, author, and modification date of a Web page, copyright and licensing information about a Web document, or the availability schedule for some shared resource."W3C
13Resource Description Framework A framework (not a language) for a framework for representing information in the Web,RDF is a standard model for data interchange on the Web,Syntax to allow exchange and use of the information stored in various locations,The point is to facilitate reading and correct use of information by machines, not necessarily by people.
14What is a resource?Resource is anything that can be identified and described.Resource can be identified by a URI or it can be a blank node.Resource can be abstract.The first precise definition of a resource can be found in the RFC 2396 standard:
15Main goals of RDF Integrate data from the multiple sources. Allow the re-use of data in the different projects and organizations.Decentralize data in a way that no single party "owns" all the data.
16XML and RDF (1) <?xml version="1.0"?> <River id="Yangtze" xmlns="http://www.geodesy.org/river"><length>6300 kilometers</length><startingLocation>western China's Qinghai-Tibet Plateau</startingLocation><endingLocation>East China Sea</endingLocation></River>XML<River rdf:ID="Yangtze"xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns="http://www.geodesy.org/river#">RDFYangtze.xmlYangtze.rdfCan be converted to
17XML and RDF (2) <?xml version="1.0"?> <River rdf:ID="Yangtze" RDF provides an ID attribute for identifying the resource being described.2The ID attribute is in the RDF namespace.<?xml version="1.0"?><River rdf:ID="Yangtze"xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns="http://www.geodesy.org/river#"><length>6300 kilometers</length><startingLocation>western China's Qinghai-Tibet Plateau</startingLocation><endingLocation>East China Sea</endingLocation></River>3Add the "fragment identifier symbol" tothe namespace.
18XML and RDF (3) 2 1 3 4 Identifies the resource being described. This <?xml version="1.0"?><River rdf:ID="Yangtze"xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns="http://www.geodesy.org/river#"><length>6300 kilometers</length><startingLocation>western China's Qinghai-Tibet Plateau</startingLocation><endingLocation>East China Sea</endingLocation></River>Identifies the type(class) of theresource beingdescribed.Identifies the resource being described. Thisresource is an instance of River.These are properties,or attributes, of thetype (class).Values of the properties1234
22Binary predicates RDF offers only binary predicates. From the example, Think of them as P(x,y) where P is the relationship between the objects x and y.From the example,X =Y = Jan Egil RefsnesP = authorJan Egil Refsnesauthor
25RDF triple example (3)RDF/XML code that corresponds to the graph on the previous slide:<?xml version="1.0"?><rdf:RDFxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#"><contact:Person rdf:about="http://www.w3.org/People/EM/contact#me"><contact:fullName>Eric Miller</contact:fullName><contact:mailbox<contact:personalTitle>Dr.</contact:personalTitle></contact:Person></rdf:RDF>
26URIs and RDFRDF uses URI references to define its subjects, predicates, and objects.A URI reference (or URIref) is a URI, together with an optional fragment identifier at the end.E.g., the URI consists of:the URIthe fragment identifier: section2.A resource is identifiable by a URI reference
28RDF/XMLRDF/XML is a syntax, defined by the W3C, to express (serialize) an RDF graph as an XML document;According to the W3C, "RDF/XML is the normative syntax for writing RDF";Was endorsed as a recommendation on February 10, 2004.
29RDF/XML example<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:dc="http://purl.org/dc/elements/1.1/"xmlns:geo="http://www. w3.org/2003/01/geo/wgs84_pos#"xmlns:edu="http://www.example.org/"><rdf:Description rdf:about="http://www.princeton.edu"><geo:lat>40.35</geo:lat><geo:long>-74.66</geo:long><edu:hasDept rdf:resource="http://www.cs.princeton.edu"/></rdf:Description><rdf:Description rdf:about="http://www.cs.princeton.edu"><dc:title>Department of Computer Science</dc:title></rdf:RDF>
30Notation3 (N3)Much more compact and readable format that doesn’t use XML syntax ;Is being developed by Tim Berners-Lee and Semantic Web community members;N3 files use UTF-8 encoding.
43What is schema?The word schema comes from the Greek word "σχήμα" (skhēma), which means shape, or more generally, plan.Schema (comp. science) is a logical description of the data in a data base, including definitions and relationships of data.
44RDF Schema (RDFS) RDF Schema provides a way to express: simple statements defining classes of resources including subclass relationships,statements defining properties including subclass relationships,statements about domain and range of a property.
45RDF Schema: A meta-language RDF Schema's type system is similar to those of object-oriented programming languages.RDF Schema allows resources to be defined as instances of one or more classes.Classes can be organized in a hierarchical fashion; for example, a class ex:Dog can be defined as a subclass of ex:Mammal, meaning that any resource which is in class ex:Dog is also in class ex:Mammal.The RDF Schema (RDFS:) is defined in a namespace whose URI is:
46Sample case: MotorVehicle To say that ex:MotorVehicle is a class, write: ex:MotorVehicle rdf:type rdfs:Class .To create an instance of ex:MotorVehicle, write: exthings:companyCar rdf:type ex:MotorVehicle .Naming convention:class names start with an uppercase letter;property and instance names are lowercase.A resource may be an instance of more than one class.
47Defining SubclassesUsing subClassOf property we can define specialized kinds of motor vehicles (e.g., passenger vehicles, vans, minivans, etc).ex:Van rdf:type rdfs:Class .ex:Van rdfs:subClassOf ex:MotorVehicle .ex:Truck rdf:type rdfs:Class .ex:Truck rdfs:subClassOf ex:MotorVehicle .
48Meaning of SubclasssubClassOf means if ex:myVan is an instance of ex:Van, then ex:myVan is also, by inference, an instance of ex:MotorVehicle.subClassOf is (obviously) transitive:If ex:Van rdfs:subClassOf ex:MotorVehicle .and ex:MiniVan rdfs:subClassOf ex:Van .then ex:MiniVan is implicitly a subclass of ex:MotorVehicle.A class may be a subclass of more than one class. All classes are implicitly subclasses of class rdfs:Resource.
49A Full Class HierarchyThe (ex:Truck rdf:type rdfs:Class) part of the graph is not shown.Notice Minivan is subClassOf two classes.
51Class NamingFragment identifiers, like MotorVehicle, use rdf:ID give the effect of "assigning" URIrefs relative to the schema document.Relative URIrefs based on these names can then be used in other class definitions within the same schema, e.g., #MotorVehicle.The full URIref of this class would be:We could also include an explicit declaration: xml:base="http://example.org/schemas/vehicles"
53PropertiesAll properties in RDF are described as instances of class rdf:Property, e.g.exterms:weightInKg rdf:type rdf:Property .RDF Schema provides rdfs:range to define valid fillers for a triple’s Object.RDF Schema provides rdfs:domain to define valid fillers for a triple’s Subject.
54rdfs:range propertyIf the property ex:author has values that are instances of class ex:Person, we would write:ex:Person rdf:type rdfs:Class .ex:author rdf:type rdf:Property .ex:author rdfs:range ex:Person .If a property has more than one range, then its filler must be an instance of all of the classes specified as the ranges:ex:hasMother rdf:type rdf:Property .ex:hasMother rdfs:range ex:Person .ex:hasMother rdfs:range ex:Female .ex:Sally ex:HasMother exstaff:francesexstaff:frances must be both a Female and a Person.
55Typed literals as ranges To say that the range of ex:age is an integer:ex:age rdf:type rdf:Property .ex:age rdfs:range xsd:integer .The datatype xsd:integer is identified by its URIref (http://www.w3.org/2001/XMLSchema#integer).It is optional, but “useful” to declare:xsd:integer rdf:type rdfs:Datatype .This statement documents the existence of the datatype, and indicates explicitly that it is being used in this schema.
56rdfs:domain propertyrdfs:domain indicates that a particular property applies to a class.Suppose books have authors. In RDF:ex:Book rdf:type rdfs:Class .ex:author rdf:type rdf:Property .ex:author rdfs:domain ex:Book .If a property has more than one domain, then any subject instance of that property must be an instance of each named domain.
57Part of the RDF/XMLVehicle schema <rdf:Description rdf:ID="registeredTo"><rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/><rdfs:domain rdf:resource="#MotorVehicle"/><rdfs:range rdf:resource="#Person"/></rdf:Description><rdf:Property rdf:ID="rearSeatLegRoom"><rdfs:domain rdf:resource="#PassengerVehicle"/><rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/></rdf:Property><rdfs:Class rdf:ID="Person" />
58Specializing Properties Like rdfs:subClassOf, property rdfs:subPropertyOf is used to define a property hierarchy.For example, to say that the property ex:primaryDriver is a kind of ex:driver, write:ex:driver rdf:type rdf:Property .ex:primaryDriver rdf:type rdf:Property .ex:primaryDriver rdfs:subPropertyOf ex:driver .This means that if an instance ex:fred is a ex:primaryDriver of the instance ex:companyVan, then ex:fred is also a ex:driver of ex:companyVan.
59subPropertyOf property A property may be a subPropertyOf zero, one or more properties.All RDF rdfs:range and rdfs:domain properties that apply to an RDF property also apply to each of its subproperties.Therefore, because of its subproperty relationship to ex:driver, implicitly ex:primaryDriver also has an rdfs:domain of ex:MotorVehicle.
60subPropertyOf example (RDF/XML) <rdf:Description rdf:ID="driver"><rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/><rdfs:domain rdf:resource="#MotorVehicle"/></rdf:Description><rdf:Property rdf:ID="primaryDriver"><rdfs:subPropertyOf rdf:resource="#driver"/></rdf:Property>
71Different Architectures Based on their implementation, triple stores can be divided into 3 broad categories : In-memory, Native, and Non-native, Non-memory.In – Memory : RDF Graph is stored as triples in main –memory. For example, storing an RDF graph using Jena API/ Sesame API.Native : Persistent storage systems with their own implementation of databases. Eg. Sesame Native, Virtuoso, AllegroGraph, Oracle 11g.Non-Native, Non-Memory : Persistent storage systems set-up to run on third party DBs. E. g., Jena SDB.RDF stores can be divided into 3 broad categories based upon how they are implemented. These are not precisely defined terms with rigid boundaries but something that can serve as rough guide to what a triple store is.Native Stores: Provide support for transactions, own SQL compiler and generally their own procedure language.Will explain in detail what I mean by this term in the later slides.