se3316a_2013_11_semweb

45
SE3316 – Web Technologies Semantic Web Dr. Jagath Samarabandu [email protected] TEB 351 519-661-2111 x80058 Fax: 519-850-2436

description

semweb

Transcript of se3316a_2013_11_semweb

  • SE3316 Web Technologies

    Semantic Web

    Dr. Jagath [email protected]

    TEB 351

    519-661-2111 x80058

    Fax: 519-850-2436

  • SE3316 Jagath Samarabandu 27-Nov-13

    Web Resources W3C RDF Primer

    http://www.w3.org/TR/rdf-primer/ W3C RDF Tutorial

    http://www.w3.org/Consortium/Offices/Presentations/RDFTutorial/

    Introduction to RDF: talk by A. M. Kuchling http://www.amk.ca/talks/2004-12-02/

  • SE3316 Jagath Samarabandu 37-Nov-13

    Semantic Web coined by Tim Berners-Lee (1997)

    "The Semantic Web is an extension of the current web in which information is given well-defined meaning, better enabling computers and people to work in cooperation.

    T. Berners-Lee, J. Hendler, O. Lassila,The Semantic Web, Scientific American, May 2001

  • SE3316 Jagath Samarabandu 47-Nov-13

    Need for Semantic Web W3C project since around 1999. The existing Web of HTML documents is

    designed for humans Needs only a browser to access it

    Programs have a harder time with it Screen-scrapers can extract information from

    HTML, but they're hard to write The Semantic Web will augment the existing

    human-readable Web with structured data that's easy for software to process

  • SE3316 Jagath Samarabandu 57-Nov-13

    Cant we just use XML?This is what a web-page in natural language looks like for a machine

  • SE3316 Jagath Samarabandu 67-Nov-13

    XML helps

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    XML allows meaningful tags to be added toparts of the text

  • SE3316 Jagath Samarabandu 77-Nov-13

    XML machine accessible meaning

    < >

    < >

    < >

    < >

    < >

    < >

    But to your machine, the tags look like this.

  • SE3316 Jagath Samarabandu 87-Nov-13

    Schemas take a step in the right direction

    Schemas help.

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    < > by relating common termsbetween documents

    pipipipi

  • SE3316 Jagath Samarabandu 97-Nov-13

    But other people use other schemas

    < >

    < >

    Someone else has one like this.

  • SE3316 Jagath Samarabandu 107-Nov-13

    The semantics isnt there

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    < >which dont fit inpipipipi

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

  • SE3316 Jagath Samarabandu 117-Nov-13

    KR provides external referents to merge on

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    SW languages add mappingsAnd structure.

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

    < >

    CV

    name

    education

    work

    private

    < >

    < >

    < >

    < >

    < >

    < >

  • SE3316 Jagath Samarabandu 127-Nov-13

    Which is what the web was meant to be!! "This is a pity, as in fact documents on the web describe

    real objects and imaginary concepts, and give particular relationships between them... For example, a document might describe a person. The title document to a house describes a house and also the ownership relation with a person. ... This means that machines, as well as people operating on the web of information, can do real things. For example, a program could search for a house and negotiate transfer of ownership of the house to a new owner. The land registry guarantees that the title actually represents reality.

    -Tim Berners-Lee plenary presentation at WWW Geneva, 1994

  • SE3316 Jagath Samarabandu 137-Nov-13

    Web Semantics

    Semantic Web LayerCake (Berners-Lee, 99;Swartz-Hendler, 2001)

    We are stillhere

  • SE3316 Jagath Samarabandu 147-Nov-13

    Layers: A Closer Look Web Ontology Language (OWL)

    Relationships between vocabularies "Persons" in vocabulary A are the same thing as "Users" in

    vocabulary B. Resource X and resource Y are referring to the same thing.

    RDF Schema: Vocabulary definitions There is a class called "Person". Resource X is an instance of "Person".

    Resource Description Framework (RDF) Assertions of facts Resource X is named "Drew".

  • SE3316 Jagath Samarabandu 157-Nov-13

    Resource Description Framework RDF is a specification that defines a model for

    representing the world, and a syntax for serializing and exchanging the model

    A language for representing metadata about Web resources Title, author, and modification date of a web page, Copyright and licensing information about a Web

    document, Availability schedule for a shared resource

    Generalized to represent things that arent directly retrievable (e.g. person, house)

  • SE3316 Jagath Samarabandu 167-Nov-13

    RDF Overview Intended when meta-information needs to be processed

    by applications Provides a common framework so it can be exchanged

    between applications without loss of meaning. Application designers can leverage the availability of

    common RDF parsers and processing tools. The ability to exchange information between different

    applications means that the information may be made available to applications other than those for which it was originally created

  • SE3316 Jagath Samarabandu 177-Nov-13

    RDF Concepts Need to represent the fact that

    John Smith created a particular web page In English, this could be

    http://www.example.org/index.html has a creatorwhose value is John Smith

    Important parts are The thing being described (i.e. web page) Property of the thing (i.e. creator) Value of this property (i.e. John Smith)

  • SE3316 Jagath Samarabandu 187-Nov-13

    RDF Specifics Identify things using web identifiers (URIs) Describe resources in terms of properties and

    property values Facts are 3-tuple of (subject, property, object)

    Or (resource, property, value) Subject has a property of object

    Resource X has a name of Drew ISBN 1234567890 has an author of resource X Resource X has a type of Person

  • SE3316 Jagath Samarabandu 197-Nov-13

    Representing Graph Structure Graph of nodes (subject and object) connected

    by arcs (property) Not necessarily a tree

    This graph is represented using RDF syntax Written using XML or N3

    Which is suited for tree structures Allows converting a graph structure to a

    serializable format By breaking graph to several tree structures

  • SE3316 Jagath Samarabandu 207-Nov-13

    An RDF Graph

  • SE3316 Jagath Samarabandu 217-Nov-13

    RDF Representation

    Eric Miller

    Dr.

  • SE3316 Jagath Samarabandu 227-Nov-13

    RDF Example

  • SE3316 Jagath Samarabandu 237-Nov-13

    RDF Graph: Resources Resources are identified by URIs e.g. http://example.com/person/0042, urn:isbn:1930110111

  • SE3316 Jagath Samarabandu 247-Nov-13

    RDF Graph: Literals A primitive string value. The interpretation of the string is up to your application.

  • SE3316 Jagath Samarabandu 257-Nov-13

    RDF Graph: Properties An attribute or aspect of a resource. A property value can be a literal or another resource. Multiple values are allowed; no value at all is also legal.

  • SE3316 Jagath Samarabandu 267-Nov-13

    RDF Graph: Property URIs How are properties identified?

    Names or serial numbers are not very scalable. Instead, properties have URIs just like resources. Pick a base URI for your RDF vocabulary:

    http://amk.ca/xml/review/1.0# The base URI is assigned to a prefix, such as "rev". Properties are then referenced as 'rev:subject',

    'rev:topic', etc. The RDF parser will concatenate the base URI (from the

    prefix) and the name: rev:subject http://amk.ca/xml/review/1.0#subject

  • SE3316 Jagath Samarabandu 277-Nov-13

    RDF Vocabularies DC (Dublin Core)

    Namespace: http://purl.org/dc/elements/1.1/ Properties: title, creator, publisher, subject, identifier

    FOAF (Friend-of-a-friend) Describes people Classes: Person Properties: name, interest, mbox, schoolHomepage,

    workplaceHomepage Namespace: http://xmlns.com/foaf/0.1/

    DOAP (Description of a Project) Describes open source projects Classes: Project, Repository Properties: name, homepage, mailing-list, license, maintainer Namespace: http://usefulinc.com/ns/doap#

    RSS (RDF Site Summary)

  • SE3316 Jagath Samarabandu 287-Nov-13

    Dublin Core Metadata Initiative Developed in 1995 at Metadata Workshop in Dublin,

    Ohio Provides a minimal set of descriptive elements to

    facilitate description and automated indexing of document-like networked objects

    Intended for web-crawlers Meant to be simple Contains only 15 terms: title, creator, subject, description, publisher, contributor, date, type, format, identifier, source, language, relation, coverage, rights

  • SE3316 Jagath Samarabandu 297-Nov-13

    Dublin Core Example A Web page described using RDF with DC term set

    D-Lib Program - Research in Digital LibrariesThe D-Lib program .Corporation For National Research Initiatives1995-01-07

    Research; statistical methodsEducation, research, related topicsLibrary use Studies

    World Wide Web Home Pagetext/htmlen

  • SE3316 Jagath Samarabandu 307-Nov-13

    RSS: RDF Site Summary Really Simple Syndication! An RDF vocabulary designed to handle web

    content Most popular RDF application Contains three modules

    Dublin core Syndication (updatePeriod, updateFrequency and

    updateBase) Content (encoded, item, items, format, encoding)

  • SE3316 Jagath Samarabandu 317-Nov-13

    RDF Advantages RDF exists and is strictly specified. Conceptually the graph model is pretty simple. RDF has a number of implementations. RDF is decentralized:

    Anyone can create a vocabulary. Anyone can publish data about other resources.

  • SE3316 Jagath Samarabandu 327-Nov-13

    RDF Disadvantages RDF/XML is rather verbose, and tedious to

    read/write by hand. Programming interfaces require you to know

    about triples, URIs, and all these low-level details.

  • SE3316 Jagath Samarabandu 337-Nov-13

    Available RDF Software RDF parsers are available for most of the

    languages Python (rdflib, 4RDF, pyrple, cwm) Perl (RDF::Core) C (Redland, libwww)

    SWIG allows Redland to have interfaces for most of the other scripting languages.

    Java (Jena, Sesame) PHP, Ruby, Prolog all have RDF parsers.

  • SE3316 Jagath Samarabandu 347-Nov-13

    Layers: A Closer Look Web Ontology Language (OWL)

    Relationships between vocabularies "Persons" in vocabulary A are the same thing as "Users" in

    vocabulary B. Resource X and resource Y are referring to the same thing.

    RDF Schema: Vocabulary definitions There is a class called "Person". Resource X is an instance of "Person".

    Resource Description Framework (RDF) Assertions of facts Resource X is named "Drew".

  • SE3316 Jagath Samarabandu 357-Nov-13

    RDF Schema: Defining Vocabularies RDF allows making statements Need to define the vocabularies used to define these

    statements Define classes of resources Define the names of properties used in these classes

    RDF itself doesnt allow this RDF-Schema is an extension to RDF designed to handle

    this It self is defined using RDF Namespace: http://www.w3.org/2000/01/rdf-schema# Typically prefixed as rdfs:

  • SE3316 Jagath Samarabandu 367-Nov-13

    RDF Schema Example Some resources (web pages, articles, books)

    are reviews of other resources (books, music, articles, web pages). Implies a Review class.

    A review has one or more subjects that are the items being reviewed. Implies a subject property.

  • SE3316 Jagath Samarabandu 377-Nov-13

    RDF Schema: Graph

  • SE3316 Jagath Samarabandu 387-Nov-13

    RDF Schema Vs OOP Languages

    RDF Schema type system is similar to that of OOP languages

    But RDF schema property descriptions are global attributes while an attribute in a OOP class is local

    RDF schema are descriptive (mostly) whereas OOP languages are prescriptive

  • SE3316 Jagath Samarabandu 397-Nov-13

    Layers: A Closer Look Web Ontology Language (OWL)

    Relationships between vocabularies "Persons" in vocabulary A are the same thing as "Users" in

    vocabulary B. Resource X and resource Y are referring to the same thing.

    RDF Schema: Vocabulary definitions There is a class called "Person". Resource X is an instance of "Person".

    Resource Description Framework (RDF) Assertions of facts Resource X is named "Drew".

  • SE3316 Jagath Samarabandu 407-Nov-13

    OWL: Connecting vocabularies With RDF Schema, we know:

    Which classes exist, What their properties are.

    We don't know: When are two classes the same? Can properties have multiple values?

    e.g. Can a book have more than one author? ... no authors? ... more than one publisher?

    If X prop Y and Y prop Z are both true, which of the following are true?

    X property Z (transitivity) Y property X (symmetry) Z property X

  • SE3316 Jagath Samarabandu 417-Nov-13

    OWL: Web Ontology Language OWL is a W3C language for defining relationship

    between vocabularies He could spell his own name WOL, and he

    could spell Tuesday so that you knew it wasn't Wednesday... in Winnie the Pooh by A. A. Milne, about the wise character, Owl

  • SE3316 Jagath Samarabandu 427-Nov-13

    What is an Ontology Defines terms used to describe and area of

    knowledge Used by people, databases and applications that

    need to share domain information Includes computer useable definitions of basic

    concepts in the domain and the relationships among them

    Encode knowledge in a domain as well as knowledge that spans a domain

    Makes knowledge re-useable

  • SE3316 Jagath Samarabandu 437-Nov-13

    OWL: Beyond RDF Schema Extends RDF Schema

    To limit properties To infer properties To distinguish types of relationships (one-to-one, one-

    to-many, many-to-one)

    AI of the web (for the web) It's based on two existing research languages,

    the American DAML (DARPA Agent Markup Language) and the European OIL (Ontology Inference Layer)

  • SE3316 Jagath Samarabandu 447-Nov-13

    OWL: Possible relationships For classes:

    equivalentClass disjointWith

    For properties: equivalentProperty inverseOf TransitiveProperty SymmetricProperty minCardinality maxCardinality

    For resources: sameAs differentFrom

  • SE3316 Jagath Samarabandu 457-Nov-13

    How much RDF, RDFS and OWL How much of this is being used today? RDF

    Yes, definitely! It's the base of the pyramid, and is widely implemented.

    RDF Schema Useful for documentation. Will likely be important in future. But... you can get useful work done without it.

    OWL Few libraries support OWL Implementations are largely research projects. For many applications theorem-proving will be irrelevant.