Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Fall 2005 Computer Engineering Department Sharif University of Technology
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Outline Metadata RDF RDFS RDF(S) Tools
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Semantic Web: Problems Too much Web information –around 1,000,000,000 (1 10 9 ) resources –Many different types of resources text, images, graphics, audio, video, multimedia, databases, Web applications, …
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Semantic Web: Problems (3) Information not shareable –Difficult to share information –Difficult to share information about information no common cataloging schemes
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Main Issues: Metadata –Information about information –Structured data about data Many types/forms of metadata, dependent on role:
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Types of Metadata: Web Resource discovery Content ratings (PICS) Product & Services Descriptions Document management administration Security & User authentication (Intellectual) property rights management Database / data schemas Archival information / status Process description & control
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Second Issue: Language for expressing metadata must be: –universal (so all can understand) –flexible (to incorporate different types) –extensible (flexible to custom types) –simple (to encourage adoption) –modular (so that schemes can be mixed, extended)
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDF in SW Architecture
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Example (generated by RDFPic)
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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 SubjectObject Predicate Statement
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Example shown in triples view
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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.”
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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.
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Linking Statements The subject of one statement can be the object of another Such collections of statements form a directed, labeled graph GanjiCE studentOF Sharif departmentOFhasHomePage
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDF Graph: ‘anonymous’ nodes Person12345 Jonathan Borden person.name first last value PersonName Literal Person
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Using XPointer to name Person12345 /1/1 /1/1/1 /1/1/2 Jonathan Borden person.name first last value PersonName Literal Person
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall How can RDF be implemented Usually RDF/XML syntax However other notations are possible –e.g. Notation3: Buddy Belden owns a business. The business has a Web site accessible at Buddy is the father of Lynne..
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Converting N3 to RDF Jena toolkit can do such conversion
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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:
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Sequence example “Ora Lassila” rdf:_1 rdf:Seq dc:Creator rdf:Type “Ralph Swick” rdf:_2
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Bag example
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Reification example In N3:
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Reification example (cont.) In RDF:
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Reification example (cont.) RDF Graph (by IsaViz):
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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 subClassOf 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Core Classes & Properties Core Classes Core Properties rdfs:Resource rdfs:Literal rdfs:XMLLiteral rdfs:Class rdfs:Property rdfs:Type rdfs:SubClassOf rdfs:SubPropertyOf rdfs:Domain rdfs:Range rdfs:Label rdfs:Comment
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDFS Examples
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDF/RDFS “Liberality” No distinction between classes and instances (individuals) Properties can themselves have properties No distinction between language constructors and ontology vocabulary, so constructors can be applied to themselves/each other
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall 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 hasChild 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 isPartOf is a transitive property, that hasPart is the inverse of isPartOf 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
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDF(S) tools Read RDF data –Parsers: Jena, Redland, SWI-Prolog –Validators: W3C RDF validation service –Editors: IsaViz, RDF Author, RDFEd, InferEd 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 ?z), (?x ?person), (?z ?knows)
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall RDF Validators RDF Validation Service – In general all the RDF parsers do some kind of validation
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall References RDF Resource Guide: – Chapter 5 of the book