RDF RDF Schema Machine Understandable Metadata for the
RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Fall 2005 Computer Engineering Department Sharif University of Technology Semantic web - Computer Engineering Dept. - Fall 2005 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005
Outline • • Metadata RDFS RDF(S) Tools 2 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 2
Semantic Web: Problems • Too much Web information – around 1, 000, 000 (1 109) resources – Many different types of resources • text, images, graphics, • audio, video, multimedia, • databases, Web applications, … 3 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 3
Semantic Web: Problems (2) • Information not indexable – No common “scheme” for doing so – Short-lived, dynamic resources – Differing relationships between authors, publishers, info intermediaries, users • Each community uses their own approach 4 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 4
Semantic Web: Problems (3) • Information not shareable – Difficult to share information about information • no common cataloging schemes 5 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 5
Main Issues: • Metadata – Information about information – Structured data about data • Many types/forms of metadata, dependent on role: 6 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 6
Types of Metadata: Web Resource discovery Document management administration (Intellectual) property rights management Content ratings (PICS) Security & User authentication Archival information / status Database / data schemas Process description & control Product & Services Descriptions 7 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 7
Second Issue: • Language for expressing metadata must be: – – – universal flexible extensible simple modular (so all can understand) (to incorporate different types) (flexible to custom types) (to encourage adoption) (so that schemes can be mixed, extended) 8 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 8
RDF • RDF stands for Resource Description Framework • It is a machine understandable metadata • RDF is graphical formalism ( + XML syntax + semantics) – for representing metadata – for describing the semantics of information in a machine- accessible way 9 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 9
RDF in SW Architecture 10 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 10
Example (generated by RDFPic) 11 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 11
RDF Model • • • A model is a collection of statements Statement : = (predicate, subject, object) Predicate is a resource Subject is a resource Object is either a resource or a literal Subject Object Predicate Statement 12 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 12
Example shown in triples view 13 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 13
RDF model and natural language • Subject. In grammar, this is the noun or noun phrase that is the doer of the action. In the sentence “The company sells batteries, ” the subject is “the company. ” • Predicate. In grammar, this is the part of a sentence that modifies the subject and includes the verb phrase. In our sentence, the predicate is the phrase “sells” • Object. In grammar this is a noun that is acted upon by the verb. In our sentence, the object is the noun “batteries. ” 14 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 14
XML vs. RDF • RDF is not just an XML dialect. – XML: • Has a tree structure data model. • Only nodes are labeled. – RDF: • Has a graph structure data model. • Both edges (properties) and nodes (subjects/objects) are labeled. 15 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 15
Linking Statements • The subject of one statement can be the object of another • Such collections of statements form a directed, labeled graph Ganji student. OF department. OF CE has. Home. Page Sharif http: //ce. sharif. edu 16 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 16
RDF Graph: ‘anonymous’ nodes Person. Name Literal Person 12345 person. name first value Jonathan last value Borden 17 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 17
Using XPointer to name Person. Name Literal Person 12345 person. name /1/1 first value Jonathan /1/1/1 last /1/1/2 value Borden 18 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 18
How can RDF be implemented • Usually RDF/XML syntax • However other notations are possible – e. g. Notation 3: • Buddy Belden owns a business. • The business has a Web site accessible at http: //www. c 2 i 2. com/~budstv. • Buddy is the father of Lynne. • <#Buddy> <#owns> <#business>. • <#business> <#has-website> <http: //www. c 2 i 2. com/~budstv>. • <#Buddy> <#father-of> <#Lynne>. 19 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 19
Converting N 3 to RDF • Jena toolkit can do such conversion 20 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 20
XML Syntax for RDF • RDF has an XML syntax that has a specific meaning: • Every Description element describes a resource • Every attribute or nested element inside a Description is a property of that Resource • We can refer to resources by using URIs <rdf: Description about="some. uri/person/ganji"> <student. Of resource="some. uri/Sharif/CE"/> </Description> <Description about="some. uri/Sharif/CE"> <has. Home. Page>http: //ce. sharif. edu</has. Home. Page> <department. Of resource="some. uri/~Sharif"/> </rdf: Description> 21 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 21
RDF type • RDF predifined property • Its value – a resource that represent a category or class • Its subject – Instance of that category or class prefix ex: URI: http: //www. example. org/terms 22 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 22
Containers • Containers are collections – they allow grouping of resources (or literal values) • It is possible to make statements about the container (as a whole) or about its members individually • It is also possible to create collections based on URI patterns – for example, all files in a particular web site 23 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 23
RDF containers • Bag: (A resource having type rdf: Bag) – Represents an unordered list of resources or literals – Duplicated values are prermitted • Sequence: (A resource having type rdf: Seq) – Represents ordered list of resources or literal – Duplicated values are permitted • Alternatives: (A resource having type rdf: Alt) – Represents group of resources or literals that are alternatives 24 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 24
Sequence example http: //www. w 3. org/TR/REC-rdf-syntax dc: Creator rdf: Type rdf: _1 “Ora Lassila” rdf: Seq rdf: _2 “Ralph Swick” 25 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 25
Bag example 26 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 26
RDF reification • association of a statement and a specific resource representing the statement • used to make statements about statements • Vocabulary: • type rdf: asserts • properties • rdf: subject • rdf: predicate • rdf: object 27 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 27
Reification example • In N 3: 28 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 28
Reification example (cont. ) • In RDF: 29 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 29
Reification example (cont. ) • RDF Graph (by Isa. Viz): 30 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 30
RDF Schema (RDFS) • RDF gives a formalism for meta data annotation, and a way to write it down in XML, but it does not give any special meaning to vocabulary such as sub. Class. Of or type – Interpretation is an arbitrary binary relation • RDF Schema allows you to define vocabulary terms and the relations between those terms – it gives “extra meaning” to particular RDF predicates and resources – this “extra meaning”, or semantics, specifies how a term should be interpreted 31 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 31
Core Classes & Properties rdfs: Resource Core Classes rdfs: Literal rdfs: XMLLiteral rdfs: Class rdfs: Property Core Properties rdfs: Type rdfs: Sub. Class. Of rdfs: Sub. Property. Of rdfs: Domain rdfs: Range rdfs: Label rdfs: Comment Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 32 32
RDFS Examples <Person, type, Class> <has. Colleague, type, Property> <Professor, sub. Class. Of, Person> <Carole, type, Professor> <has. Colleague, range, Person> <has. Colleague, domain, Person> 33 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 33
RDF/RDFS “Liberality” • No distinction between classes and instances (individuals) <Species, type, Class> <Lion, type, Species> <Leo, type, Lion> • Properties can themselves have properties <has. Daughter, sub. Property. Of, has. Child> <has. Daughter, type, family. Property> • No distinction between language constructors and ontology vocabulary, so constructors can be applied to themselves/each other <type, range, Class> <Property, type, Class> <type, sub. Property. Of, sub. Class. Of> 34 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 34
Problems with RDFS • RDFS too weak to describe resources in sufficient detail – No localised range and domain constraints • Can’t say that the range of has. Child is person when applied to persons and elephant when applied to elephants – No existence/cardinality constraints • Can’t say that all instances of person have a mother that is also a person, or that persons have exactly 2 parents – No transitive, inverse or symmetrical properties • Can’t say that is. Part. Of is a transitive property, that has. Part is the inverse of is. Part. Of or that touches is symmetrical – … • Difficult to provide reasoning support – No “native” reasoners for non-standard semantics – May be possible to reason via FO axiomatisation 35 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 35
RDF(S) tools • Read RDF data – Parsers: Jena, Redland, SWI-Prolog – Validators: W 3 C RDF validation service – Editors: Isa. Viz, RDF Author, RDFEd, Infer. Ed • Store RDF data (XML format, tripples or relational/oo DB) – Sesame, RSSDB, RDFLib • Use RDF data (applications, RSS news, etc. ) • Manipulate RDF data (inference, query, etc. ) – Jena RDQL, etc. – Example: SELECT ? person, ? knows WHERE (? x <http: //xmlns. com/foap/knows> ? z), (? x <http: //xmlns. com/foap/name> ? person), (? z <http: //xmlns. com/foap/name> ? knows) 36 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 36
RDF Validators • RDF Validation Service – http: //www. w 3. org/RDF/Validator/ • In general all the RDF parsers do some kind of validation 37 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 37
References • RDF Resource Guide: – http: //www. ilrt. bris. ac. uk/discovery/rdf/resources/ • http: //www. w 3. org/RDF/Validator/ • Chapter 5 of the book 38 Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 2005 38
- Slides: 38