Presentation is loading. Please wait.

Presentation is loading. Please wait.

Document Content Description for XML, Version 1.0 By Tim Bray, Charles Frankston and Ashok Malhotra EECS 684 Presentation by Calvin Ang.

Similar presentations


Presentation on theme: "Document Content Description for XML, Version 1.0 By Tim Bray, Charles Frankston and Ashok Malhotra EECS 684 Presentation by Calvin Ang."— Presentation transcript:

1 Document Content Description for XML, Version 1.0 By Tim Bray, Charles Frankston and Ashok Malhotra EECS 684 Presentation by Calvin Ang

2 Slide 2 Introduction n Presentation Scope –Design Principles –DCD Framework –DCD Vocabulary –Datatypes –Examples –Conclusion

3 Slide 3 Document Abstract n Submission to World Wide Web Consortium n proposes structural schema facility, Document Content Description (DCD) n rules covering structure & content of XML documents n consistent with ongoing W3C Resource Description Framework (RDF) effort n DCD is in many respects similar to an XML DTD, although it hopes to achieve more

4 Slide 4 Sample DCD Code: Airline Booking n DCD code provides constraints for an airline booking Describes an airline reservation LastName FirstInitial SeatRow SeatLetter Departure Class

5 Slide 5 Sample DCD Code: Airline Booking n Booking record that conforms to the schema Bray T 33 B 1997-05-24T07:55:00+1

6 Slide 6 Design Principles n DCD is based on the following design principles: 1. DCD semantics is superset of those provided by XML DTDs 2. DCD data model & syntax conformant with RDF 3. Constraints in DCD are usable by authoring tools and other applications retrieving information about document’s content and structure 4. DCD to use mechanisms from other W3C working groups wherever appropriate & efficient 5. DCDs should be human-readable and reasonably clear

7 Slide 7 DCD Framework n Syntax –Conformant to RDF Model & Syntax Specification –Assumes certain simplifications –Syntax only adopted if ratified by RDF working group

8 Slide 8 DCD Framework n DCD Nodes and Resource Types –namespace which describes DCD properties and resources is identified by the URI http://w3.org/Schemas/DCD –URI contains the following types: DCD, ElementDef, Group, AttributeDef, ExternalEntityDef and InternalEntityDef –DCD is a document structure description –XML document can fall under the constraints of more than one DCD Benefit 1 - single DCD used to provide constraints for large numbers of separate documents Benefit 2 - DCD object provides convenient level of granularity for applying namespace mechanisms

9 Slide 9 DCD Framework n Resource Types –ElementDef & AttributeDef are more detailed structure descriptors –provide constraints governing elements & attributes in the XML document

10 Slide 10 DCD Framework n Referring to Elements –DCD declarations constrain the content & attributes of elements in document instances –done by assigning properties to objects of type ElementDef –Elements may have other elements as children, or have attributes provided with certain names and properties –Child elements must be collected together into Groups which have Order and Occurs properties –Each ElementDef must have a unique Type property within the DCD

11 Slide 11 DCD Framework n Referring to Elements –attributes & elements referred to in a particular DCD may come from the same DCD or from other DCDs identified by namespaces –if element definition comes from another namespace, the value of the Type property may be a qualified name, where the prefix identifies the namespace

12 Slide 12 Sample DCD Code: Namespace n Element definition comes from another namespace FirstName, MI and LastName are defined elsewhere in the DCD but Address comes from a namespace declared with a common prefix FirstName MI LastName common:Address

13 Slide 13 DCD Framework n Referring to Attributes –Attributes are defined in DCDs using objects of type AttributeDef –Attribute property occur on its own as a property of the DCD, or occur within an element definition –Global property whose value may be True or False (default) If value of Global property True, the name property must be unique in the DCD –Global attributes can be referred to by their names in any element definition within the DCD

14 Slide 14 Sample DCD Code: Global Attributes Hidden is a global attribute in the DCD, while schemas:CLASS is a global attribute from another namespace Hidden schemas:CLASS

15 Slide 15 DCD Vocabulary n Properties Which Apply to DCDs –AttributeDef declares an attribute type which may be provided for one or more elements in such documents property does not assert that the attribute is provided for any individual element type –Description provides a presumably human-readable description of the semantics and usage of this DCD Value of this property must match the Content under the XML specification

16 Slide 16 DCD Vocabulary n Properties Which Apply to DCDs –InternalEntityDef & ExternalEntityDef identify an entity which may be invoked via reference within such documents value of these properties must be a Node (in RDF terms) resource which is the property value must be identified by the class mechanism as an InternalEntityDef or ExternalEntityDef –Contents signals where elements of types not explicitly declared via ElementDef properties may appear in such documents value of property must be a string whose value is Open or Closed

17 Slide 17 DCD Vocabulary n Properties Which Apply to DCDs –Namespace provides the namespace of DCD value of this property must be a URI which identifies a namespace this property is required to exist for every DCD applies to all elements & attributes attached by properties to the DCD about HTML http://www.w3.org/TR/REC-html40

18 Slide 18 DCD Vocabulary n Properties Which Apply to Element Definitions –Attribute & AttributeDef identifies attributes which may be provided for elements of this type no element definition may have two Attribute or AttributeDef properties referencing attributes that have the same name –Contents signals whether elements of types not explicitly declared via the Group property may appear as children of elements of this type value of this property must be a string whose value is Open or Closed

19 Slide 19 DCD Vocabulary n Properties Which Apply to Element Definitions –Datatype identifies a specific datatype which constrains the content of elements of this type value of property must be a string which matches one of an enumerated list of datatypes property is only meaningful if the value of the Model property is Data

20 Slide 20 DCD Vocabulary n Properties Which Apply to Element Definitions –Default & Fixed provides default values for the content of elements of this type signals whether any value other than the default is allowed value of default property must be a string only allowed values of the Fixed property are the strings True & False default property is only meaningful if value of the Model property is Data

21 Slide 21 DCD Vocabulary n Properties Which Apply to Element Definitions –Description provides presumably human-readable description of semantics and usage of elements of this type value of property must match production labeled Content in the XML specification

22 Slide 22 DCD Vocabulary n Properties Which Apply to Element Definitions –Groups, Occurs & Order an ElementDef whose Model property has the value Elements must also have a single property named Group, containing specification of the elements and groups which can appear as children of elements of this type Occurs can take one of 4 values –Required (occurs exactly once)… default value –Optional (occurs zero or only once) –OneOrMore (occurs one or more times) –ZeroOrMore (occurs zero or more times) Order –Seq (children must occur in specified order… default value) –Alt (only one of specified children may appear)

23 Slide 23 DCD Vocabulary n Properties Which Apply to Element Definitions –Max, Min, MaxExclusive, MinExclusive provide upper & lower bounds on the content of elements of this type Max and Min allow values upto and including the bound MaxExclusive and MinExclusive allow value less than and greater than the bound, respectively properties are only meaningful if value of Model property is Data –Model indicates which of 5 broad classes of constraints apply to the content of elements of this type value of this property must be a string whose value is one of Empty, Any, Data*, Elements, or Mixed (*default)

24 Slide 24 DCD Vocabulary n Properties Which Apply to Element Definitions –Root element definitions can have a root property that indicates whether an element of that type can serve as the root of a conforming document allowed values are True and False (default) –Type gives the type of the element property required for every Element resource in DCD may not contain a prefix or a colon

25 Slide 25 DCD Vocabulary n Properties Which Apply to Attribute Definitions –Global indicates whether name property of this attribute must be unique in the DCD can serve as an address for this attribute definition possible values are True and False (default) –ID-Role signals that attribute has unique identifier or unique ID pointer semantics value of property must be a string whose value is one of ID, IDREF, or IDREFS

26 Slide 26 DCD Vocabulary n Properties Which Apply to Attribute Definitions –Name gives name of the attribute property required for every Attribute resource in DCD may not contain a prefix or a colon –Occurs indicates whether the presence of the Attribute is required can take one of two values –Required –Optional

27 Slide 27 DCD Vocabulary n Properties Which Apply to Internal Entity Definitions –Name name by which the entity may be invoked property is required for every InternalEntity definition resource in DCD –Value provides replacement text for the internal entity value of this property must match the production labeled Content in the XML specification may contain markup and is well-formed

28 Slide 28 DCD Vocabulary n Properties Which Apply to External Entity Definitions –Name name by which the entity may be invoked required to be present for every ExternalEntity definition resource in DCD –PublicID provides a public identifier for the entity a string with syntax and semantics similar to XML specifications –SystemID provides system identifier for the entity must be provided for every ExternalEntity resource in DCD

29 Slide 29 Datatypes n Datatype Specifications –modeled after datatypes supported by SQL & other modern programming languages –purpose specify maximum values on certain datatypes specify syntax to constrain value of particular element/attribute within these maximum values specify acceptable formats for specification of such datatypes –referenced from datatype namespace –some require additional properties to be specified

30 Slide 30 Datatypes n Datatypes in Instances –provides benefit of datatype support to well- formed documents that may not have an associated DTD or DCD –XML parsers expected to provide assistance in encoding & decoding these datatypes

31 Slide 31 Datatypes n Picture Constraints –picture is an alphanumeric string consisting of character symbols –each symbol usually one character –may be two characters –can be used to constrain format of strings –in some cases control their conversion to numbers

32 Slide 32 Examples : Picture Constraints n Used to constrain the format of strings & in some cases control their conversion to numbers A A single alphabetic character. B A single blank character. E The character E, used to indicate floating point numbers. S The leftmost character of a picture indicating a signed number. The characters "+” or "-" may appear in the S position. V An implied decimal sign. The input 1234 validated by a picture 99V99 is converted into 12.34. X Any character. Z The leftmost leading numeric character that can be replaced by a space character when the content of that content position is a zero. 9 Any numeric character. 1 Any boolean character (0 or 1). 0,/,-,., and, Represent themselves. cs The currency symbol.

33 Slide 33 Examples : Picture Constraints n Used to constrain the format of strings & in some cases control their conversion to numbers $123,45.90 satisfies picture $999,99.99 $123,45.90 satisfies picture XXXX,XX.XX 123-45-5678 satisfies picture 999-99-9999 (Social Security Number) 24E80 satisfies picture 99E99 (floating point) 23.45 satisfies picture 99.99 2345 satisfies picture 99V99 (translates to 23.45)

34 Slide 34 Conclusion n Future Work –DCD’s full potential –requests from database community –several types of constraints required beyond those described Subclassing and Inheritance Database Interface The &-Connector

35 Slide 35 References n Document Content Description for XML –http://www.w3.org/TR/NOTE-dcdhttp://www.w3.org/TR/NOTE-dcd n Namespaces in XML –http://www.w3.org/TR/REC-xml-names/http://www.w3.org/TR/REC-xml-names/ n Resource Description Framework Model & Syntax Specification –http://www.w3.org/TR/PR-rdf-syntax/http://www.w3.org/TR/PR-rdf-syntax/


Download ppt "Document Content Description for XML, Version 1.0 By Tim Bray, Charles Frankston and Ashok Malhotra EECS 684 Presentation by Calvin Ang."

Similar presentations


Ads by Google