Using XML as the Foundation for a Network

  • Slides: 9
Download presentation
Using XML as the Foundation for a Network Resource Description Language Peter A. Dinda

Using XML as the Foundation for a Network Resource Description Language Peter A. Dinda

Motivation • Network Resource Interface for external tools – A standard, text-based representation for

Motivation • Network Resource Interface for external tools – A standard, text-based representation for network data – Integrating our own tools such as RPS – Integrating other tools such as NWS – Enhancing existing text-based interfaces – Potentially proposing a Grid standard Network data is structured data 2

XML in a Nutshell #1 • Standard for presenting structured information via tag-based markup

XML in a Nutshell #1 • Standard for presenting structured information via tag-based markup – Like HTML, except user gets to define the tags and their grammar • “DTD” or “Schema” (can be part of doc) – Unlike HTML, “well-formed” XML is always a tree, so it’s easy to parse • Tags can be anything but must nest – Unlike HTML, no styles or links are defined • They are DTDs! XSL, Xlink, Xpointer, blah • Self-defining text-based structured data format 3

XML in a Nutshell #2 • “Well-formed” XML – It can be produced by

XML in a Nutshell #2 • “Well-formed” XML – It can be produced by the XML grammar • “Valid” XML – Well-formed and the document can be produced by your grammar (ie, the DTD) • Free XML parsers usually don’t “validate” – Probably not much of an issue for resource data • http: //www. xml. com http: //www. w 3. org/XML/ 4

XML Tools • Free parsers available for C, Java, Perl, Python • Lots of

XML Tools • Free parsers available for C, Java, Perl, Python • Lots of commercial stuff – Microsoft (IE 4, IE 5, XML Notepad, lots of others) • Most parsers/tools don’t support the DOM interface and so are not interchangeable 5

DTD/Schema Standardization • XSL (styles), Xlink/Xpointer (links), . . . • DTDs being developed

DTD/Schema Standardization • XSL (styles), Xlink/Xpointer (links), . . . • DTDs being developed for very specific kinds of information – News stories • http: //www. xmlnews. org/dtds/xmlnews-story. dtd • We could propose DTDs to the Grid Forum so that tools could exchange information 6

Proof of Concept • Wrote XML serialization for RPS’s Load. Measurement objects • Used

Proof of Concept • Wrote XML serialization for RPS’s Load. Measurement objects • Used Expat, a free (non-validating) XML parser written in C 7

An XML Serialized Load. Measurement <? xml version="1. 0"? > <!DOCTYPE Host. Load. List

An XML Serialized Load. Measurement <? xml version="1. 0"? > <!DOCTYPE Host. Load. List [ <!ELEMENT Host. Load. List (Host. Load. Info)+> <!ELEMENT Host. Load. Info (Hostname, Period, Smoothing. Type, Time. Stamp, Averages)> <!ELEMENT Period (#PCDATA)> <!ELEMENT Smoothing. Type (unix|mach)> <!ELEMENT Time. Stamp (#PCDATA)> <!ELEMENT Averages (Average+)> <!ELEMENT Average (#PCDATA)> <!ATTLIST Average Number CDATA "0"> ]> <Host. Load. List> <Host. Load. Info> <Hostname>pyramid. cmcl. cs. cmu. edu</Hostname> <Period>1000000</Period> <Smoothing. Type>1</Smoothing. Type> <Time. Stamp>935508266. 313773</Time. Stamp> <Averages> <Average Number="-1">0. 300000</Average> <Average Number="0">0. 200000</Average> <Average Number="1">0. 100000</Average> <Average Number="2">0. 050000</Average> </Averages> </Host. Load. Info> </Host. Load. List> DTD - the grammar for the Host. Load. List document that follows Document - the serialized Load. Measurement object 8

Effort/Efficiency 9

Effort/Efficiency 9