Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein...

98
Multi-agent Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and Grammars Namespaces RDF/XML Conclusion Multi-agent Semantic Web Systems: XML Ewan Klein MASWS — 29 January 2008

Transcript of Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein...

Page 1: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Multi-agent Semantic Web SystemsXML

Ewan Klein

MASWS mdash 29 January 2008

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

1 Introduction

2 Structure and Grammars

3 Namespaces

4 RDFXML

5 Conclusion

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 2: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

1 Introduction

2 Structure and Grammars

3 Namespaces

4 RDFXML

5 Conclusion

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 3: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 4: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 5: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 6: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 7: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 8: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Tags and Text

If yoursquove ever looked at an HTML document then youalready know a fair amount about XML

Sample HTML

ltheadgtlttitlegtMulti Agent Semantic Web Systemslttitlegt

ltheadgt

XML consists of tags and text

Tags must be paired

They can also be nested

Text is bounded by tags called pcdata (parsed characterdata)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 9: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 10: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 11: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan element

ltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 12: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Elements and Nesting

Stuff between (and including) paired tags is called anelement

Elements

lttitlegtMulti Agent Semantic Web Systemslttitlegt isan elementltheadgt ltheadgt is also an element

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 13: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 14: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 1

Nesting of elements can be used to indicate structure

Example Hierarchical Structure of Text

ltparagtltsgtI thought it was heltsgtltsgtWholtsgtltsgtGodotltsgtltparagt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 15: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Nesting and Structure 2

Example Record Structure

ltfilmgtlttitlegtSeven SamurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgtltfilmgtlttitlegtZatoichilttitlegtltdirectorgtTakeshi Kitanoltdirectorgtltdategt2003ltdategtltfilmgt

Title Director DateSeven Samurai Akira Kurosawa 1954

Zatoichi Takeshi Kitano 2003

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 16: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 17: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 18: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 19: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Attributes

Start tags can contain attributes mdash name-value pairs

These are often used to refine or qualify the information inthe element

Can only have text as values

Example of Attribute

ltfilmgtlttitle lang=rsquorsquoenrsquorsquogtSeven Samurailttitlegtlttitle lang=rsquorsquojarsquorsquogtShichinin no samurailttitlegtltdirectorgtAkira Kurosawaltdirectorgtltdategt1954ltdategtltfilmgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 20: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 21: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards display

XML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 22: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structure

HTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 23: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabulary

XML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 24: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 25: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 26: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 27: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 28: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 29: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML vs HTML

XML and HTML both ways of marking up documents

HTML is oriented towards displayXML is oriented towards structureHTML has a fixed vocabularyXML has an extensible vocabulary

Historically XML developed from SGML (StandardGeneralized Markup Language)

XML is syntactically more constrained and therefore easierto process than SGML

Notion of lsquodocumentrsquo has become very wide including

vector graphics e-commerce transactionmathematical equations object meta-dataserver APIs (Walsh)

XML designed to structure store and transfer data

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 30: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 31: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 32: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 33: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Well-formed XML (Not)

ltpgtThis is one ltpgtAnd an-other

Tags have to be closed

ltDategt17-01-2003ltdategt Tags are case-sensitive

ltbgtltigt bold and italicltbgtltigt

Tags must be properlynested

ltimg src=foogifgt Attribute values must bequoted

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 34: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DOCTYPE Declaration

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE html

PUBLIC -W3CDTD XHTML 10 TransitionalEN

httpwwww3orgTRxhtml1DTDxhtml1-transitionaldtdgtlthtml xmlns=httpwwww3org1999xhtml xmllang=en-USgtltheadgtlttitlegtResultslttitlegtltheadgtltbody bgcolor=ffffffgtltbodygtlthtmlgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 35: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declaration

describes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 36: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 37: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 38: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 39: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 40: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 41: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 42: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

DTDs

DTD mdash Document Type Declarationdescribes the syntactic rules of the XML in a document

An XML document is well-formed if the XML has thecorrect syntax

An XML document is valid (with respect to a DTD) if it isboth well-formed and conforms to the rules of the DTD

Two forms of DOCTYPE declaration

SYSTEM URI location of DTD for private use indocument

PUBLIC lsquoglobalrsquo name followed by URI

DOCTYPE declaration used for a SYSTEM DTD

ltxml version=10 encoding=iso-8859-1gtltDOCTYPE letter SYSTEM lsquolsquomydtddtdrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 43: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 44: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documents

but overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 45: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 46: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 47: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique name

not a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 48: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 1

Standard problem

may want to merge two documentsbut overlap in vocabulary (eg element names)

Namespaces

a mechanism for grouping together a collection of nameswhere the group has globally unique namenot a concrete list of names

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 49: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 2

Example of Name Clash

ltCustomergtltNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=344gt

ltNamegtDrinking duckltNamegtltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 50: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 51: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinct

But this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 52: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 3

Could we use a URI to make name distinctBut this conflicts with XML rules for element names

Example with URI (Wrong)

ltCustomergtlthttpexamplecomNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 53: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)

As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 54: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 55: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML QNames Again

But it is OK to use XML Qualified Names (QNames)As before we invent an alias for the URI and prefix itusing lsquorsquo as a separator

Example with QName (Correct)

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogtltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergtltProduct productID=rsquorsquo344rsquorsquogtltNamegtDrinking duckltNamegt

ltProductgt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 56: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 57: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 58: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 59: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 60: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

XML Namespaces 4

Previous example declares per as alias for the URIhttpexampleorgPerson

ltperNamegt not the same as ltNamegt

ltxmlnsgt is a special (pseudo-)attribute for declaringnamespaces

there can be multiple namespace declarations in the sameelement

The xmlns Attribute

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 61: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 62: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 63: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Default Namespaces

The default namespace must be declared

It applies to any subsequent element name that isunqualified (ie lacks a prefix)

Example of default namespace

ltDuckCorp xmlnsper=rsquorsquohttpexampleorgPersonrsquorsquoxmlns=rsquorsquohttpexampleorgProductrsquorsquogt

ltCustomergtltperNamegtltFirstNamegtHomerltFirstNamegtltLastNamegtSimpsonltLastNamegt

ltNamegtltCustomergt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 64: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 65: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 66: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 1

RDF Triples are encoded as rdfDescription elements

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 67: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 68: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 2

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 69: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 70: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 71: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 72: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 73: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo element

Resource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 74: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo element

URIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 75: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 3

RDF Triples are serialized as rdfDescription elements

The Subject is the value of the rdfabout attribute onrdfDescription

The Predicate becomes a child element ofrdfDescription

Objects

Literal Objects are text content of the lsquoPredicatersquo elementResource Objects are values of the rdfresourceattribute of the lsquoPredicatersquo elementURIs have to be written out in full (no QNames) whenthey are attribute values

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 76: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 77: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 78: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 4

RDF Triple with literal Object

edstaff9888 foafname rsquoEwan Kleinrsquo

ElementrdfDescription

Attrrdfabout

Elementfoafname

TextEwan Klein

Texthttp9888

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan KleinltfoafnamegtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 79: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 80: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 81: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

RDF Triples as XML Trees 5

RDF Triples with resource Object

infcoursesmasws dccreator edstaff9888

ElementrdfDescription

Attrrdfabout

Elementdccreator

Attrrdfresource

Texthttp9888

Texthttpmasws

Linear version

ltrdfDescription rdfabout=rsquorsquohttpmaswsrsquorsquogtltdccreator rdfresource=http9888gtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 82: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 83: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegt

ltrdfDescriptionrsquogtltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogt

ltfoafhomepage rdfresource=httpsimewangtltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 84: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Abbreviating Multiple Properties

RDF Triples with shared Subject

edstaff9888 foafname rsquoEwan Kleinrsquoedstaff9888 foafhomepage httpsimewan

Linear version

ltrdfDescription rdfabout=rsquorsquohttp9888rsquorsquogtltfoafnamegtEwan Kleinltfoafnamegtltfoafhomepage rdfresource=httpsimewangt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 85: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 86: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Blank Nodes

http~kim

mailtokimwannabe

Kim

dccreatorfoafmailbox

foafname

XML version of blank node

ltrdfDescription rdfabout=rsquorsquohttpsimkimrsquorsquogtltdccreator rdfnodeID=abcgtltrdfDescriptiongtltrdfDescription rdfnodeID=abcgt

ltfoafmailbox rdfresource=mailtokimwannabegtltfoafnamegtKimltfoafnamegt

ltrdfDescriptionrsquogt

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 87: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 88: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 89: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 90: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Reading

Therersquos too much choice

Antoniou amp van Harmelen Chapter 2

Robert Eckstein (2001) XML Pocket Reference OrsquoReilly

Jenni Tennison (2005) Beginning XSLT 2 0 Apress(Much more than XML An excellent introduction toXSLT)

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 91: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 92: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languages

documents which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 93: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 94: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 95: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 96: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 97: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion
Page 98: Multi-agent Semantic Web Systems: XML · 2008-02-04 · Semantic Web Systems: XML Ewan Klein Outline Introduction Structure and ... HTML is oriented towards display. XML is oriented

Multi-agentSemantic Web

SystemsXML

Ewan Klein

Outline

Introduction

Structure andGrammars

Namespaces

RDFXML

Conclusion

Summary

XML is a ldquometa-markuprdquo language

defines a syntax for a family of markup languagesdocuments which conform to the syntax are well-formedXML

You can design your own language within XML using aDTD

Documents which conform to a DTD are valid XML

Structural markup allows multiple re-use eg XSLT ispowerful language for transforming XML

Namespaces are an important technique when it comes todefining specialised vocabularies in XML-based languages

Both RDF and RDFS have serializations in XML

  • Outline
  • Introduction
  • Structure and Grammars
  • Namespaces
  • RDFXML
  • Conclusion