RDF vs XML

Embed Size (px)

Citation preview

  • 8/14/2019 RDF vs XML

    1/12

    03/02/10

    1

    Resource

    DescriptionFramework

    Arunabh Nag

    eXtensibleMarkupLanguage

    VS.

  • 8/14/2019 RDF vs XML

    2/12

    03/02/10

    2

    Introduction

    The Extensible Markup Language

    (XML) The Resource Description Framework

    (RDF)

    Semantic Web Distributing knowledge

  • 8/14/2019 RDF vs XML

    3/12

    03/02/10

    3

    XML basic stats

    design goals - emphasize simplicity, generality,

    and usability over the Internet.

    textual data format, with strong support via

    Unicode.

    designed to transport and store data, with focus on

    what data is.

    allows the author to define his own tags and his

    own document structure.

  • 8/14/2019 RDF vs XML

    4/12

    03/02/10

    4

    a framework for describing resources on the web.

    designed to be read and understood by computers.

    written in XML.

    RDF is a data model, not a data format.

    The most exciting uses of RDF aren't in encoding informationabout web resources, but information about and relationsbetween things in the real world: people, places, concepts,etc.

    RDF basic stats

  • 8/14/2019 RDF vs XML

    5/12

    03/02/10

    5

    RDF vs. XML

    RDF is constituted ofProperties, Values, andStatements that can beresources and includemetadata created by otherpeople and organizations

    XML documents are madeup of storage units calledentities, which containeither text Or binary data.Text is made up ofcharacters, some of whichform the character data inthe document, and some ofwhich form markup.

  • 8/14/2019 RDF vs XML

    6/12

    03/02/10

    6

    RDF vs. XML

    Order of properties is nota primary concern, henceRDF offers a veryappealing and flexiblesolution to any webdesigner.

    This is due to the fact thatRDF has a graphical data

    model hence the structureis defined by relationsamong prperties.

    Order of elements matters alot in XML

    Since XML has a treebased data model, theentity always starts with theroot element and goes on tothe child elements in anorderly manner.

  • 8/14/2019 RDF vs XML

    7/12

  • 8/14/2019 RDF vs XML

    8/12

    03/02/10

    8

    RDF vs. XML There is a XML notation

    for RDF but this is one ofmany notations that share

    a common data model. The data model is crucially

    not a tree, but roughly agraph. The data modelalso makes particular useof URIs and other things

    which XML is agnostic to.Thus the tools that workon top of RDF work on topof a graph data model, nota tree data model.

    the name XML means twothings.

    First is the notation.

    Secondly there is the datamodel behind that: a treewith several types of nodes(elements, attributes, etc.).

    The data model is clearwhen you think about XMLAPIs and libraries.

  • 8/14/2019 RDF vs XML

    9/12

    03/02/10

    9

    RDF vs. XML Consider a simple

    example : The author of apage is Ora.

    In RDF this is a triple

    triple(author, page, Ora)

    this information be typicallybe represented in XML as :

    page

    Ora

    Or Maybe :

    Ora

  • 8/14/2019 RDF vs XML

    10/12

    03/02/10

    10

    RDF vs. XML Since the schema is limited and

    defined, the RDF graph, thoughparsed in any way will only yieldone sequence.

    Like in the above example :

    The understood graph will alwaysbe :

    These are all perfectly goodXML documents - and to aperson reading then they

    mean the same thing. To amachine parsing them, theyproduce different XML trees.

    The tree in this case may beas that of the RDF graph, yetit may not be, so the queriesmust always be choiceindependent, hence reducingthe flexibility.

  • 8/14/2019 RDF vs XML

    11/12

    03/02/10

    11

    Using RDF instead of XML RDF allows us to parse the semantic tree, which end up

    giving us a set of (possibly mutually referential) triples and

    then we can use the ones you want ignoring the ones youdon't understand.

    Consider a layman example :

    A label on a food product reads that it expires on December 2010. The

    possible solutions using XML are that either the label or the product expires.

    But using RDF, the associated schema properties produce only one result the espiry of the food product mentioned on a label.

    XML allows us to create schemas for refined queries, but

    using RDF is both easier and more efficient.

  • 8/14/2019 RDF vs XML

    12/12

    03/02/10

    12

    Conclusion Sometimes it seems there is a set of people for whom the

    semantic web is the only graph which they would consider,

    and another for whom the document tree (or graph if youinclude links) is all they would consider. But it is important to

    recognize the difference.

    While using RDF is easier that XML, yet developers prefer the

    order in XML, which is mostly due to the constraints of

    processing the human readable documents