semantic web

66
www.sti-innsbruck.at © Copyright 2008 STI INNSBRUCK www.sti- innsbruck.at Semantic Web Semantic Web Architecture Dieter Fensel Federico Facca Jacek Kopecky

Upload: hamish-walls

Post on 31-Dec-2015

29 views

Category:

Documents


0 download

DESCRIPTION

Semantic Web. Semantic Web Architecture Dieter Fensel Federico Facca Jacek Kopecky. Where Are We?. Agenda. Introduction and motivation Technical solutions Semantic Web architecture Uniform Resource Identifier Extensible Markup Language Namespaces Extensions - PowerPoint PPT Presentation

TRANSCRIPT

www.sti-innsbruck.at © Copyright 2008 STI INNSBRUCK www.sti-innsbruck.at

Semantic WebSemantic Web Architecture

Dieter FenselFederico FaccaJacek Kopecky

www.sti-innsbruck.at 2

Where Are We?

# Date Title

1 Introduction

2 Semantic Web architecture

3 RDF and RDFs

4 Web of hypertext (RDFa, Microformats) and Web of data

5 Semantic annotations

6 Repositories and SPARQL

7 OWL

8 RIF

9 Web-scale reasoning

10 Social Semantic Web

11 Ontologies and the Semantic Web

12 SWS

13 Tools

14 Applications

15 Exam

www.sti-innsbruck.at 3

Agenda

1. Introduction and motivation

2. Technical solutions1. Semantic Web architecture

2. Uniform Resource Identifier

3. Extensible Markup Language

4. Namespaces

3. Extensions

4. Illustration by a large example

5. Summary

6. References

www.sti-innsbruck.at 4

INTRODUCTION AND MOTIVATION

www.sti-innsbruck.at 5

Web Architecture

• The Semantic Web extends the Web• Web architecture principles

– Simplicity– Orthogonality of specifications

• Identification vs. interaction vs. representation• Better manageability, independent evolution

– Extensibility• Extending and subsetting

• Web of documents– Wealth of data– Mostly in HTML, XML – data islands

www.sti-innsbruck.at 6

Semantic Web

• Semantic data– Powerful queries, inference, reasoning

• Linked data– Data integration and reuse– Combining data from differen sources

• Semantic automation– Mediation of different vocabularies– Data mining– Automated use of Web services

www.sti-innsbruck.at 7

Semantic Web Architecture

• Formalized components and their relationships– What technologies make up Semantic Web– What are the dependencies between components

• Roadmap for steps of developing the Semantic Web

www.sti-innsbruck.at 8

TECHNICAL SOLUTIONThe Semantic Web architecture and its foundations

www.sti-innsbruck.at 9

SemWeb Architecture: Requirements

• Extensibility– Each layer should extend the previous one(s)

• Support for data interchange– Using data from one source in other applications

• Support for ontology description with different complexity– Including rules

• Support for data query• Support for data provenance and trust evaluation

see the Semantic Web Roadmap: http://www.w3.org/DesignIssues/Semantic.html

www.sti-innsbruck.at 10

Semantic Web StackAdapted from

http://en.wikipedia.org/wiki/Semantic_W

eb_Stack

www.sti-innsbruck.at 11

UNICODE, URI and XML

• UNICODE is the standard international character set

• Uniform Resource Identifiers (URIs) identify things and concepts

• eXtensible Markup Language (XML) is a markup language used for data exchange

www.sti-innsbruck.at 12

RDF, RDFS and OWL

• Resource Description Framework (RDF) is the HTML of the Semantic Web– Simple way to describe resources on the Web– Based on triples <subject, predicate, object>– Various serializations, including one based on XML– A simple ontology language (RDFS)– More in Lecture 3

• Web Ontology Language (OWL) isa more complex ontology language than RDFS– Layered language based on DL– Overcomes some RDF(S) limitations– More in Lecture 7

www.sti-innsbruck.at 13

SPARQL and Rule Languages

• SPARQL– Query language for RDF triples– A protocol for querying RDF data over the Web– More in lecture 6

• Rule languages (esp. Rule Interchange Format RIF) – Extend ontology languages with proprietary axioms– Based on different types of logics

• Description Logic• Logic Programming

– More in lecture 8

www.sti-innsbruck.at 14

Logics, Proof and Trust

• Unifying logic– Bring together the various ontology and rule languages– Common inferences, meaning of data

• Proof– Explanation of inference results, data provenance

• Trust– Trust that the system performs correctly– Trust that the system can explain what it is doing– Network of trust for data sources and services– Technology and user interface

• Many open problems, topics for future research

www.sti-innsbruck.at 15

Lecture II: Foundations

www.sti-innsbruck.at 16

UNICODEMore than a-z, A-Z

www.sti-innsbruck.at 17

Character Sets

• ASCII – 7 bit, 128 characters (a-z, A-Z, 0-9, punctuation)• Extension code pages – 128 chars (ß, Ä, ñ, ø, Š, etc.)

– Different systems, many different code pages– ISO Latin 1, CP1252 – Western languages (197 = Å)– ISO Latin 2, CP1250 – East Europe (197 = Ĺ)

• Code page is an interpretation, not a property of text• UNICODE

$ Å Ĺ Æ ή ك ⅝ ♥ Ж ญ U+0024 U+00C5 U+0139 U+00C6 U+03AE U+0643 U+215D U+2665 U+0416 U+0E0D

www.sti-innsbruck.at 18

UNICODE

• ISO standard– About 100'000 characters, space for 1'000'000– Unique code points from U-0000 through U-FFFF to U-10FFFF– Well-defined process for adding characters

• When dealing with any text, simply use UNICODE– Character code charts: http://www.unicode.org/charts/

• See also:– http://www.tbray.org/talks/rubyconf2006.pdf– http://tbray.org/ongoing/When/200x/2003/04/06/Unicode

www.sti-innsbruck.at 19

UNICODE Byte Encodings

• 21 bits per character various encodings• UTF-8: 1-4 bytes per character

– Optimized towards western alphabets– ASCII-safe

• UTF-16: 2-4 bytes per character• UTF-32: 4 bytes per character, simplest to work with

Code Char UTF-8 UTF-16 UTF-32U+0041 A 41 0041 00000041U+00DF ß C39F 00DF 000000DFU+0E0D ญ E0B88D 0E0D 00000E0DU+10380 F0908E80 D800DF80 00010380

www.sti-innsbruck.at 20

URI: UNIFORM RESOURCE IDENTIFIERS

How to identify things on the Web

www.sti-innsbruck.at 21

Identifier, Resource, Representation

Taken from http://www.w3.org/TR/webarch/

www.sti-innsbruck.at 22

URIs Are Everywhere!http://www.flickr.com

/photos/psd/2450160/

www.sti-innsbruck.at 23

URI Syntax

• Examples– http://www.ietf.org/rfc/rfc3986.txt– mailto:[email protected]– news:comp.infosystems.www.servers.unix– telnet://melvyl.ucop.edu/

• URI Syntax scheme: [//authority] [/path] [?query] [#fragid]

– The scheme distinguishes different kinds of URIs– Authority normally identifies a server– Path normally identifies a directory and a file– Query adds extra parameters– Fragment ID identifies a secondary resource

www.sti-innsbruck.at 24

URI Syntax cont’d

• Reserved characters (like /:?#@$&+* )• Many allowed characters• Rest percent-encoded from UTF-8

– http://google.com/search?q=technikerstra%C3%9Fe

• IRI – Internationalized Resource Identifier– Allows whole UNICODE– Specifies transformation into URI – mostly UTF-8 encoding

www.sti-innsbruck.at 25

URI Schemes

• Schemes partition the URI space into subspaces

• Schemes can add or clarify properties of resources– Ownership

(how authorities are formed)

– Persistence (how stable the URIs should be)

– Protocol (default access protocol)

Scheme Description RFC

file Host-specific file names [1738]

ftp File Transfer Protocol [1738]

http Hypertext Transfer Protocol [2616]

https Hypertext Transfer Protocol Secure [2818]

im Instant Messaging [3860]

imap internet message access protocol [5092]

ipp Internet Printing Protocol [3510]

iris Internet Registry Information Service [3981]

ldap Lightweight Directory Access Protocol [4516]

mailto Electronic mail address [2368]

mid message identifier [2392]

From http://www.iana.org/assignments/uri-schemes.html

www.sti-innsbruck.at 26

URLs and URNs

• Locators (addresses) vs. Names• Pure URNs not easily dereferencable• URNs can be made dereferencable by infrastructure• URLs perceived as less persistent• URLs and URNs drifting towards middle ground

– http://www.w3.org/DesignIssues/NameMyth.html

• No point in making the distinction any more– Simply always use "URI"– If you didn't know about URLs and URNs, ignore this slide

www.sti-innsbruck.at 27

Fragment IDs in URIs

• Fragment ID identifies a secondary resource– No direct path to representation

• Interpretation of fragment IDs depends on media type– For example: http://example.com/file#foo– In HTML <a name="foo">– In XML <element xml:id="foo"/>– No meaning in JPEG

www.sti-innsbruck.at 28

URIs: Main Points

• Cool URIs don’t change• URIs can be (and are) scribbled on napkins• URIs don’t necessarily point to documents

– A URI can identify anything, even you

• Dereferencable URIs also good as names• URL – URN distinction obsolete

www.sti-innsbruck.at 29

XML: EXTENSIBLE MARKUP LANGUAGE

How to exchange structured data on the Web

www.sti-innsbruck.at 30

eXtensible Markup Language

• Language for creating languages– “Meta-language”– XHTML is a language: HTML expressed in XML

• W3C Recommendation (standard)– XML is, for the information industry,

what the container is for international shipping– For structured and semistructured data

• Main plus: wide support, interoperability– Platform-independent

• Applying new tools to old data

www.sti-innsbruck.at 31

Structure of XML Documents

• Elements, attributes, content• One root element in document• Characters, child elements in content

www.sti-innsbruck.at 32

XML Element

• Syntax <name>contents</name>– <name> is called the opening tag– </name> is called the closing tag

• Examples <gender>Female</gender> <story>Once upon a time there was…. </story>

• Element names case-sensitive

www.sti-innsbruck.at 33

Attributes to XML Elements

• Name/value pairs, part of element contents• Syntax <name attribute_name="attribute_value">contents</name>• Values surrounded by single or double quotes

• Example<temperature unit="F">64</temperature><swearword language='fr'>con</swearword>

www.sti-innsbruck.at 34

Empty Elements

• Empty element: <name></name>• This can be shortened: <name/>• Empty elements may have attributes

• Example<grade value='A'/>

www.sti-innsbruck.at 35

Comments

• May occur anywhere in element contents or outside the root element

• Start with <!--• End with -->• May not contain a double hyphen• Comments cannot be nested

• Example:<element>content <!-- a comment, will be ignored in processing --></element><!-- comment outside the root element -->

www.sti-innsbruck.at 36

Nesting Elements

• Elements may contain other (child) elements– The containing element is the parent element

• Elements must be properly nested

• Example with improper nesting:<b>bold <i>bold-italic</b> italic?</i>

• The above is not XML (not well-formed)

www.sti-innsbruck.at 37

Special Characters in XML

• < and > are obviously reserved in content– Written as &lt; and &gt;

• Same for ' and " in attribute values– Written as &apos; and &quot;

• Now & is also reserved– Written as &amp;

• Any character: &#223; or &#xdf; ß– Decimal or hexa-decimal unicode code point

• Elements and attributes whose name starts with “xml”are also special

www.sti-innsbruck.at 38

Well-formed XML

• Syntactically correct XML

<jsdfiew bnvyu="099430'693lkjds3!" />

• Not well-formed (every line contains syntax errors)

<a b='c"><%$@$#%#!! /><d e f=g/>&nbsp

</h>

www.sti-innsbruck.at 39

Uses of XML

• Document mark-up – XHTML– HTML is a language, so it can be expressed in XML

• Exchanged data– Scalable vector graphics – SVG – E-commerce – ebXML – Messaging in general – SOAP – And many more standards

• Internal data– Databases– Configuration files

• Etc.

www.sti-innsbruck.at 40

Why XML?

• For semistructured data:– Loose but constrained structure– Unspecified content length

• For structured data:– Table(s) or similar rows– Well-defined structure, data types– Good interoperability– But: requirements for quick access, processing

www.sti-innsbruck.at 41

XML Parsers

• Document Object Model (DOM) builder– Creates an object model of XML document– In-memory representation, random access– DOM complex, simpler JDOM etc.

• Simple API for XML parsing (SAX)– Views XML as stream of events– el_start("date"), attribute("day", "10"), el_end("date")– Calls your handler– DOM builder can use SAX

• Pull parsers– You call source of XML events

www.sti-innsbruck.at 42

What Parser To Use?

• Random access DOM (JDOM)• Well-formedness requirement

– DOM– Or very good error handling, transactions

• Great speed pull, SAX• Streaming pull, SAX

– Passing the stream around in the program pull (not SAX)

• Easy prototyping DOM

www.sti-innsbruck.at 43

XML LANGUAGESUsing XML for concrete data, mixing different types of data

www.sti-innsbruck.at 44

XML Languages

• XML is a meta-language• HTML is a language

– Or scalable vector picture format– Or purchase order format

• Language should be formally described– In textual documentation– Grammar can be machine-processible

• DTD, XML Schema (out of scope of this class)

– A document that fits the language grammar is valid• Naturally, it must be well-formed first

www.sti-innsbruck.at 45

No Registry of XML Languages

<sign>

Traffic sign?Positive vs. negative number sign?

Sign-language element?Signature?

www.sti-innsbruck.at 46

Namespaces

• Avoiding conflicts, misunderstanding• Giving a URI to an XML language

– http://traffic.example/inventory/– http://math.example/functions/– http://deaf.example/language/– http://security.example/digsig/– Combined as a string!

<sign xmlns="http://example.com/math/functions/"> + </sign>

• xmlns attribute defines the namespace of an element– So-called default namespace

www.sti-innsbruck.at 47

Combining XML Languages

• Potentially lot of URI repetition

<container>

<sign xmlns="http://example.com/math/functions/"> + </sign>

<sign xmlns="http://example.com/security/digsig/">

fad87b6dfb875bfda4ce67…

</sign>

</container>

www.sti-innsbruck.at 48

Combining XML Languages 2

• Named namespaces with prefixes• Prefix part of name – QName (qualified name)

– But prefix is insignificant– "a:sign" can be different signs in different places– "a:sign" can be same as "b:sign" (and even just "sign")

<containerxmlns:math="http://example.com/math/functions/"xmlns:sec="http://example.com/security/digsig/" >

<math:sign> + </math:sign><sec:sign>fad87b6dfb875bfda4ce67…</sec:sign>

</container>

www.sti-innsbruck.at 49

Example Document I

• Namespace binding

<?xml version='1.0' encoding='UTF-8'?>

<order>

<item code='BK123'>

<name>Care and Feeding of Wombats</name>

<desc xmlns:html='http://www.w3.org/1999/xhtml'>

The <html:b>best</html:b> book ever written!

</desc>

</item>

</order>

www.sti-innsbruck.at 50

Example Document II

• Scope of namespace binding

<?xml version='1.0' encoding='UTF-8'?>

<order>

<item code='BK123'>

<name>Care and Feeding of Wombats</name>

<desc xmlns:html='http://www.w3.org/1999/xhtml'>

The <html:b>best</html:b> book ever written!

</desc>

</item>

</order>

www.sti-innsbruck.at 51

Example Document III

• Namespace-qualified elements

<?xml version='1.0' encoding='UTF-8'?>

<order>

<item code='BK123'>

<name>Care and Feeding of Wombats</name>

<desc xmlns:html='http://www.w3.org/1999/xhtml'>

The <html:b>best</html:b> book ever written!

</desc>

</item>

</order>

www.sti-innsbruck.at 52

Prefix, QName Significance

• Prefixes are theoretically insignificant– Problems with canonicalization (c14n), digital signature– Problems in DOM

• Should findElement("foo") return ns:foo as well?

– Theoretically only matter for parser and serializer

• Common prefixes: xs, xsi, xsl, wsdl, wsa, ex• As far as possible, forget the prefix

– But don’t redefine common prefixes

www.sti-innsbruck.at 53

XML Conclusions

• XML is a big topic• If you don’t go into detail, it’s all simple

– Details are usually messy

• Namespaces should be used as much as possible– And are always used on the Semantic Web

• XML simplifies integration and interpretation– And tool support simplifies programming

www.sti-innsbruck.at 54

FURTHER DEVELOPMENTS

www.sti-innsbruck.at 55

Building On The Foundations

• RDF for semantic data– Graphs of linked data– Semantic Web

• Any XML or HTML can support translation to RDF– GRDDL: a pointer to a transformation– RDFa: RDF in XHTML– Makes existing data part of the Semantic Web

• XML has encryption and digital signature– Necessary technologies for data provenance, trust

www.sti-innsbruck.at 56

Web of Linked Data

www.sti-innsbruck.at 57

RDF Teaser

• Resource Description Framework– Metadata: about Web resources– But also any other data

• Graphs of resources interlinked with propertiesDieterFensel teaches SemanticWebCourse

knows FedericoFacca

FedericoFacca teaches WebEngineeringCourse

• Ontology languages for data schemas– Various properties: teaches, knows– Classes of resources: Person, Professor, Course

• SPARQL for querying the data

www.sti-innsbruck.at 58

ILLUSTRATION BY A LARGER EXAMPLE

The Semantic Web architecture in practice

www.sti-innsbruck.at 59

Semantic Conference

• All the data about the conference is part of the SemWeb– Date, location– Organizers, peer-review committees– Articles (papers), their authors– Detailed program schedule

• Each SemWeb architecture layer plays a role

www.sti-innsbruck.at 60

Foundation Layers

• UNICODE– All participants' names should be in UNICODE because they are

international: Denny Vrandečić, Diego Meroño, François Maué– Same for paper titles: "α-decay and β-decay of heavy atoms"

• URI– All important things must have identifiers, for example:– Conference: http://conference.example/– Participant: http://merono.example/foaf.rdf#me– Participant's affiliation: http://www.uni-roma.example/– Paper: http://conference.example/papers/137– Program sessions: http://conference.example/program/sw-1

www.sti-innsbruck.at 61

Data Layers

• XML– The HTML pages should be in XHTML– The RDF data (below) should be in RDF/XML– News feed should be in Atom (an XML format)

• RDF– The conference dataset, and any useful subsets, should be

published in RDF for download; for example:– http://conference.example/data.rdf – http://conference.example/papers.rdf – http://conference.example/attendees.rdf – etc.

www.sti-innsbruck.at 62

Ontologies, Query

• RDFS, OWL– The conference would use various vocabularies and ontologies,

such as:– FOAF (Friend of a friend) for talking about the attendees and

authors/presenters– Dublin Core for paper metadata– Calendar ontology for the program

• SPARQL– The conference server should have a public SPARQL endpoint

that can be used for queries over the conference data

www.sti-innsbruck.at 63

Higher Layers

• Cryptography: the conference may digitally sign all the published data

• Trust: A user who trusts the institution that organized the conference may then automatically trust the data provided on the conference Web site

• Rules, Proof: a conference attendee who receives an email from a seemingly unknown person may be automatically reminded that the attendee and the sender of the email probably know each other because they presented their papers in the same conference session

www.sti-innsbruck.at 64

SUMMARY

www.sti-innsbruck.at 65

Summary

• Semantic Web builds on the Web• For any text, use UNICODE, probably UTF-8• URIs can identify anything

– Not only documents on the Web

• XML helps with data exchange, interoperability• XML languages are distinguished with namespaces

www.sti-innsbruck.at 66

References

• SemWeb architecture– http://www.w3.org/DesignIssues/Architecture.html– http://en.wikipedia.org/wiki/Semantic_Web_Stack– http://www.w3.org/TR/webarch/– http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm– http://www.w3.org/DesignIssues/Semantic.html

• URI– http://www.w3.org/Provider/Style/URI– http://www.ietf.org/rfc/rfc3986.txt

• UNICODE– http://www.unicode.org/charts/– http://www.tbray.org/talks/rubyconf2006.pdf– http://tbray.org/ongoing/When/200x/2003/04/06/Unicode

• XML– http://www.w3.org/TR/xml/– http://www.w3.org/TR/xml-names/– http://www.w3.org/TR/xmlschema-1/