SlideShare a Scribd company logo
1 of 31
Download to read offline
CenitHub
Chapter 3
Translators
Translators
A translator defines a logic for data manipulation.
Data manipulation can occurs in the following scenarios:
₋ Importing outside data into Cenit
₋ Updating data already stored in Cenit
₋ Converting data already stored in Cenit
₋ Exporting data outside Cenit
Translators
Translate input data
into data types
records
Convert records
between data
types
Update data type
records
Translate data type
records into
outgoing data
Import Translators
Import translators create data type
records from outside data.
The target data type defines the
type of the records to be created.
If no target data type is defined then
the translator is supposed to be able
to import data into any data type.
The logic of an import translator is
described in ruby style
Import Translators: target data type
Import translators create data type
records from outside data.
The target data type defines the
type of the records to be created.
If no target data type is defined then
the translator is supposed to be able
to import data into any data type.
The logic of an import translator is
described in ruby style
Import Translators: ruby style
Import translators create data type
records from outside data.
The target data type defines the
type of the records to be created.
If no target data type is defined then
the translator is supposed to be able
to import data into any data type.
The logic of an import translator is
described in ruby style
Import Translators: ruby style
The translator transformation is written in a DSL based on the Ruby
Programming Language.
The variables data and target_data_type are available and represent
the outside data and the target data type respectively.
A simple JSON importer can be defined by the following transformation:
Import Translators: ruby style
A little more of transformation code allows to parse the outside data and to
create multiple records:
Import Translators: ruby style
There are several methods available on the target data type object that can be
invoked to create records. They all have the following pattern:
(create|new)_from_(json|xml|edi)[!]
Example: create_from_xml, new_from_edi
The new methods does not persist the created record an a further invocation
of a save method is needed.
The create methods attempt to persist the records, halting on error only if
the method name ends with the exclamation symbol.
Import Translators: ruby style
The following transformation parse a data using Nokogiri and creates one or
multiple records from XML document elements:
Export Translators
Export translators format data type
records into data going outside
Cenit.
The source data type defines the
type of the records to be formatted.
If no source data type is defined then
the translator is supposed to be able
to format records of any data type.
A MIME type can be optionally
defined.
Export Translators
Export translators format data type
records into data going outside
Cenit.
The source data type defines the
type of the records to be formatted.
If no source data type is defined then
the translator is supposed to be able
to format records of any data type.
A MIME type can be optionally
defined.
Export Translators
Export translators format data type
records into data going outside
Cenit.
The source data type defines the
type of the records to be formatted.
If no source data type is defined then
the translator is supposed to be able
to format records of any data type.
A MIME type can be optionally
defined.
Export Translators: ruby style
The translator transformation can be written in ruby style.
Depending on the translator having the option bulk source, the variable
source or sources is available representing a single record or an
enumeration of records to be formatted.
A simple non bulkable JSON exporter can be defined by the following
transformation:
Export Translators: ruby style
If the translator is bulkable a little more of transformation code is needed to
format all the source records into a single JSON data:
Note: the result of the translation execution is the value of the latest
evaluated expression.
Export Translators: ruby style
There are a set of predefined methods available on record objects that can be
used for basic formats:
to_(json|xml|edi)
Every formatter method can receive options, for example:
- source.to_json(pretty: true)
- source.to_xml(with_blanks: true)
- source.to_edi(field_separator: ‘+’)
Export Translators: ruby style
The variable source_data_type is a reference to the translator source
data type and for facility a method to_xml_array have been added to
records enumeration, so a transformation for bulkable XML exporter can be
written as following:
Export Translators: XSLT style
The logic of an export translator can
be described as an XML Stylesheet
transformation.
XSLT style translators are no
bulkable.
Cenit convert the source record to
XML format if necessary and the
applies the XSLT transformation.
Export Translators: XSLT style
The following XSLT transformation changes the value of every attribute with
name email by sample@mail.com:
Update Translators
Update translators update data type
records.
The target data type defines the
type of the records to be updated.
If no target data type is defined then
the translator is supposed to be able
to update records of any data type.
The logic of an import translator is
described in ruby style.
Update Translators
Update translators update data type
records.
The target data type defines the
type of the records to be updated.
If no target data type is defined then
the translator is supposed to be able
to update records of any data type.
The logic of an import translator is
described in ruby style.
Update Translators
Update translators update data type
records.
The target data type defines the
type of the records to be updated.
If no target data type is defined then
the translator is supposed to be able
to update records of any data type.
The logic of an import translator is
described in ruby style.
Update Translators: ruby style
Update translators are non bulkable so they are applied to a single target
record which is available through the variable target:
Conversion Translators
Conversion translators transform
records into others.
The source and target data types
defines the records conversion
types.
The logic of an import translator can
be described in several format: ruby,
XSLT and chain.
Conversion Translators
Conversion translators transform
records into others.
The source and target data types
defines the records conversion
types.
The logic of an import translator can
be described in several format: ruby,
XSLT and chain.
Conversion Translators
Conversion translators transform
records into others.
The source and target data types
defines the records types.
The logic of an import translator can
be described in several format: ruby,
XSLT and chain.
Conversion Translators: ruby style
Conversion translators are non bulkable so they convert a record at the time.
The source and target records are available through the variables target
and source. Converting a costumer from a message would be as simple as:
Conversion Translators: XSLT style
Even if records are not stored in XML format an XSLT transformation is
possible for Cenit by the following steps:
1. Format the source record into XML if necessary.
2. Applies the XSLT transformation to the XML formatted record.
3. Create a target data from the transformed XML document.
Conversion Translators: chain style
Chain style convert records by
concatenating two conversion
translator:
⁻ The source exporter: convert the
source record to an intermediate
data type.
⁻ The target importer: convert the
intermediate record to the target
data type.
Conversion Translators: chain style
Chain style convert records by
concatenating two conversion
translator:
⁻ The source exporter: convert the
source record to an intermediate
data type.
⁻ The target importer: convert the
intermediate record to the target
data type.
CenitHub
Chapter 3
Translators

More Related Content

What's hot

File handling in vb.net
File handling in vb.netFile handling in vb.net
File handling in vb.netEverywhere
 
FILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUS
FILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUSFILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUS
FILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUSVenugopalavarma Raja
 
Basic xml syntax
Basic xml syntaxBasic xml syntax
Basic xml syntaxRaghu nath
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLyht4ever
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLPrabu U
 
Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definitionyht4ever
 
Deletion of a Record from a File - K Karun
Deletion of a Record from a File - K KarunDeletion of a Record from a File - K Karun
Deletion of a Record from a File - K KarunDipayan Sarkar
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsdUmar Ali
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structureBaskarkncet
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLKumar
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD OverviewPradeep Rapolu
 

What's hot (20)

uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Dtd
DtdDtd
Dtd
 
DTD
DTDDTD
DTD
 
Basic XML
Basic XMLBasic XML
Basic XML
 
File handling in vb.net
File handling in vb.netFile handling in vb.net
File handling in vb.net
 
FILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUS
FILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUSFILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUS
FILE HANDLING IN C++. +2 COMPUTER SCIENCE CBSE AND STATE SYLLABUS
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Basic xml syntax
Basic xml syntaxBasic xml syntax
Basic xml syntax
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml dtd
Xml dtdXml dtd
Xml dtd
 
Json1
Json1Json1
Json1
 
Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definition
 
Deletion of a Record from a File - K Karun
Deletion of a Record from a File - K KarunDeletion of a Record from a File - K Karun
Deletion of a Record from a File - K Karun
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsd
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Xml
XmlXml
Xml
 

Similar to CenitHub Presentations | 3- Translator

47468272 introduction-to-informatica
47468272 introduction-to-informatica47468272 introduction-to-informatica
47468272 introduction-to-informaticaVenkat485
 
Web Services Part 1
Web Services Part 1Web Services Part 1
Web Services Part 1patinijava
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12Dev Chauhan
 
CenitHub Presentations | 4- Flows, Connections & Webhooks
CenitHub Presentations | 4- Flows, Connections & WebhooksCenitHub Presentations | 4- Flows, Connections & Webhooks
CenitHub Presentations | 4- Flows, Connections & WebhooksMiguel Sancho
 
Mapping Data Types In Python.pptx
Mapping Data Types In Python.pptxMapping Data Types In Python.pptx
Mapping Data Types In Python.pptxAnveshbandalla
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...IndicThreads
 
chapter Two Server-side Script lang.pptx
chapter  Two Server-side Script lang.pptxchapter  Two Server-side Script lang.pptx
chapter Two Server-side Script lang.pptxalehegn9
 
DITA and Translation Best Praticices
DITA and Translation Best PraticicesDITA and Translation Best Praticices
DITA and Translation Best PraticicesAndrzej Zydroń MBCS
 
Golang proto buff_ixxo
Golang proto buff_ixxoGolang proto buff_ixxo
Golang proto buff_ixxowww.ixxo.io
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)Dilawar Khan
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 
Metadata Extraction and Content Transformation
Metadata Extraction and Content TransformationMetadata Extraction and Content Transformation
Metadata Extraction and Content TransformationAlfresco Software
 
CenitHub: Introduction
CenitHub: Introduction CenitHub: Introduction
CenitHub: Introduction Miguel Sancho
 
What is Data Types and Functions?
What is Data Types and Functions?What is Data Types and Functions?
What is Data Types and Functions?AnuragSrivastava272
 
XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7Deniz Kılınç
 

Similar to CenitHub Presentations | 3- Translator (20)

47468272 introduction-to-informatica
47468272 introduction-to-informatica47468272 introduction-to-informatica
47468272 introduction-to-informatica
 
Web Services Part 1
Web Services Part 1Web Services Part 1
Web Services Part 1
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12
 
CenitHub Presentations | 4- Flows, Connections & Webhooks
CenitHub Presentations | 4- Flows, Connections & WebhooksCenitHub Presentations | 4- Flows, Connections & Webhooks
CenitHub Presentations | 4- Flows, Connections & Webhooks
 
Linq
LinqLinq
Linq
 
Mapping Data Types In Python.pptx
Mapping Data Types In Python.pptxMapping Data Types In Python.pptx
Mapping Data Types In Python.pptx
 
Moses
MosesMoses
Moses
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
chapter Two Server-side Script lang.pptx
chapter  Two Server-side Script lang.pptxchapter  Two Server-side Script lang.pptx
chapter Two Server-side Script lang.pptx
 
DITA and Translation Best Praticices
DITA and Translation Best PraticicesDITA and Translation Best Praticices
DITA and Translation Best Praticices
 
Golang proto buff_ixxo
Golang proto buff_ixxoGolang proto buff_ixxo
Golang proto buff_ixxo
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Metadata Extraction and Content Transformation
Metadata Extraction and Content TransformationMetadata Extraction and Content Transformation
Metadata Extraction and Content Transformation
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
CenitHub: Introduction
CenitHub: Introduction CenitHub: Introduction
CenitHub: Introduction
 
What is Data Types and Functions?
What is Data Types and Functions?What is Data Types and Functions?
What is Data Types and Functions?
 
XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
 
Tibco business works
Tibco business worksTibco business works
Tibco business works
 

More from Miguel Sancho

Cenit IO - API Economy
Cenit IO - API EconomyCenit IO - API Economy
Cenit IO - API EconomyMiguel Sancho
 
CenitHub Presentations | 5- Collections & Sharing
CenitHub Presentations | 5- Collections & SharingCenitHub Presentations | 5- Collections & Sharing
CenitHub Presentations | 5- Collections & SharingMiguel Sancho
 
CenitHub Presentations | 2- Libraries, Schemas & Data Types
CenitHub Presentations | 2- Libraries, Schemas & Data TypesCenitHub Presentations | 2- Libraries, Schemas & Data Types
CenitHub Presentations | 2- Libraries, Schemas & Data TypesMiguel Sancho
 
CenitHub Presentations | 1- Overview
CenitHub Presentations | 1- OverviewCenitHub Presentations | 1- Overview
CenitHub Presentations | 1- OverviewMiguel Sancho
 
SpreeConf OpenJAF presentation
SpreeConf OpenJAF presentationSpreeConf OpenJAF presentation
SpreeConf OpenJAF presentationMiguel Sancho
 
Spree Travel: Open Travel Marketplace Framework
Spree Travel: Open Travel Marketplace FrameworkSpree Travel: Open Travel Marketplace Framework
Spree Travel: Open Travel Marketplace FrameworkMiguel Sancho
 
Geométria computacional: Polígonos y-monótonos
Geométria computacional:   Polígonos y-monótonosGeométria computacional:   Polígonos y-monótonos
Geométria computacional: Polígonos y-monótonosMiguel Sancho
 
Geometría computacional: Doubly Connected Edge List (DCEL)
Geometría computacional: Doubly Connected Edge List (DCEL)Geometría computacional: Doubly Connected Edge List (DCEL)
Geometría computacional: Doubly Connected Edge List (DCEL)Miguel Sancho
 
Geometría computacional solapamiento de subdivisiones
Geometría computacional   solapamiento de subdivisionesGeometría computacional   solapamiento de subdivisiones
Geometría computacional solapamiento de subdivisionesMiguel Sancho
 
Geometría Computacional: Interseccción de segmentos
Geometría Computacional: Interseccción de segmentosGeometría Computacional: Interseccción de segmentos
Geometría Computacional: Interseccción de segmentosMiguel Sancho
 
Geometría Computacional: Objetos y problemas básicos
Geometría Computacional: Objetos y problemas básicosGeometría Computacional: Objetos y problemas básicos
Geometría Computacional: Objetos y problemas básicosMiguel Sancho
 
Geometría Computacional: Envoltura Convexa
Geometría Computacional: Envoltura ConvexaGeometría Computacional: Envoltura Convexa
Geometría Computacional: Envoltura ConvexaMiguel Sancho
 
Introducción a Geometría Computacional
Introducción a  Geometría ComputacionalIntroducción a  Geometría Computacional
Introducción a Geometría ComputacionalMiguel Sancho
 

More from Miguel Sancho (15)

Cenit IO | Strategy
Cenit IO | StrategyCenit IO | Strategy
Cenit IO | Strategy
 
Cenit IO - API Economy
Cenit IO - API EconomyCenit IO - API Economy
Cenit IO - API Economy
 
CenitHub 101
CenitHub 101CenitHub 101
CenitHub 101
 
CenitHub Presentations | 5- Collections & Sharing
CenitHub Presentations | 5- Collections & SharingCenitHub Presentations | 5- Collections & Sharing
CenitHub Presentations | 5- Collections & Sharing
 
CenitHub Presentations | 2- Libraries, Schemas & Data Types
CenitHub Presentations | 2- Libraries, Schemas & Data TypesCenitHub Presentations | 2- Libraries, Schemas & Data Types
CenitHub Presentations | 2- Libraries, Schemas & Data Types
 
CenitHub Presentations | 1- Overview
CenitHub Presentations | 1- OverviewCenitHub Presentations | 1- Overview
CenitHub Presentations | 1- Overview
 
SpreeConf OpenJAF presentation
SpreeConf OpenJAF presentationSpreeConf OpenJAF presentation
SpreeConf OpenJAF presentation
 
Spree Travel: Open Travel Marketplace Framework
Spree Travel: Open Travel Marketplace FrameworkSpree Travel: Open Travel Marketplace Framework
Spree Travel: Open Travel Marketplace Framework
 
Geométria computacional: Polígonos y-monótonos
Geométria computacional:   Polígonos y-monótonosGeométria computacional:   Polígonos y-monótonos
Geométria computacional: Polígonos y-monótonos
 
Geometría computacional: Doubly Connected Edge List (DCEL)
Geometría computacional: Doubly Connected Edge List (DCEL)Geometría computacional: Doubly Connected Edge List (DCEL)
Geometría computacional: Doubly Connected Edge List (DCEL)
 
Geometría computacional solapamiento de subdivisiones
Geometría computacional   solapamiento de subdivisionesGeometría computacional   solapamiento de subdivisiones
Geometría computacional solapamiento de subdivisiones
 
Geometría Computacional: Interseccción de segmentos
Geometría Computacional: Interseccción de segmentosGeometría Computacional: Interseccción de segmentos
Geometría Computacional: Interseccción de segmentos
 
Geometría Computacional: Objetos y problemas básicos
Geometría Computacional: Objetos y problemas básicosGeometría Computacional: Objetos y problemas básicos
Geometría Computacional: Objetos y problemas básicos
 
Geometría Computacional: Envoltura Convexa
Geometría Computacional: Envoltura ConvexaGeometría Computacional: Envoltura Convexa
Geometría Computacional: Envoltura Convexa
 
Introducción a Geometría Computacional
Introducción a  Geometría ComputacionalIntroducción a  Geometría Computacional
Introducción a Geometría Computacional
 

Recently uploaded

Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...limedy534
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanMYRABACSAFRA2
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...ssuserf63bd7
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryJeremy Anderson
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...GQ Research
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxBoston Institute of Analytics
 
Machine learning classification ppt.ppt
Machine learning classification  ppt.pptMachine learning classification  ppt.ppt
Machine learning classification ppt.pptamreenkhanum0307
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxMike Bennett
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 

Recently uploaded (20)

Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population Mean
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data Story
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
Biometric Authentication: The Evolution, Applications, Benefits and Challenge...
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
 
Machine learning classification ppt.ppt
Machine learning classification  ppt.pptMachine learning classification  ppt.ppt
Machine learning classification ppt.ppt
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptx
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 

CenitHub Presentations | 3- Translator

  • 2. Translators A translator defines a logic for data manipulation. Data manipulation can occurs in the following scenarios: ₋ Importing outside data into Cenit ₋ Updating data already stored in Cenit ₋ Converting data already stored in Cenit ₋ Exporting data outside Cenit
  • 3. Translators Translate input data into data types records Convert records between data types Update data type records Translate data type records into outgoing data
  • 4. Import Translators Import translators create data type records from outside data. The target data type defines the type of the records to be created. If no target data type is defined then the translator is supposed to be able to import data into any data type. The logic of an import translator is described in ruby style
  • 5. Import Translators: target data type Import translators create data type records from outside data. The target data type defines the type of the records to be created. If no target data type is defined then the translator is supposed to be able to import data into any data type. The logic of an import translator is described in ruby style
  • 6. Import Translators: ruby style Import translators create data type records from outside data. The target data type defines the type of the records to be created. If no target data type is defined then the translator is supposed to be able to import data into any data type. The logic of an import translator is described in ruby style
  • 7. Import Translators: ruby style The translator transformation is written in a DSL based on the Ruby Programming Language. The variables data and target_data_type are available and represent the outside data and the target data type respectively. A simple JSON importer can be defined by the following transformation:
  • 8. Import Translators: ruby style A little more of transformation code allows to parse the outside data and to create multiple records:
  • 9. Import Translators: ruby style There are several methods available on the target data type object that can be invoked to create records. They all have the following pattern: (create|new)_from_(json|xml|edi)[!] Example: create_from_xml, new_from_edi The new methods does not persist the created record an a further invocation of a save method is needed. The create methods attempt to persist the records, halting on error only if the method name ends with the exclamation symbol.
  • 10. Import Translators: ruby style The following transformation parse a data using Nokogiri and creates one or multiple records from XML document elements:
  • 11. Export Translators Export translators format data type records into data going outside Cenit. The source data type defines the type of the records to be formatted. If no source data type is defined then the translator is supposed to be able to format records of any data type. A MIME type can be optionally defined.
  • 12. Export Translators Export translators format data type records into data going outside Cenit. The source data type defines the type of the records to be formatted. If no source data type is defined then the translator is supposed to be able to format records of any data type. A MIME type can be optionally defined.
  • 13. Export Translators Export translators format data type records into data going outside Cenit. The source data type defines the type of the records to be formatted. If no source data type is defined then the translator is supposed to be able to format records of any data type. A MIME type can be optionally defined.
  • 14. Export Translators: ruby style The translator transformation can be written in ruby style. Depending on the translator having the option bulk source, the variable source or sources is available representing a single record or an enumeration of records to be formatted. A simple non bulkable JSON exporter can be defined by the following transformation:
  • 15. Export Translators: ruby style If the translator is bulkable a little more of transformation code is needed to format all the source records into a single JSON data: Note: the result of the translation execution is the value of the latest evaluated expression.
  • 16. Export Translators: ruby style There are a set of predefined methods available on record objects that can be used for basic formats: to_(json|xml|edi) Every formatter method can receive options, for example: - source.to_json(pretty: true) - source.to_xml(with_blanks: true) - source.to_edi(field_separator: ‘+’)
  • 17. Export Translators: ruby style The variable source_data_type is a reference to the translator source data type and for facility a method to_xml_array have been added to records enumeration, so a transformation for bulkable XML exporter can be written as following:
  • 18. Export Translators: XSLT style The logic of an export translator can be described as an XML Stylesheet transformation. XSLT style translators are no bulkable. Cenit convert the source record to XML format if necessary and the applies the XSLT transformation.
  • 19. Export Translators: XSLT style The following XSLT transformation changes the value of every attribute with name email by sample@mail.com:
  • 20. Update Translators Update translators update data type records. The target data type defines the type of the records to be updated. If no target data type is defined then the translator is supposed to be able to update records of any data type. The logic of an import translator is described in ruby style.
  • 21. Update Translators Update translators update data type records. The target data type defines the type of the records to be updated. If no target data type is defined then the translator is supposed to be able to update records of any data type. The logic of an import translator is described in ruby style.
  • 22. Update Translators Update translators update data type records. The target data type defines the type of the records to be updated. If no target data type is defined then the translator is supposed to be able to update records of any data type. The logic of an import translator is described in ruby style.
  • 23. Update Translators: ruby style Update translators are non bulkable so they are applied to a single target record which is available through the variable target:
  • 24. Conversion Translators Conversion translators transform records into others. The source and target data types defines the records conversion types. The logic of an import translator can be described in several format: ruby, XSLT and chain.
  • 25. Conversion Translators Conversion translators transform records into others. The source and target data types defines the records conversion types. The logic of an import translator can be described in several format: ruby, XSLT and chain.
  • 26. Conversion Translators Conversion translators transform records into others. The source and target data types defines the records types. The logic of an import translator can be described in several format: ruby, XSLT and chain.
  • 27. Conversion Translators: ruby style Conversion translators are non bulkable so they convert a record at the time. The source and target records are available through the variables target and source. Converting a costumer from a message would be as simple as:
  • 28. Conversion Translators: XSLT style Even if records are not stored in XML format an XSLT transformation is possible for Cenit by the following steps: 1. Format the source record into XML if necessary. 2. Applies the XSLT transformation to the XML formatted record. 3. Create a target data from the transformed XML document.
  • 29. Conversion Translators: chain style Chain style convert records by concatenating two conversion translator: ⁻ The source exporter: convert the source record to an intermediate data type. ⁻ The target importer: convert the intermediate record to the target data type.
  • 30. Conversion Translators: chain style Chain style convert records by concatenating two conversion translator: ⁻ The source exporter: convert the source record to an intermediate data type. ⁻ The target importer: convert the intermediate record to the target data type.