infromation reprentation,structured data and semantics

28
Infromation Reprentation, Structured Data and Semantics Yogendra Tamang 070-MSCS-670

Upload: yogendra-tamang

Post on 16-Jul-2015

78 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Infromation Reprentation,Structured Data and Semantics

Infromation Reprentation,Structured Data and Semantics

Yogendra Tamang

070-MSCS-670

Page 2: Infromation Reprentation,Structured Data and Semantics

OUTLINE

• XML, DTD and XML Schema, XSLT

• Meta data Standards.

• Information Representation in Semantic Web• RDF, RDFS

• Syntactic Formats• RDF/XML, N-triples, Turtles etc.

• Embedded Formats• RDFs, Microformats, eRDF, HTML5, GRDDL, SPARQL

Page 3: Infromation Reprentation,Structured Data and Semantics

XML

XML DocumentsEpilogue

Thing! Elements

Prolog

XML Declaration and

Reference

Tag, Attributes

and Content

<?xml version="1.0" encoding="UTF-16"?><!DOCTYPE book SYSTEM "book.dtd">

<lecturer>David Billington</lecturer>

Page 4: Infromation Reprentation,Structured Data and Semantics

XML

• Comments and Processing Instructions

<!-- This is a comment -->

<?stylesheet type="text/css" href="mystyle.css"?>

Page 5: Infromation Reprentation,Structured Data and Semantics

DTD and XML Schema

• Used for defining the structure • what values an attribute may take

• which elements may or must occur within other elements, etc.

<lecturer>

<name>David Billington</name>

<phone> +61 − 7 − 3875 507 </phone>

</lecturer>

<!ELEMENT lecturer (name,phone)>

<!ELEMENT name (#PCDATA)>

<!ELEMENT phone (#PCDATA)>

Page 6: Infromation Reprentation,Structured Data and Semantics

DTDDisjunctions:

<!ELEMENT lecturer (name|phone)>

<!ELEMENT lecturer((name,phone)|(phone,name))>

Page 7: Infromation Reprentation,Structured Data and Semantics

DTD<order orderNo="23456" customer="John Smith" date="October 15, 2002">

<item itemNo="a528" quantity="1"/>

<item itemNo="c817" quantity="3"/>

</order><!ELEMENT order (item+)>

<!ATTLIST order orderNo ID #REQUIRED

customer CDATA #REQUIRED

date CDATA #REQUIRED>

<!ELEMENT item EMPTY>

<!ATTLIST item itemNo ID #REQUIRED

quantity CDATA #REQUIRED

comments CDATA #IMPLIED>

Page 8: Infromation Reprentation,Structured Data and Semantics

XML Schema<schema http://www.w3.org/2000/10/XMLSchema version="1.0">

Element and Attribute Types using Data Types

• Numerical data types: integer, Short etc.

• String types: string, ID, IDREF, CDATA etc.

• Date and time data types: time, Month etc.

• User defined(Simple and Comlpex)

Page 9: Infromation Reprentation,Structured Data and Semantics

XML Namespaces and XPATH

• Form:xmlns:prefix="location“

• XPATH:Operates on Tree data model and is core for XML query lanaguage

Page 10: Infromation Reprentation,Structured Data and Semantics

XSLT

•XSLT specifies rules with which an input XML document is transformed to• another XML document• an HTML document • plain text

Page 11: Infromation Reprentation,Structured Data and Semantics

RDF

• It provides a uniform framework for interchange of data and metadata between applications

•XML does not provide any means of talking about the semantics (meaning) of data

•Object-Attribute-Value

Page 12: Infromation Reprentation,Structured Data and Semantics

RDF

• Fundamental Concepts:• resources

• properties

• statements

Page 13: Infromation Reprentation,Structured Data and Semantics

Statements

• Triples

• (x, P, y) P(x, y)

Page 14: Infromation Reprentation,Structured Data and Semantics

RDFS Core Classes

• rdfs:Resource, the class of all resources• rdfs:Class, the class of all classes• rdfs:Literal, the class of all literals (strings) • rdf:Property, the class of all properties.• rdf:Statement, the class of all reified statements

Page 15: Infromation Reprentation,Structured Data and Semantics

RDFS Core Properties• rdf:type, which relates a resource to its class

• The resource is declared to be an instance of that class

• rdfs:subClassOf, which relates a class to one of its superclasses• All instances of a class are instances of its superclass

• rdfs:subPropertyOf, relates a property to one of its superproperties

• rdfs:domain,

• rdfs:range,

Page 16: Infromation Reprentation,Structured Data and Semantics

RDF Sparql Query

• SPARQL is based on matching graph patterns

• Example:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?c

WHERE

{

?c rdf:type rdfs:Class .

}

Page 17: Infromation Reprentation,Structured Data and Semantics

RDFa

• RDFa is an extension to HTML5 that helps you markup things like People, Places, Events, Recipes and Reviews. Search Engines and Web Services use this markup to generate better search listings and give you better visibility on the Web, so that people can find your website more easily

Page 18: Infromation Reprentation,Structured Data and Semantics

Microformats

• microformats are a set of simple, open data formats built upon existing and widely adopted standards

Page 19: Infromation Reprentation,Structured Data and Semantics

MicroFormats Tools and Code generators

Page 20: Infromation Reprentation,Structured Data and Semantics
Page 21: Infromation Reprentation,Structured Data and Semantics
Page 22: Infromation Reprentation,Structured Data and Semantics
Page 23: Infromation Reprentation,Structured Data and Semantics

Ntriples

Page 24: Infromation Reprentation,Structured Data and Semantics

Green Turtle RDFa

Page 25: Infromation Reprentation,Structured Data and Semantics

Green Triples

• an implementation of RDFa 1.1 for browsers

• When triples are discovered in a web page, a little green turtle will appear in the address bar. If you click on that turtle, you can

view the triple graph.

Page 26: Infromation Reprentation,Structured Data and Semantics
Page 27: Infromation Reprentation,Structured Data and Semantics
Page 28: Infromation Reprentation,Structured Data and Semantics

References

• “Semantic Web Primer”, Grigoris Antoniou, Frank van Harmelen

• http://rdfa.info/

• https://code.google.com/p/green-turtle/

• http://microformats.org/wiki/about