Beyond Schemas - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Beyond Schemas

Description:

Provide extensibility for schema languages, similar to libraries in programming languages. Schema language and ... SAF per se is the XML syntax for adjuncts ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 37
Provided by: jonatha262
Category:
Tags: beyond | perse | schemas

less

Transcript and Presenter's Notes

Title: Beyond Schemas


1
Beyond Schemas
  • Extending Schemas with the Schema Adjunct
    Framework

Scott Vorthmann, Extensibility Jonathan Robie,
Software AG
2
Extending Schemas
  • Goals
  • Provide extensibility for schema languages,
    similar to libraries in programming languages
  • Schema language and programming language
    independence
  • Allow extensions to the data associated with
    types declared in schema languages
  • Allow processing to use this data in a
    language-independent way

3
DTDs associate, validate
ltcustomergt ltcustNamegt lt/custNamegt
4
DTDs associate, validate
lt!ELEMENT customer (name , shippingAddress ,
bi lt!ELEMENT name (PCDATA)gt
ltcustomergt ltcustNamegt lt/custNamegt
5
DTDs associate, validate
lt!ELEMENT customer (name , shippingAddress ,
bi lt!ELEMENT name (PCDATA)gt
ltcustomergt ltcustNamegt lt/custNamegt
6
Java associate, validate
checkCreditRating(n)
ltcustomergt ltcustNamegt lt/custNamegt
7
Query associate, validate
empty ( FROM d IN //deadbeats,
c IN this WHERE d/name
this/name RETURN d )
ltcustomergt ltcustNamegt lt/custNamegt
8
DTDs associate, enhance
lt!ELEMENT collection (item )gt lt!ATTLIST
collection ordered (true
false ) 'true' duplicates
(allowed prohibited ) 'allowed' gt
ltcollectiongt ltitemgt Hi Mom! lt/itemgt
ltitemgt Hi Dad! ltitem /gt lt/collectiongt
9
DTDs associate, enhance
lt!ELEMENT collection (item )gt lt!ATTLIST
collection ordered (true
false ) 'true' duplicates
(allowed prohibited ) 'allowed' gt
ltcollection orderedfalse duplicatesallowed
gt ltitemgt Hi Mom! lt/itemgt
ltitemgt Hi Dad! ltitem /gt lt/collectiongt
10
Schemas associate, enhance
ltelement name "person"gt
ltcomplexType content "elementOnlygt
ltsequencegt ltelement ref "name"/gt
ltelement ref "iq"/gt
ltelement ref "gender"/gt
lt/sequencegt lt/complexTypegt
lt/elementgt ltsimpleType name "iq" base
"decimal"/gt
11
Schemas associate, enhance
ltpersongt ltnamegtAlexander B. Poindexterlt/namegt
ltiqgt53lt/iqgt ltgendergtMalelt/gendergt lt/persongt
12
Schemas associate, enhance
ltsimpleType name "iq" base "decimal"/gt
ltpersongt ltnamegtAlexander B. Poindexterlt/namegt
ltiqgt53lt/iqgt ltgendergtMalelt/gendergt lt/persongt
Basedecimal!
13
Whats not in a schema language?
  • Database mappings?
  • Algorithmic validation?
  • Indexing strategies?
  • Data bindings to OO systems?
  • Does it ever stop?
  • Data types?
  • Input masks?
  • Boundary conditions?
  • Uniqueness constraints?
  • Primary/foreign keys?
  • Inheritance models?
  • Co-occurrence constraints?

14
In fact, just yesterday...
  • Makoto MURATA, Relaxer
  • Name mapping XML lt--gt Java
  • Specifying alternative mappings (e.g. choosing
    which container type)
  • Identifying the location of earlier versions of
    definitions

15
Schema Adjunct Framework
  • Associate data with XML node types
  • Data is represented in any language
  • The processor for this language may be
  • Known in advance, (or)
  • Identified by means of a namespace

16
Adjuncts and Associations
ltschema-adjunct target"http//www.example.com/pat
-admit.xdr" xmlnssto
"http//www.example.com/xml-store.xsd"gt ltelement
which 'admission'gt ltstorootable/gt
ltstoindexgttextlt/stoindexgt lt/elementgt
lt/schema-adjunctgt
17
Associations
ltschema-adjunct target"http//www.example.com/pat
-admit.xdr" xmlnssto
"http//www.example.com/xml-store.xsd"gt ltelement
which 'admission'gt ltstorootable/gt
ltstoindexgttextlt/stoindexgt lt/elementgt
lt/schema-adjunctgt
lt?xml version"1.0"?gt ltSchema name"pat-admit.xdr
"gt ltElementType name"admission"
content"eltOnly" order"seq"gt ltAttributeType
name"id" dttype"string" required"yes /gt
ltattribute type"id"/gt ltelement
type"patient-name"/gt ltelement
type"age"/gt lt/ElementTypegt lt/Schemagt
18
Associations
ltschema-adjunct target"http//www.example.com/pat
-admit.xdr" xmlnssto
"http//www.example.com/xml-store.xsd"gt ltelement
which 'admission'gt ltstorootable/gt
ltstoindexgttextlt/stoindexgt lt/elementgt
lt/schema-adjunctgt
Isnt this a lot like XSLT?
19
SAF Implementations
  • SAF is declarative, and language independent
  • SAF per se is the XML syntax for adjuncts
  • Supporting SAF associations is usually just one
    function
  • Further support may exist for
  • loading and managing adjuncts
  • finding a processor that understands an adjunct

20
SAF Implementations
  • DOM
  • NodeList assoc sa.getAssociations(node)
  • XSLT
  • lttemplate matchassociations(index)gt
  • SAX
  • extending the events

21
Schema Adjunct Framework
  • an XML format for stating schema-specific,
    task-specific meta-data
  • alternative viewpoints
  • extend schemas with task-specific meta-data
  • OR
  • parameterize tasks with schema-specific meta-data

22
Schema Adjunct Syntax
  • ltschema-adjunct targettarget NS URI
    xmlnsprocprocessor NS URIgt
  • ltdocumentgt
  • ltprocglobal-meta-data/gt
  • lt/documentgt
  • ltelement whichelement1/element2gt
  • ltprocsome-meta-data/gt
  • lt/elementgt
  • ltattribute whichelement3/_at_attr1gt
  • ltprocmore-meta-data/gt
  • lt/attributegt
  • lt!-- more element and attribute associations --gt
  • lt/schema-adjunctgt

23
Schema Lock-in
XML PO
PO persist
DB
24
Schema-generic Processing
Schema Adjunct
XML instance
generic persist
DB
25
Schema Adjunct Processors
Schema Adjunct
Schema
XML instance
adjunct processor
...
26
Enabling Processing per-Schema
persist
route
compile
...
validate
analyze
transform
purchase order
invoice
HR record
catalog
config file
tax return
...
27
Example Form Generation
Schema Adjunct
XML instance
form generator
HTML form
28
Example Form Generation
  • ltschema-adjunct targetpat-admit.xdr
    xmlnsxfgxmlformgen.xsdgt
  • ltelement whichadmissiongt
  • ltxfgform nameadmit-form/gt
  • lt/elementgt
  • ltattribute whichpatient/_at_namegt
  • ltxfglabelgtPatient Namelt/xfglabelgt
  • ltxfgtypegttextlt/xfgtypegt
  • ltxfgtaggtpatnmlt/xfgtaggt
  • lt/attributegt
  • lt/schema-adjunctgt

29
Schema with Embedded Adjunct
  • ltSchema name "pat-admit.xdr
    xmlnsxfgxmlformgen.xsdgt
  • ltElementType name admission" content
    "eltOnly
  • order "seq" xfgformtrue"gt
  • ltelement type patient"/gt
  • ltelement type "home"/gt
  • lt/ElementTypegt
  • ltElementType name patient" content
    "textOnly"gt
  • ltAttributeType namename dttypestring
  • xfglabelPatient Name xfgtypetext
    xfgtagpatnm/gt
  • ltattribute typename/gt
  • lt/ElementTypegt
  • lt/Schemagt

30
Example Extended Validation
Schema Adjunct
Schema
XML instance
standard validation
extended validation
...
31
Example Extended Validation
  • ltschema-adjunct targetinvoice.xdr
    xmlnsxvalmorevalid.xsdgt
  • ltdocumentgt
  • ltxvalfunc namecheckZip signature...
  • class... codebase.../gt
  • lt/documentgt
  • ltelement whichmailto/addressgt
  • ltxvaltest langxpath level5gt
  • checkZip( _at_zip, _at_city, _at_state ) 0
  • lt/xvaltestgt
  • lt/elementgt
  • lt/schema-adjunctgt

32
Example Indexes in XDR
  • ltschema-adjunct target "http//www.example.com/p
    at-admit.xsd"
  • xmlnssto "http//www.example.c
    om/xml-store.xsd"gt
  • ltelement which 'admission'gt
  • ltstorootable/gt
  • ltstoindexgttextlt/stoindexgt
  • lt/elementgt
  • ltelement which 'patient-name'gt
  • ltstoindexgtstandardlt/stoindexgt
  • lt/elementgt
  • lt/schema-adjunctgt

33
Example Indexes in XDR
  • Adds index definition to XDR
  • Defined at the schema / data dictionary level,
    with no instance documents
  • Instance documents are indexed by the database
    when stored
  • Tight integration of two commercial products -
    with no shared code
  • Libraries of Schema Adjuncts

34
Summary
Schema Adjunct
Schema
XML instance
adjunct processor
...
35
Summary
persist
route
forms
...
validate
extend
transform
purchase order
invoice
HR record
catalog
config file
tax return
...
36
For More Information
  • SAF toolkit freely available
  • http//www.extensibility.com/saf
  • Currently DOM with Associations
  • Next release adds SAX
  • Specification is now being revised
  • you heard the latest here!
Write a Comment
User Comments (0)
About PowerShow.com