Using DSDL plus annotations for Netconf (+) data modeling

Slides:



Advertisements
Similar presentations
BAH DAML Tools XML To DAML Query Relevance Assessor DAML XSLT Adapter.
Advertisements

XML Data Validation An Open QA Framework February 28, 2005 The Exchange Network Node Mentoring Workshop.
Data-centric XML Other Schema Languages Montag, 5. Juli 2010.
YANG Boot Camp The YANG Gang IETF 71. YANG Boot Camp The YANG Gang IETF 71.
Managing XML and Semistructured Data Lecture 12: XML Schema Prof. Dan Suciu Spring 2001.
ISO DSDL ISO – Document Schema Definition Languages (DSDL) Martin Bryan Convenor, JTC1/SC18 WG1.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
1 Dynamic DNS. 2 Module - Dynamic DNS ♦ Overview The domain names and IP addresses of hosts and the devices may change for many reasons. This module focuses.
SRDC Ltd. 1. Problem  Solutions  Various standardization efforts ◦ Document models addressing a broad range of requirements vs Industry Specific Document.
CSE 636 Data Integration XML Schema. 2 XML Schemas W3C Recommendation: Generalizes DTDs Uses XML syntax Two documents: structure.
XML Prashant Karmarkar Brendan Nolan Alexander Roda.
Sunday, June 28, 2015 Abdelali ZAHI : FALL 2003 : XML Schemas XML Schemas Presented By : Abdelali ZAHI Instructor : Dr H.Haddouti.
MTEI Methods & Tools for Enterprise Integration
NETMOD Architecture Phil Shafer IETF 72.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
IS432 Semi-Structured Data Lecture 3: XSchema Dr. Gamal Al-Shorbagy.
CIM and UML Overview Terry Saxton Xtensible Solutions
XML – Tools and Trends Schematron Tim Bornholtz Session 55.
November 1, 2006IU DLP Brown Bag : Fall Data Integrity and Document- centric XML Using Schematron for Managing Text Collections Dazhi Jiao, Tamara.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
Abierman-nanog-30may03 1 XML Router Configs BOF Operator Involvement Andy Bierman
© Hitachi, Ltd All rights reserved. NETCONF Configuration I/F Advertisement by WSDL and XSD Hideki Okita, Tomoyuki Iijima, Yoshifumi Atarashi, Ray.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Using DSDL plus annotations for Netconf (+) data modeling Rohan Mahy draft-mahy-canmod-dsdl-01.
SDPL 2005Notes 2.5: XML Schemas1 2.5 XML Schemas n Short introduction to XML Schema –W3C Recommendation, 1 st Ed. May, 2001; 2 nd Ed. Oct, 2004: »XML Schema.
An OO schema language for XML SOX W3C Note 30 July 1999.
YANG in a Nutshell The YANG Gang IETF 71. YANG has... A reasonable self-contained specification A focus on readers and reviewers Text-based , patch,
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
Schematron Tim Bornholtz. Schema languages Many people turn to schema languages when they want to be sure that an XML instance follows certain rules –DTD.
Kalua – A DML for NETCONF
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
® A Proposed UML Profile For EXPRESS David Price Seattle ISO STEP Meeting October 2004.
Representing Netconf Data Models using Document Schema Definition Languages (DSDL) Rohan Mahy Sharon Chisholm Lada Lhotka IETF 72 - Dublin.
QUALITY CONTROL WITH SCHEMAS CSC1310 Fall BASIS CONCEPTS SchemaSchema is a pass-or-fail test for document Schema is a minimum set of requirements.
Copyright 2004 John Cowan 1 Infinite Diversity in Infinite Combinations why one schema language is not enough John Cowan.
Doc.: IEEE /0169r0 Submission Joe Kwak (InterDigital) Slide 1 November 2010 Slide 1 Overview of Resource Description Framework (RFD/XML) Date:
Linux Operations and Administration
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name value pair;
Using DSDL plus annotations for Netconf (+) data modeling Rohan Mahy draft-mahy-canmod-dsdl-01.
Using XML Schema to define NETCONF Content Sharon Chisholm Alex Clemm TJ Tjong
Kalua DML Examples
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Netconf Schema Query Mark Scott IETF 70 Vancouver December 2007
YANG Background and Discussion: Why we need a new language for NETCONF configuration modeling The YANG Gang IETF 70 Vancouver, Canada.
Chapter 5. An IP address is simply a series of binary bits (ones and zeros). How many binary bits are used? 32.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
SDPL : XML Schemas1 2.5 XML Schemas n Short introduction to XML Schema –W3C Recommendation, 1 st Ed. May, 2001; 2 nd Ed. Oct, 2004: »XML Schema.
Netconf Notifications Sharon Chisholm Hector Trevino IETF 67 November 2006.
Standard Netconf Content Brainstorming on getting there IETF 70.
YANG Roque Gagliano.
Components.
Unit 4 Representing Web Data: XML
Infinite Diversity in Infinite Combinations
PANA Issues and Resolutions
The SUPA Information Model
XML QUESTIONS AND ANSWERS
XML in Web Technologies
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
NETCONF Configuration I/F Advertisement by WSDL and XSD
Chapter 7 Representing Web Data: XML
Henning Schulzrinne Dept. of Computer Science Columbia University
Information Systems Advisory Body GJXDM User Conference - June, 2005
PREMIS Tools and Services
NMDA Q & A draft-dsdt-nmda-guidelines &
An Introduction to Software Architecture
M2AP Methodology For Message Assembly Profile Improving traceability, reusability and instance interoperability in CIM XML message content schema design.
YANG Instance Data for Documenting Server Capabilities
Presentation transcript:

Using DSDL plus annotations for Netconf (+) data modeling Rohan Mahy rohan@ekabal.com draft-mahy-canmod-dsdl-01

What is DSDL? DSDL = Document Schema Data Languages http://dsdl.org An ISO family of standards DSDL uses a modular approach to schema languages Part 2 = Relax NG - traditional schema language: structure Part 3 = Schematron - rule based validation Part 4 = NVRL - validate parts of instance doc with different schemas/languages Part 5 = DataType Library Language etc … Annotations are encouraged as part of modularity My usage of “Data Model” A model for describing the semantics and syntax of (configuration and operational) data. Does not include verbs.

Why Relax NG for syntax? Easy to read and learn (Compact or XML) Used by W3C (XHTML, SVG, XML Sig, RDF) Better XML support than XSD: robust native support for XML namespaces unifies elements and attributes unordered content supported describes which pattern is root element Convertible to XSD Patterns can be scoped to prevent conflicts from one module

Schematron - rule-based validation Rule-based validation based on XPath expressions. Supports reusable abstract patterns Validation can be split in phases based on context Implementer can use a Schematron validator or write their own native code to perform an equivalent validation check. <pattern> <rule context="//dhcp:dhcp"> <assert test="dhcp:default-lease-time <= dhcp:max-lease-time"> Default lease time cannot be larger than maximum lease time </assert> </rule> </pattern>

Semantic Annotations Important annotations: keys to uniquely identify elements in a list define relational integrity constraints insure data is relevant to operation containing it These annotations can be implemented in native code on device or converted to additional Schematron rules by XSLT

Extensibility Relax NG has a nice pattern-based extensibility mechanism redefine patterns completely combine by choice combine by interleave Can include external grammars and keep scopes separate (ex: both dhcp.rnc and interfaces.rnc have an element-interface pattern) # config-root.rnc default namespace = "http://example.org/ns/root" start = element-config element-config = element config { external "interfaces.rnc" ? & external "dhcp+extensions.rnc" ? } # dhcp+extensions.rnc include "dhcp.rnc" # base module include "dhcp-tz.rnc" # timezone extension include "dhcp-wins.rnc" # WINS server ext # dhcp-tz.rnc namespace tz = "http://example.org/ns/dhcp/timezone" element-dhcp-option &= element tz:timezone { token }?

Met nearly all requirements in RCDML draft Met ALL Netconf-specific requirements (Section 3.1) Some highlighted unique features Compound keys / Deep keys <subnet> <prefix> <network>192.168.24.0</network> <prefix-length>24</prefix-length> </prefix> <range> <low>192.168.24.20</low> <high>192.168.24.250</high> </range> </subnet> Implementation Defaults Most defaults are valid per version of the schema. Formal validation w/ Schematron Can implement these rules via custom code from assert text, or automatically using a Schematron validator (free libraries in C++, Java, C and Python)

What’s nice about this approach Reuse of appropriate schema languages and tools is a good thing. Modular architecture makes incremental implementation/deployment and additional reuse easier (add other parts of DSDL, use subset of Netconf solution for another IETF protocol). Being able to add data model information for existing IETF schemas (LDAP-enabled directories, SIP phone config files, early Netconf users) is a good thing. Making Schematron available for formal machine-readable validation to clients that want it is a good thing.

Schema Plus vs. Model Plus approach Pure Semantics UML / XMI OWL (without a specific serialization) Semantics + some syntax (top down) Yang Kalua Schema + some semantics (bottom up) DSDL + annotations XSD + annotations

Semantics vs. Syntax dilemma Pure semantic approaches can represent things we cannot easily represent in Netconf or even in XML syntax Many to many relationships (graph vs tree) Top down approaches can constrain legitimately good syntax and blur semantics: element vs. attribute representation of terminal nodes not distinguishing semantically ordered content (sequence) from unordered content (bags) Bottom up approaches are not easily convertible to radically different syntax (ex: CLI, MIBs). Can't represent inheritance/classes natively, but can generate equivalent instance documents.

Upgrading schema to data model There are lots of XML-based schema in the wild (XSD and Relax NG). It seems very beneficial to be able to take an existing schema and turn it into a data model while maintaining backward syntax compatibility Folks who defined XSD for use with Netconf. Other IETF WGs that already defined syntax of their schema but want data modeling. Other schemas defined elsewhere that we want to import for Netconf.

Start with basic Relax NG start = element-dhcp element-dhcp = element dhcp { [ compat:documentation ["DHCP top level element"] ] element subnet { element network { ipv4-address-content }, element prefix-length { xsd:short { minInclusive = "0" maxInclusive = "32" } } element-range?, element leases { element-lease* }?, }* element-range = element range { element low { ipv4-address-content }, element high { ipv4-address-content } >> compat:documentation ["range of dynamic addresses"] element-lease = element lease { attribute ip-address { ipv4-address-content }, element starts { xsd:dateTime }, element ends { xsd:dateTime }, element mac-address { mac-address-content } Syntax describes hierarchy, cardinality, types, range and pattern restrictions Relax NG Compact and XML forms are 2-way convertible Add annotations: initial and following types

infoType used to validate that data is sent in an appropriate operation element-leases = element leases { element lease { attribute ip-address { ipv4-address-content }, element starts { xsd:dateTime }, element ends { xsd:dateTime }, element mac-address { mac-address-content } }* >> dml:infoType ["status"] } can be in a get can be in RPC ‘revoke-lease’ request revokeLeaseType = element revoke-lease { element address { ipv4-address-content }+ >> dml:infoType [ op="rpc/revoke-lease" "action"] } revokeLeaseResponseType = element result { ( "ok" | "no-such-lease" ) >> dml:infoType [ op="rpc-response#revoke-lease" "status"] } can be in RPC reply for a ‘revoke-lease’

Keys and Keyrefs element-subnet = element subnet { element network { ipv4-address-content }, element prefix-length { xsd:short { minInclusive = "0" maxInclusive = "32" } }, element interface-filter { element interface { xsd:token >> dml:keyref ["//int:interface"] }+ } element-interfaces = element int:interfaces { element int:interface { element int:ifIndex { xsd:token }, element int:ifType { xsd:token } >> dml:key ["int:ifIndex"] <config:config xmlns="http://example.org/ns/dhcp" xmlns:config="http://example.org/ns/config" xmlns:dhcp="http://example.org/ns/dhcp" xmlns:int="http://example.org/ns/int"> <dhcp> <subnet> <network>10.1.1.0</network> <prefix-length>24</prefix-length> <interface-filter> <interface>lo0</interface> <interface>en1</interface> </interface-filter> </subnet> </dhcp> <int:interfaces> <int:interface><int:ifIndex>lo0</int:ifIndex> </int:interface> <int:interface><int:ifIndex>en2</int:ifIndex> </int:interfaces> </config:config>

XSLT converts this to Schematron <pattern abstract="true" id="key"> <rule context="$context"> <assert test="count($context[$key=current()/$key])=1"> The key "$key" needs to be unique within the list at: $context </assert> </rule> </pattern> <pattern is-a="key" id="interface"> <param name="context" value="//int:interfaces/int:interface"/> <param name="key" value="int:key"/> <pattern abstract="true" id="keyref"> <rule context="$keyref-context"> <assert test="$key-context[$key=current()]"> The contents of "$keyref-context" must be a <name/> with the key "$key" in this context: $key-context. <pattern is-a="keyref"> <param name="keyref-context" value="//dhcp:interface-filter/dhcp:interface"/> <param name="key-context" value="//int:interfaces/int:interface"/> <param name="key" value="int:ifIndex"/>

start = element-dhcp element-dhcp = element dhcp { global-timer-elements, element-subnet*, element-shared-network* >> dc:title [ "Example schema for DHCP server" ] >> dml:version ["1.0"] >> dc:type ["Dataset"] >> dc:creator [ "Rohan Mahy" ] >> dml:organization [ "as an individual" ] >> dml:contact [ "mailto:rohan@ekabal.com" ] >> dc:created [ "2008-02-13" ] } global-timer-elements = ( element default-lease-time { xsd:unsignedInt >> compat:defaultValue ["3600"] >> dml:units ["s"] }?, element max-lease-time { xsd:unsignedInt >> dml:units ["s"] }? ) element-shared-network = element shared-network { attribute name { token }, element-subnet*

element-subnet = element subnet { element-network, element-prefix-length, element-range?, element-dhcp-options?, element max-lease-time { xsd:unsignedInt >> dml:units ["s"] >> dml:status ["deprecated"] }?, element leases { element-lease* >> dml:infoType ["status"] element-interface-filter? >> dml:key ["concat(network, '/', prefix-length)"] >> dml:manual-validation-rule [ "Verify that none of the subnets overlap with other subnets." ] } element-range = element range { element low { ipv4-address-content }?, element high { ipv4-address-content }? >> dml:existence [] "Verify the range is within the subnet." ]

element-dhcp-options = element dhcp-options { element-router-list-option? & element-domain-list-option? & element-custom-option* } element-lease = element lease { attribute ip-address { ipv4-address-content }, element starts { xsd:dateTime }, element ends { xsd:dateTime }, element mac-address { mac-address-content } >> dml:key ["@ip-address"] element-custom-option = element custom { attribute option { xsd:unsignedByte }, ( element ip-address { ipv4-address-content } | element string { string } ) >> dml:key ["@option"] element-interface-filter = element interface-filter { element-interface+ } element-interface = element interface { token >> dml:keyref ["//int:interface"]