12341234 Translation of PWG Semantic Model to CWMP Data model Sanjeev K Feb 3, 2012.
-
Upload
alexander-bradshaw -
Category
Documents
-
view
215 -
download
0
Transcript of 12341234 Translation of PWG Semantic Model to CWMP Data model Sanjeev K Feb 3, 2012.
1234
Translation of PWG Semantic Translation of PWG Semantic Model to CWMP Data modelModel to CWMP Data model
Sanjeev KFeb 3, 2012
1234
ContentsContents
• Objective
• PWG SM print service schema dependency
• Approach
• Over-all flow chart
• Parsing PWG SM schema
• Control files
• Naming algorithm
• Implementation
• Output
• Issues
1234
ObjectiveObjective
• To translate the PWG Semantic Model to CWMP data model. – Defining the rules for translating data types
and elements of PWG SM into CWMP data types and objects.
– Conversion of hierarchy.
– Optimize object naming.
1234
PWG SM print service PWG SM print service schemaschema
Hierarchy to be translated.
1234
ApproachApproach
• The translation is achieved in the following steps.– Data type translation rules and naming rules are
defined in control files.– PWG SM XSD files are parsed to list all elements
and its data types.– Names of the elements are optimized based on
rules or algorithm.– In the list, the elements which are of simple type
are converted to parameters and their data types are translated to CWMP data type.
– Elements which are of complex type are converted to objects.
– Redundancy in the hierarchy is removed by applying custom rules.
1234
Over-all flowOver-all flow
Start
Parse XSD files
Create list of elements and its
types
Create object
Create parameter
Add to the parent object
Simple
type ?
Yes
NoNext
element exist
No
Yes
Stop
1234
Parsing PWG SM schemaParsing PWG SM schema
1234
Control filesControl files
•Translation_rules.txt
•Naming_Optimize.txt
• Translation rules:Example:–string-->string–boolean-->boolean–NMTOKEN-->string–NMTOKENS-->string–int-->int
• Naming rules:Example:–PrintServiceCapabilities-->Capabilities–PrintDocumentTicketCapabilities-->DocumentTicketCapabilities–PrintDocumentDescriptionCapabilities-->DocumentDescriptionCapabilities–PrintDocumentProcessingCapabilities-->DocumentProcessingCapabilities–PrintJobDescriptionCapabilities-->JobDescriptionCapabilities
1234
Naming algorithmNaming algorithm
1. Divide the element name into sub strings.2. Discard the substring if it is found in its parent object name.3. Repeat step 2 for all the substrings except the last substring.4. Add the result to the name.
Example: PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilities.DocumentFormatDetailsSupplied.AllowedValue.{i}.DocumentFormat PrintServices.Service.{i}.Capabilities.DocumentTicketCapabilities.DescriptionCapabilities.FormatDetailsSupplied.AllowedValue.{i}.Format
1234
ImplementationImplementation
•Library used: libxml2-2.7.1
•Source code: – ‘TranslationDM.c’,
– ‘TranslationDM.h’,
– ‘Utility.c’
1234
OutputOutput
• Translation_element_list.txt
• CWMP_DataModel.xmlTranslation_element_list.txt
Element:1 PrintServicesElement:2 PrintServices.PrintService.{i}Element:3 PrintServices.PrintService.{i}.PrintServiceCapabilitiesElement:4 PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilitiesElement:5 PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilitiesElement:6 PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilities.DocumentDigitalSignatureElement:7 PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilities.DocumentDigitalSignature.AllowedValue.{i}Element:8 PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilities.DocumentMessageElement:9 PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilities.DocumentName
.
.
.
.
CWMP_DataModel.xml<?xml version="1.0" encoding="UTF-8"?><document> <model isService="true" name="PrintServices"><description>Write a description</description><object name="PrintServices." minEntries="1" maxEntries="1"><description>Write a description about object PrintServices</description></object><object name="PrintServices.PrintService.{i}." minEntries="0" maxEntries="unbounded" numEntriesParamter="NumberOfEntries"><description>Write a description about object PrintServices.PrintService.{i}</description></object><object name="PrintServices.PrintService.{i}.PrintServiceCapabilities." minEntries="0" maxEntries="1"><description>Write a description about object PrintServices.PrintService.{i}.PrintServiceCapabilities</description></object><object name="PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities." minEntries="0" maxEntries="1"><description>Write a description about object PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities</description></object><object name="PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilities." minEntries="0" maxEntries="1"><description>Write a description about object PrintServices.PrintService.{i}.PrintServiceCapabilities.PrintDocumentTicketCapabilities.PrintDocumentDescriptionCapabilities</description><parameter name="DocumentMessage" access="readonly" activeNotify="forceEnabled"><description>Write a description about parameter DocumentMessage</description><syntax><boolean></boolean></syntax></parameter><parameter name="DocumentName" access="readonly" activeNotify="forceEnabled"><description>Write a description about parameter DocumentName</description><syntax><boolean></boolean></syntax></parameter
.
.
.
.
1234
IssuesIssues
• The ‘access’ and ‘activeNotify’ attributes of parameters are hard coded.– <parameter name="DocumentMessage" access="readonly"
activeNotify="forceEnabled">– Attributes of the elements in the PWG SM is not included in the translation.
• Hierarchy optimization.– PrintServices.PrintService.{i}.PrintServiceConfiguration.Finishers.Finisher.
{i}.FinisherDescription
• Choice in complex type is pending-all the child elements are included in the current model.
• Union member types are assumed as either string or NMTOKEN.– Translated to string.
1234
ConclusionConclusion
Verification of output and validating the data model with the CWMP data model schema completes the translation.
1234
11234234
www.celstream.com