[go: up one dir, main page]

WO2019039958A1 - Method of describing a composite data type - Google Patents

Method of describing a composite data type Download PDF

Info

Publication number
WO2019039958A1
WO2019039958A1 PCT/RU2017/000706 RU2017000706W WO2019039958A1 WO 2019039958 A1 WO2019039958 A1 WO 2019039958A1 RU 2017000706 W RU2017000706 W RU 2017000706W WO 2019039958 A1 WO2019039958 A1 WO 2019039958A1
Authority
WO
WIPO (PCT)
Prior art keywords
type
data type
description
data
composite data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/RU2017/000706
Other languages
French (fr)
Russian (ru)
Inventor
Константин Андреевич МАЛЫШЕВ
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Publication of WO2019039958A1 publication Critical patent/WO2019039958A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data

Definitions

  • the invention relates to data processing methods that are stored and transmitted in text format, and can be used to describe composite data types in information systems, including XML, JSON, YAML.
  • JavaScript is a multi-paradigm programming language.
  • JSON English JavaScript Object Notation
  • RFC 7159 JSON version of the RFC 7159 standard.
  • JSON Schema is one of the languages for describing the structure of a JSON document. This document uses the JSON Schema Draft 6 version.
  • XML English extensible Markup Language
  • This document uses the XML version 1.0.
  • XSD XML Schema
  • YAML (a recursive acronym for English: “Yet Another Markup Language” - “Another Markup Language”, later - “YAML Ain't Markup Language” - “YAML — not a Markup Language”) is a “friendly” data serialization format conceptually similar to markup languages, but focused on the convenience of input-output typical data structures of many programming languages. This document uses version YAML 1.1.
  • a complex (structured, composite) type is a data type whose objects (variable or constant) have an internal structure accessible to the programmer.
  • the closest analogue of the claimed invention is a technical solution from the patent application US 20140067866.
  • the method determines whether the object specified in JavaScript (JSON) object notation corresponds to the JSON scheme, and the scheme contains an object containing properties containing an array of one or more pairs name values.
  • JSON JavaScript
  • the technical problem that the claimed invention addresses is to create a new way of describing composite data types, on the basis of which it would be possible to create fundamentally new languages for describing composite data types that could surpass the existing analogues mentioned above and which would not have the above disadvantages.
  • the technical result of the claimed invention is to simplify and reduce the time to develop a description of a composite data type while increasing usability by increasing the efficiency of perception by developers.
  • This technical result is achieved due to the fact that in the method of describing a composite data type for a minimal description of a composite data type, an example of this type of data is used, the rules for interpreting the presence or absence of an example data element of this type 5 in the description of a composite data type are determined, the rules for implementing extensions descriptions of the data type in the description of the composite data type, extend the minimum description of the composite data type by embedding it in the minimum description the composite data type of additional elements according to the previously defined rules for introducing data type description extensions into the description of the composite data type and determine the rules for interpreting the extensions of the description of the composite data type.
  • the method can additionally check the correctness of the data for compliance with the description of the composite data type.
  • the method can display error messages in the data to be checked 15 and / or tips on eliminating errors in the data being checked.
  • the method can create electronic documentation on a composite data type.
  • the method can visually highlight the syntactic constructs describing the composite data type.
  • an example data type can be generated based on the description of the composite data type.
  • the core for describing a composite data type is an example of data of this type, i.e. in the extreme case, the example of the data type itself is the minimum description of this data type. Additional specification 25 data type descriptions are introduced into the same example using service fields.
  • the inventive method allows you to create languages describing composite data types that can significantly simplify the work of a software developer to create, study, use and change zo descriptions of composite data types compared to existing similar languages. This is achieved due to the fact that the description of the data type is easily created by the developer, i.e. it is enough to write an example of the data and, if necessary, add clarifications. In addition, the description of the type of data is quickly perceived by the developer, i.e. when looking at sample data developer quickly
  • the invention is particularly useful in the development of the following types of computing systems: distributed network applications and data storage systems.
  • the claimed invention is illustrated using the figure, which shows a block diagram of the method.
  • the method is as follows.
  • the essence of the invention is to use the sample data of some composite data type as the basis for the description of this data type.
  • the rule of interpreting presence may sound like this: “If some type of field is present in the sample data, this should be interpreted so that this field is not mandatory in the described data type, but if this field is present, then the type of this field must strictly correspond the type of this field in the sample data ".
  • the rule of missing interpretation may sound like this: “If there is no some type of field in the sample data, then such a field cannot be present in the data of the described data type.” Applying the described rules to the above For example, we can say the following about this data type: “The data of the described data type“ may ”contain a field“ pat ”of type string, also they“ may ”contain a field of“ salary ”of type number. Other data fields of this data type can not ". These rules can be formulated somewhat differently, depending on the implementation of a specific data type description language.
  • the inventive method involves the introduction of data specifying service fields into the data sample, which differ from the data fields of the data by a special conventional designation. For example, if it is necessary to indicate in the given example that the "name" field is mandatory, then write so:
  • the "@@ required" field is a service one and is intended to specify the fields that are required in this data type.
  • Service descriptive fields in the claimed method can describe: the data type of the field, for example, “string” or “logical” or “any type”; restrictions on the value of the field, for example, “integer in the range from 0 to 100" or “string length not more than 100 characters”;
  • the correctness of the data is checked for compliance with the description of the composite data type.
  • the software verifies the correctness of the data using algorithms that are a technical implementation in one of the algorithmic programming languages of certain rules for interpreting the presence or absence of data in an example of a data type, rules for implementing data type description extensions, rules for interpreting data type description extensions. The meanings of these rules have been described above.
  • the software has a graphical user interface that displays error messages in the data to be checked and / or tips for eliminating errors in the data being checked, and also visually highlights the syntax for describing the composite data type and generates an example of the data type based on the description of the composite type. data.
  • rules for interpreting the presence or absence of an element of sample data of this type in the description of a composite data type create electronic documentation on the composite data type.
  • the root element of this data type may be an object, which may include the name field, which may be of the string type.
  • the root element is of the type “object”, which may include the element “stale” of the type "line”.
  • the programmer also sees in front of him a real example of data of this data type.
  • the vision of the example allows the programmer to better understand the purpose of the data and, accordingly, to quickly understand the data structure.
  • the author of a description of a data type may wish to indicate that the element “pate” in the example given is a required element of the root object.
  • the root element has the type “object”, which should include the element “pat” of the type “string”, no longer than 20 characters.
  • This data type contains the “type” field - the type of the figure and “size” - the size of the figure, and the structure of the “size of the figure” field depends on the type of the figure. For example, if figure 15 is a rectangle, then the data example might look like this:
  • the data type is “girl”, which has three fields: “isBeautiful” (beautiful), “isMarried” (married) and “phoneNumber” (phone number).
  • the “isBeautiful” and “isMarried” fields are always obligatory, and the “phoneNumber” field is mandatory only if the girl is beautiful and not married. This means that the obligatory “phoneNumber” field depends on specific values in the “isBeautiful” and “isMarried” fields.
  • An example of using calculated expressions in describing the data type “girl” looks like this: ⁇
  • the data type contains a field whose name corresponds to the designation of service fields adopted in this language.
  • the technology of "shielding" characters For example, it can be agreed that the initial character of the string “@”, which is used in these examples to denote service fields, can be escaped with the symbol “!”. That is, the sequence of characters "! @" At the beginning of the field name will mean that this is not a service field, but a regular field that starts with the "@" symbol. For example, if required in the data type to enter the field "@name”, then it will look like this: "! @name”. And then the entire description of the data type may look like this:
  • the initial “!” Symbol itself can also be escaped, which in this case also became official. That is, for example, if they want to enter a field with the name “! @Name” in the data type, then in the description of the data type, the first character “!” Must be escaped, so that:
  • Such a technique can solve any problems associated with the need to distinguish when the service characters have a service value, and when their own value.
  • ⁇ _name regex "[ A ⁇ t]"/>
  • the symbol “_” is used to denote service fields as the service symbol, since the XML specification does not allow the “@” symbol to be used at the beginning of the element name.
  • str pattern [A-Za-z1-9] + / required: yes
  • datetime required [email, salary, login]
  • the symbol “_” is used to denote service fields as a service symbol, since the YAML language specification does not allow the use of the symbol “@” at the beginning of the element name.
  • the basis is the same language in which data of a specified data type will be formed.
  • a description will be created in JSON. This requirement is not mandatory, but when this requirement is fulfilled, the developer gets additional convenience when working with the description of the data type and examples of this type of data when they are compiled in one language.
  • Expansion of the description of the data type is carried out by introducing into the minimum description of the data type of additional elements according to certain predetermined rules for writing extensions of the description of the data type.
  • - elements of extensions should be easily visually different from elements related to the minimum description of the data type (in this example, for JSON, they all begin with the “@” symbol); - extension elements must be entered in such a way that it is visually easy to determine which element of the minimum description of the data type they belong to; in this example, they have the same nesting level and have a similar name, for example, the @login extension element refers to the login element.
  • the inventive method of describing data types has the same capabilities as traditional methods of describing data types, such as JSON-Schema, XSD, Kwalify, etc.
  • the inventive method of describing data types is easily created by man and quickly perceived by man.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to methods of processing data that is stored and transmitted in text format, and can be used for describing composite data types in information systems, which are stored or transmitted in text format, including XML, JSON, YAML. The technical result of the claimed invention is that of simplifying the description of a composite data type and reducing the development time thereof, while increasing ease of use by increasing intelligibility to developers. In a method of describing a composite data type an example of data of the type in question is used for a minimal description of the composite data type. Then rules for interpreting the presence or absence of an element of the example of data of the type in question in the description of the composite data type are defined separately. Rules for introducing expansions of the description of the data type into the description of the composite data type are defined. The minimal description of the composite data type is expanded by introducing additional elements into the minimal description of the composite data type according to the rules defined for introducing expansions of the description of the data type into the description of the composite data type, and rules for interpreting expansions of the description of the composite data type are defined.

Description

СПОСОБ ОПИСАНИЯ СОСТАВНОГО ТИПА ДАННЫХ Изобретение относится к способам обработки данных, которые хранятся и передаются в текстовом формате, и может быть использовано для описания составных типов данных в информационных системах, в том числе, XML, JSON, YAML.  METHOD FOR DESCRIPTION OF COMPOSITE TYPE OF DATA The invention relates to data processing methods that are stored and transmitted in text format, and can be used to describe composite data types in information systems, including XML, JSON, YAML.

В описании использованы следующие термины и сокращения,  The following terms and abbreviations are used in the description.

JavaScript— мультипарадигменный язык программирования.  JavaScript is a multi-paradigm programming language.

JSON (англ. JavaScript Object Notation) — текстовый формат обмена данными, основанный на JavaScript. В данном документе используется версия JSON по стандарту RFC 7159.  JSON (English JavaScript Object Notation) is a text-based data exchange format based on JavaScript. This document uses the JSON version of the RFC 7159 standard.

JSON Schema— один из языков описания структуры JSON-документа. В данном документе используется версия JSON Schema Draft 6.  JSON Schema is one of the languages for describing the structure of a JSON document. This document uses the JSON Schema Draft 6 version.

Kwalify— это синтаксический анализатор, валидатор схемы и инструмент привязки данных для YAML и JSON. В данном документе используется версия Kwalify 0.7.2.  Kwalify is a parser, schema validator, and data binding tool for YAML and JSON. This document uses version Kwalify 0.7.2.

XML (англ. extensible Markup Language)— расширяемый язык разметки. В данном документе используется версия XML 1.0.  XML (English extensible Markup Language) is an extensible markup language. This document uses the XML version 1.0.

XSD (XML Schema)— язык описания структуры XML-документа. В данном документе используется версия XSD 1.0.  XSD (XML Schema) is a language for describing the structure of an XML document. This document uses version XSD 1.0.

YAML (рекурсивный акроним англ. «Yet Another Markup Language»— «Ещё один язык разметки», позже— англ. «YAML Ain't Markup Language»— «YAML— не язык разметки») — «дружественный» формат сериализации данных, концептуально близкий к языкам разметки, но ориентированный на удобство ввода-вывода типичных структур данных многих языков программирования. В данном документе используется версия YAML 1.1.  YAML (a recursive acronym for English: “Yet Another Markup Language” - “Another Markup Language”, later - “YAML Ain't Markup Language” - “YAML — not a Markup Language”) is a “friendly” data serialization format conceptually similar to markup languages, but focused on the convenience of input-output typical data structures of many programming languages. This document uses version YAML 1.1.

Сложный (структурированный, составной) тип — тип данных, объекты (переменные или постоянные) которого имеют внутреннюю структуру, доступную программисту.  A complex (structured, composite) type is a data type whose objects (variable or constant) have an internal structure accessible to the programmer.

В настоящее время в информационных технологиях широко используются текстовые форматы передачи и хранения структурированных (составных) данных, например XML, JSON, YAML. При работе с этими данными постоянно возникает необходимость решать следующие задачи: валидация данных (проверка данных на соответствие определенному типу); автоматическое создание документации на типы данных и автоматическая генерация программного кода для работы с определенным типом данных. Для решения этих задач необходимо формально описывать составные типы данных. Currently, information technologies are widely used text formats for the transfer and storage of structured (composite) data, such as XML, JSON, YAML. When working with this data, it is constantly necessary to solve the following tasks: data validation (data verification for compliance with a particular type); automatic creation of documentation for data types and automatic generation of program code for working with a specific data type. To solve these problems it is necessary to formally describe the composite data types.

Известны несколько языков для описания составных типов данных. Самые популярные из них: XSD, JSON-Schema, Kwalify.  Several languages are known for describing composite data types. The most popular of them: XSD, JSON-Schema, Kwalify.

Наиболее близким аналогом заявляемого изобретения является техническое решение из патентной заявки US 20140067866. В способе определяют, соответствует ли объект, указанный в JavaScript (JSON) объектной нотации, схеме JSON, при этом схема содержит объект, содержащий свойства, содержащие массив из одной или нескольких пар значений имени.  The closest analogue of the claimed invention is a technical solution from the patent application US 20140067866. The method determines whether the object specified in JavaScript (JSON) object notation corresponds to the JSON scheme, and the scheme contains an object containing properties containing an array of one or more pairs name values.

Однако для указанных выше языков описания составных типов данных получаются достаточно громоздкими и требуют относительно много времени для их разработки. Кроме того, полученные описания составных типов данных тяжело и медленно воспринимаются разработчиками.  However, for the above languages, descriptions of composite data types are rather cumbersome and relatively time consuming to develop. In addition, the resulting descriptions of composite data types are hard and slowly perceived by developers.

Описанные недостатки обусловлены тем, что указанные языки ориентированы на описание сложных типов данных. Поэтому они обладают большой гибкостью, в результате которой синтаксис этих языков становится слишком громоздким.  The described drawbacks are due to the fact that these languages are focused on the description of complex data types. Therefore, they have great flexibility, as a result of which the syntax of these languages becomes too cumbersome.

Между тем, последние несколько лет в мире наблюдаются тенденции к использованию достаточно простых структур данных в информационных системах. Чем проще структуры, тем проще вникать разработчикам в программы, тем проще искать ошибки. Этим, кстати, обусловлена возросшая популярность языка JSON по сравнению с языком XML. Язык JSON менее гибкий, чем XML, зато гораздо более наглядный.  Meanwhile, the last few years in the world there are trends towards the use of fairly simple data structures in information systems. The simpler the structure, the easier it is for developers to delve into the program, the easier it is to look for errors. This, by the way, is due to the increased popularity of the JSON language as compared to the XML language. JSON is less flexible than XML, but much more visual.

Техническая проблема, на решение которой направлено заявляемое изобретение, заключается в создании нового способа описания составных типов данных, на базе которого можно было бы создать принципиально новые языки описания составных типов данных, которые могли бы превзойти существующие аналоги, указанные выше, и которые не имели бы указанных выше недостатков.  The technical problem that the claimed invention addresses is to create a new way of describing composite data types, on the basis of which it would be possible to create fundamentally new languages for describing composite data types that could surpass the existing analogues mentioned above and which would not have the above disadvantages.

Техническим результатом заявляемого изобретения является упрощение и сокращение времени на разработку описания составного типа данных при повышении удобства пользования за счёт повышения эффективности восприятия разработчиками. Указанный технический результат достигается за счёт того, что в способе описания составного типа данных для минимального описания составного типа данных используют пример данных этого типа, отдельно определяют правила интерпретации присутствия или отсутствия элемента примера данных этого типа 5 в описании составного типа данных, определяют правила внедрения расширений описания типа данных в описание составного типа данных, осуществляют расширение минимального описания составного типа данных за счёт внедрения в минимальное описание составного типа данных дополнительных элементов по определённым ранее правилам внедрения расширений описания типа данных в ю описание составного типа данных и определяют правила интерпретации расширений описания составного типа данных. The technical result of the claimed invention is to simplify and reduce the time to develop a description of a composite data type while increasing usability by increasing the efficiency of perception by developers. This technical result is achieved due to the fact that in the method of describing a composite data type for a minimal description of a composite data type, an example of this type of data is used, the rules for interpreting the presence or absence of an example data element of this type 5 in the description of a composite data type are determined, the rules for implementing extensions descriptions of the data type in the description of the composite data type, extend the minimum description of the composite data type by embedding it in the minimum description the composite data type of additional elements according to the previously defined rules for introducing data type description extensions into the description of the composite data type and determine the rules for interpreting the extensions of the description of the composite data type.

В способе могут дополнительно проверять корректность данных на соответствие описанию составного типа данных.  The method can additionally check the correctness of the data for compliance with the description of the composite data type.

В способе могут отображать сообщения об ошибках в проверяемых данных 15 и/или советы по устранению ошибок в проверяемых данных.  The method can display error messages in the data to be checked 15 and / or tips on eliminating errors in the data being checked.

В способе могут создавать электронную документацию на составной тип данных.  The method can create electronic documentation on a composite data type.

В способе могут визуально выделять синтаксические конструкции описания составного типа данных.  The method can visually highlight the syntactic constructs describing the composite data type.

20 В способе могут генерировать пример типа данных на основе описания составного типа данных. 20 In the method, an example data type can be generated based on the description of the composite data type.

Ядром для описания составного типа данных является пример данных этого типа, т.е. в предельном случае пример типа данных сам по себе является минимальным описанием этого типа данных. Дополнительные уточняющие 25 описания типа данных вводят в этот же самый пример с помощью служебных полей.  The core for describing a composite data type is an example of data of this type, i.e. in the extreme case, the example of the data type itself is the minimum description of this data type. Additional specification 25 data type descriptions are introduced into the same example using service fields.

Заявляемый способ позволяет создавать языки описания составных типов данных, которые способны значительно упростить работу разработчика программного обеспечения по созданию, изучению, использованию и изменению зо описаний составных типов данных по сравнению с существующими подобными языками. Это достигается за счёт того, что описание типа данных легко создается разработчиком, т.е. достаточно написать пример данных и, если нужно, добавить уточнения. Кроме того, описание типа данных быстро воспринимается разработчиком, т.е. при взгляде на пример данных разработчик быстро The inventive method allows you to create languages describing composite data types that can significantly simplify the work of a software developer to create, study, use and change zo descriptions of composite data types compared to existing similar languages. This is achieved due to the fact that the description of the data type is easily created by the developer, i.e. it is enough to write an example of the data and, if necessary, add clarifications. In addition, the description of the type of data is quickly perceived by the developer, i.e. when looking at sample data developer quickly

35 интуитивно усваивает структуру этого типа данных, при дальнейшем анализе описательных служебных полей он быстро усваивает особенности типа данных. Описание типа данных легко преобразовать в валидный пример типа данных, который может быть использован в разработке. Для этого достаточно удалить из описания типа данных служебные поля. Визуальное выделение синтаксических конструкций в текстовом редакторе позволяет значительно ускорить процесс усвоения типа данных разработчиком, например, поля примера данных можно подсветить, а служебные поля затушевать. 35 intuitively assimilates the structure of this data type, with further analysis descriptive utility fields, he quickly learns the characteristics of the data type. The data type description is easily converted to a valid data type example that can be used in development. To do this, it is enough to remove service fields from the data type description. The visual highlighting of syntactic structures in a text editor allows you to significantly speed up the process of mastering the data type by the developer, for example, you can highlight the sample data fields and obscure the service fields.

Изобретение особенно полезно при разработке следующих типов вычислительных систем: распределенных сетевых приложений и систем хранения данных.  The invention is particularly useful in the development of the following types of computing systems: distributed network applications and data storage systems.

Заявляемое изобретение проиллюстрировано с помощью фигуры, на которой изображена блок-схема способа.  The claimed invention is illustrated using the figure, which shows a block diagram of the method.

Способ осуществляют следующим образом.  The method is as follows.

Суть изобретения заключается в том, чтобы использовать пример данных некоторого составного типа данных в качестве основания для описания этого типа данных.  The essence of the invention is to use the sample data of some composite data type as the basis for the description of this data type.

Основанием для этого является тот факт, что пример данных какого-то типа очевидным образом так или иначе описывает этот тип данных. Например, следующие данные (на языке JSON):  The reason for this is the fact that the sample data of some type in an obvious way somehow describes this data type. For example, the following data (in JSON language):

{  {

"name": "Петров Иван",  "name": "Petrov Ivan",

"salary": 200.0  "salary": 200.0

}  }

очевидным образом говорят о том, что соответствующий тип данных содержит поле "name" типа string и поле "salary" типа number. Obviously, they say that the corresponding data type contains the field "name" of type string and the field "salary" of type number.

Затем отдельно определяют правила интерпретации присутствия или отсутствия элемента примера данных этого типа в описании составного типа данных. Например, правило интерпретации присутствия может звучать так: «Если в примере данных присутствует некоторое поле некоторого типа, то это следует интерпретировать так, что в описываемом типе данных это поле не является обязательным, но если это поле присутствует, то тип этого поля должен строго соответствовать типу этого поля в примере данных». Правило интерпретации отсутствия может звучать так: «Если в примере данных отсутствует некоторое поле некоторого типа, то такое поле не может присутствовать в данных описываемого типа данных». Применяя описанные правила к вышеприведенному примеру, можно сказать про этот тип данных следующее: «Данные описанного типа данных «могут» содержать поле «пате» типа string, также они «могут» содержать поле «salary» типа number. Других полей данные этого типа данных содержать не могут». Эти правила могут быть сформулированы несколько иначе, в зависимости от реализации конкретного языка описания типа данных. Then separately determine the rules for interpreting the presence or absence of an element of an example of data of this type in the description of the composite data type. For example, the rule of interpreting presence may sound like this: “If some type of field is present in the sample data, this should be interpreted so that this field is not mandatory in the described data type, but if this field is present, then the type of this field must strictly correspond the type of this field in the sample data ". The rule of missing interpretation may sound like this: “If there is no some type of field in the sample data, then such a field cannot be present in the data of the described data type.” Applying the described rules to the above For example, we can say the following about this data type: “The data of the described data type“ may ”contain a field“ pat ”of type string, also they“ may ”contain a field of“ salary ”of type number. Other data fields of this data type can not ". These rules can be formulated somewhat differently, depending on the implementation of a specific data type description language.

Определяют правила внедрения расширений описания типа данных в описание составного типа данных путем введения служебных полей, снабжённых условными обозначениями.  Determine the rules for the introduction of extensions of the description of the data type in the description of the composite data type by the introduction of service fields, equipped with symbols.

Осуществляют расширение минимального описания составного типа данных за счёт внедрения в минимальное описание составного типа данных дополнительных элементов по уже определённым правилам внедрения расширений описания типа данных в описание составного типа данных.  Expand the minimum description of a composite data type by introducing additional elements into the minimum description of a composite data type according to the rules already defined for introducing data type description extensions into the description of a composite data type.

Ввиду того, что пример данных описывает не все характеристики соответствующего типа данных, заявляемый способ предполагает введение в пример данных уточняющих служебных полей, которые отличаются от полей примера данных специальным условленным обозначением. Например, если необходимо в приведенном примере указать, что поле "name" является обязательным, то пишут так:  Due to the fact that the data example does not describe all the characteristics of the corresponding data type, the inventive method involves the introduction of data specifying service fields into the data sample, which differ from the data fields of the data by a special conventional designation. For example, if it is necessary to indicate in the given example that the "name" field is mandatory, then write so:

{  {

"name": "Петров Иван",  "name": "Petrov Ivan",

"salary": 200.0,  "salary": 200.0,

"@@required": ["name"]  "@@ required": ["name"]

}  }

В данном примере поле "@@required" является служебным и предназначено для указания полей, которые являются обязательными в данном типе данных.  In this example, the "@@ required" field is a service one and is intended to specify the fields that are required in this data type.

Подобным образом можно вводить в описание типа данных любое количество служебных полей, которые будут отражать разнообразные характеристики описываемого типа данных. В данном примере поле "@@required" начинается с двух символов "@@", что обозначает, что это поле является служебным.  Similarly, you can enter in the description of the data type any number of service fields that will reflect the various characteristics of the described data type. In this example, the "@@ required" field begins with two characters "@@", which means that this field is official.

Служебные описательные поля в заявляемом способе могут описывать: тип данных поля, например, «строка» или «логический» или «любой тип»; ограничения на значение поля, например, «целое в диапазоне от 0 до 100» или «длина строки не более 100 символов»; Service descriptive fields in the claimed method can describe: the data type of the field, for example, "string" or "logical" or "any type"; restrictions on the value of the field, for example, "integer in the range from 0 to 100" or "string length not more than 100 characters";

обязательность поля;  required field;

варианты типов данных значения поля, если значение поля может быть представлено данными разных типов;  variants of data types of the field value, if the field value can be represented by data of different types;

любые другие правила, которым должны соответствовать данные указанного типа;  any other rules that must comply with the data of the specified type;

текстовый комментарий к полю;  text comment to the field;

текстовый комментарий ко всему типу данных;  text commentary to the entire data type;

· любые другие способы документирования типа данных.  · Any other ways of documenting the data type.

В описаниях полей могут быть использованы вычисляемые выражения.  In the field descriptions can be used calculated expressions.

После определяют правила интерпретации расширений описания составного типа данных. Например, одно из правил может звучать так: «Расширение описания служебного типа данных, которое вводится служебным полем "@@required", содержащим в качестве значения массив элементов типа string, следует интерпретировать следующим образом: все поля описываемого типа данных, имена которых совпадают с одной из строк массива строк поля "@@required", являются обязательными в описываемом типе данных».  After determine the rules for interpreting the extension description of the composite data type. For example, one of the rules might sound like this: “The extension of the description of the service data type, which is entered by the service field" @@ required ", containing as its value an array of elements of type string, should be interpreted as follows: all fields of the described data type, whose names coincide with one of the strings in the array of strings of the "@@ required" field are mandatory in the described data type ".

В способе, реализованном с помощью программного обеспечения, проверяют корректность данных на соответствие описанию составного типа данных. Программное обеспечение проверяет корректность данных с помощью алгоритмов, которые являются технической реализацией на одном из алгоритмических языков программирования определенных правил интерпретации присутствия или отсутствия данных в примере типа данных, правил внедрения расширений описания типа данных, правил интерпретации расширений описания типа данных. Смыслы этих правил были описаны выше. Для удобства пользования программное обеспечение снабжено графическим пользовательским интерфейсом, с помощью которого отображают сообщения об ошибках в проверяемых данных и/или советы по устранению ошибок в проверяемых данных, а также визуально выделяют синтаксис описания составного типа данных и генерируют пример типа данных на основе описания составного типа данных.  In a method implemented using software, the correctness of the data is checked for compliance with the description of the composite data type. The software verifies the correctness of the data using algorithms that are a technical implementation in one of the algorithmic programming languages of certain rules for interpreting the presence or absence of data in an example of a data type, rules for implementing data type description extensions, rules for interpreting data type description extensions. The meanings of these rules have been described above. For convenience, the software has a graphical user interface that displays error messages in the data to be checked and / or tips for eliminating errors in the data being checked, and also visually highlights the syntax for describing the composite data type and generates an example of the data type based on the description of the composite type. data.

Для удобства пользования на основе правил интерпретации присутствия или отсутствия элемента примера данных этого типа в описании составного типа данных, правил внедрения расширений описания и правил интерпретации б расширений описания создают электронную документацию на составной тип данных. For convenience, based on the rules for interpreting the presence or absence of an element of sample data of this type in the description of a composite data type, rules for implementing description extensions, and rules for interpreting b description extensions create electronic documentation on the composite data type.

Примеры реализации.  Examples of implementation.

На примере типа данных на языке JSON  On the example of the data type in JSON

{ {

"name": "John"  "name": "John"

} Об этом типе данных можно сказать, что корневой элемент этого типа данных может быть объектом, в состав которого может входить поле name, которое может иметь тип строки.  } About this data type, we can say that the root element of this data type may be an object, which may include the name field, which may be of the string type.

Несмотря на то, что в приведённом выше описании несколько раз используется слово «может», этого описания уже достаточно для того, чтобы программист быстро «освоил» структуру этого типа данных.  Although the word “may” is used several times in the above description, this description is sufficient for the programmer to quickly “master” the structure of this data type.

Если дополнительно условиться о том, что элементы структуры данных не могут иметь разный тип в разных экземплярах этого типа данных, то об указанном примере можно сказать еще более определенно, что корневой элемент имеет тип «объект», в который может входить элемент «пате» типа «строка».  If we additionally agree that the elements of the data structure cannot have a different type in different instances of this data type, then it can be said even more specifically about this example that the root element is of the type “object”, which may include the element “stale” of the type "line".

Кроме этого понимания структуры типа данных, программист также видит перед собой реальный пример данных этого типа данных. Видение примера позволяет программисту лучше усвоить назначение данных и, соответственно, быстрее понять структуру данных.  In addition to this understanding of the structure of the data type, the programmer also sees in front of him a real example of data of this data type. The vision of the example allows the programmer to better understand the purpose of the data and, accordingly, to quickly understand the data structure.

Описание того же самого типа данных на языке JSON-Schema выглядит так:  The description of the same data type in JSON-Schema language looks like this:

{ {

"type": "object",  "type": "object",

"properties": {  "properties": {

"name": {  "name": {

"type": "string"  "type": "string"

}  }

}  }

} Это описание намного сложнее для восприятия человеком и не содержит в себе примеров данных этого типа. } This description is much more difficult for human perception and does not contain examples of data of this type.

Несмотря на то, что пример типа данных позволяет судить о структуре типа данных, как показано выше, этих суждений недостаточно, чтобы полноценно описать тип данных, чтобы это описание было пригодно для практического использования.  Although the example of the data type allows judging the structure of the data type, as shown above, these judgments are not enough to fully describe the data type so that this description is suitable for practical use.

Например, автор описания типа данных может пожелать указать, что элемент «пате» в приведенном примере является обязательным элементом корневого объекта.  For example, the author of a description of a data type may wish to indicate that the element “pate” in the example given is a required element of the root object.

Это пожелание нетрудно воплотить, если ввести в описание типа данных служебное поле "@@required" следующим образом:  It is not difficult to translate this wish, if you enter the service field "@@ required" in the description of the data type as follows:

{ {

"name": "John",  "name": "John",

"@@required": ["name"] "@@ required": ["name"]

}  }

В этом примере условлено, что элементы, имя которых начинается с символов "@@", являются «служебными» или «описательными» элементами. Понимая это условие, любой программист средней квалификации быстро сможет «расшифровать» данную запись: корневой элемент имеет тип «объект», в который обязательно должен входить элемент «пате» типа «строка». In this example, it is agreed that elements whose name begins with the characters "@@" are "service" or "descriptive" elements. Understanding this condition, any programmer of average qualification can quickly “decipher” this record: the root element is of the type “object”, which must include an element of “string” of the type “string”.

Если автор описания типа данных хочет указать, что поле «пате» должно быть не длиннее 20 символов, то это может быть, например, решено так:  If the author of the description of the data type wants to indicate that the "pate" field should be no longer than 20 characters, then this can be, for example, solved like this:

{ {

"name": "John", "@name": {"maxLength": 20},  "name": "John", "@name": {"maxLength": 20},

"@@required": ["name"] В этом примере условлено, что элементы, имя которых начинается с символа «@», предназначены для того, чтобы описывать типы данных элементов того же уровня вложенности. Таким образом, элемент «@пагле» описывает элемент «пате». "@@ required": ["name"] In this example, it is assumed that elements whose name begins with the “@” symbol are intended to describe the data types of elements of the same nesting level. Thus, the element "@pagle" describes the element "pate".

ЭТОТ пример программист интуитивно расшифрует так: корневой элемент имеет тип «объект», в который должен входить элемент «пате» типа «строка», длиной не более 20 символов.  THIS example the programmer will intuitively decipher like this: the root element has the type “object”, which should include the element “pat” of the type “string”, no longer than 20 characters.

Таким же образом можно дополнить пример множеством других дополнительных описаний, которые используются в типе данных. Например, довольно сложный тип данных карточки работника может быть описан так:  In the same way, it is possible to supplement the example with many other additional descriptions that are used in the data type. For example, a fairly complex data type employee card can be described as:

"login": "lapkina", "login": "lapkina",

"name": "Лапкина",  "name": "Lapkina",

"email": "email@yandex.ru",  "email": "email@yandex.ru",

"salary": 12.5,  "salary": 12.5,

"isActive": true,  "isActive": true

"roles": [  "roles": [

"manager",  "manager",

"admin"  "admin"

].  ].

"birthday": "1990-02-23",  "birthday": "1990-02-23",

"address": {  "address": {

"country": "Russia",  "country": "Russia",

"zipcode": "123434",  "zipcode": "123434",

"addressl": "pr. M. Bluhera, 31-24",  "addressl": "pr. M. Bluhera, 31-24",

"address2": "",  "address2": "",

"@zipcode": { "@zipcode": {

"regex": "\\d+",  "regex": "\\ d +",

"doc": "Address zipcode.",  "doc": "Address zipcode.",

"message": "One or more digits required."  "message": "One or more digits required."

},  },

"@@required": ["country", "addressl"] }. "@@ required": ["country", "addressl"] }.

"created" : "2015-05-31 TOO : 00 : 00Z" ,  "created": "2015-05-31 TOO: 00: 00Z",

"©login": { "© login": {

"regex": "[A-Za-z1-9]+"  "regex": "[A-Za-z1-9] +"

>.  >.

"@name": {  "@name": {

"regex": "[A\\t]" "regex": "[ A \\ t]"

}- } -

"@email": { "@email": {

"type": "email"  "type": "email"

}.  }.

"©salary": {  "© salary": {

"min": 10,  "min": 10,

"max": 2000  max: 2000

}>  }>

"@roles": {  "@roles": {

"type": "array",  "type": "array",

"enum": [  "enum": [

"manager", "manager",

"admin","admin",

"superadmin" "superadmin"

].  ].

"min": 1 ,  "min": 1,

"max": 5  "max": 5

}.  }.

"©birthday": {  "© birthday": {

"type": "date"  "type": "date"

},  },

"©address": {  "© address": {

"default": {}  "default": {}

},  },

"©created": {  "© created": {

"type": "datetime"  "type": "datetime"

}- "@@required": ["email", "salary", "login"] } - "@@ required": ["email", "salary", "login"]

}  }

Несмотря на то, что этот тип данных имеет достаточно сложную структуру, если программист знаком с описанными нами ранее правилами, то «усвоение» этого типа данных все равно происходит достаточно легко и может занять у него 1-2 минуты.  Despite the fact that this type of data has a rather complicated structure, if the programmer is familiar with the rules we described earlier, the “assimilation” of this type of data still happens quite easily and can take him 1-2 minutes.

Та же самая структура данных на языке JSON-Schema будет описана так:  The same data structure in JSON-Schema will be described as follows:

type": "object", type ":" object ",

properties": {  properties ": {

"login": {  "login": {

"type": "string",  "type": "string",

"pattern": "[A-Za-z1-9]+"  "pattern": "[A-Za-z1-9] +"

},  },

"name": {  "name": {

"type": "string",  "type": "string",

"pattern": "[A\\t]" "pattern": "[ A \\ t]"

}>  }>

"salary": {  "salary": {

"type": "number",  "type": "number",

"minimum": 10,  "minimum": 10,

"maximum": 2000  "maximum": 2000

},  },

"isActive": {  "isActive": {

"type": "boolean"  "type": "boolean"

},  },

"roles": {  "roles": {

"type": "array",  "type": "array",

"items": {  "items": {

"enum": ["manager", "admin", "superadmin"],  "enum": ["manager", "admin", "superadmin"],

"minimum": 1 ,  "minimum": 1,

"maximum": 5  "maximum": 5

}  }

и }, and },

"birthday": {  "birthday": {

"type": "string",  "type": "string",

"format": "date"  "format": "date"

},  },

"address": {  "address": {

"type": "object",  "type": "object",

"properties": {  "properties": {

"country": {  "country": {

"type": "string"  "type": "string"

},  },

"zipcode": {  "zipcode": {

"type": "string",  "type": "string",

"pattern": "\\d+",  "pattern": "\\ d +",

"description": "Address zipcode.",  "description": "Address zipcode.",

"message": "One or more digits required." "message": "One or more digits required."

}. }.

"addressl": {  "addressl": {

"type": "string"  "type": "string"

},  },

"address2": {  "address2": {

"type": "string"  "type": "string"

}  }

}.  }.

"required": ["country", "addressl "],  "required": ["country", "addressl"],

"default": {}  "default": {}

},  },

"created": {  "created": {

"type": "string",  "type": "string",

"format": "date-time"  "format": "date-time"

}  }

}.  }.

"required": ["email", "salary", "login"] Вариант с использованием JSON-Schema читается сложнее и не содержит в себе примера использования. "required": ["email", "salary", "login"] The variant using JSON-Schema is more difficult to read and does not contain an example of use.

Стоит заметить, что чем проще тип данных, тем выгоднее заявляемый 5 способ отличается от традиционного способа описания типов данных с помощью языка JSON-Schema. Это особенно важно ввиду того, что на практике значительно чаще используют простые типы данных, а не сложные. А это значит, что на практике заявляемый способ описания типов данных будет иметь значительный эффект по принятым критериям.  It should be noted that the simpler the data type, the more advantageous the proposed 5 method differs from the traditional way of describing data types using the JSON-Schema language. This is especially important because in practice, simple data types are used much more often than complex ones. This means that, in practice, the claimed method of describing data types will have a significant effect on the accepted criteria.

ю Yu

Поля с вариантами типа данных.  Fields with data type options.

Ниже показан тип данных «геометрическая фигура». Этот тип данных содержит в себе поле «type» - тип фигуры и «size» - размер фигуры, причем структура поля «размер фигуры» зависит от типа фигуры. Например, если фигура 15 — прямоугольник, то пример данных может выглядеть так:  Below is the geometric shape data type. This data type contains the “type” field - the type of the figure and “size” - the size of the figure, and the structure of the “size of the figure” field depends on the type of the figure. For example, if figure 15 is a rectangle, then the data example might look like this:

{ {

"type" : "rectangle",  "type": "rectangle",

"size" : {  "size": {

20 "width" : 10,  20 "width": 10,

"height" : 20  "height": 20

}  }

}  }

25 Если же фигура— круг, то пример данных будет выглядеть несколько иначе: 25 If the figure is a circle, then the data example will look a little different:

{ {

"type" : "circle",  "type": "circle",

зо "size" : { "size": {

"radius" : 35  "radius": 35

}  }

} Видно, что внутренняя структура поля «size» может изменяться и при этом может принимать один из нескольких видов. } It is seen that the internal structure of the size field can change and at the same time can take one of several types.

Для того, чтобы описать такое поведение поля «size», вводят служебное поле «@@сазе@[имя варианта]» для описания варианта типа данных родительского элемента. В этом случае получают такое описание типа данных «геометрическая фигура»:  In order to describe this behavior of the “size” field, enter the service field “@@ saze @ [option name]” to describe the variant of the data type of the parent element. In this case, get the following description of the data type "geometric figure":

{ {

"type" : "circle",  "type": "circle",

"size" : { "size": {

"@@case@circle" : {  "@@ case @ circle": {

"radius" : 35,  "radius": 35,

"@@required" : ["radius"]  "@@ required": ["radius"]

},  },

"@@case@square" : { "@@ case @ square": {

"width" : 10,  "width": 10,

"height" : 20,  "height": 20,

"©©required" : ["width", "height"]  "© © required": ["width", "height"]

}  }

}.  }.

"©©required" : ["type", "size"] "© required": ["type", "size"]

}  }

Вычисляемые выражения. Calculated expressions.

Показан тип данных «девушка», у которого есть три поля: «isBeautiful» (красивая), «isMarried» (замужем) и «phoneNumber» (телефонный номер). При этом поля «isBeautiful» и «isMarried» всегда обязательные, а поле «phoneNumber» обязательно только в том случае, если девушка красивая и не замужем. Это означает, что обязательность поля «phoneNumber» зависит от конкретных значений в полях «isBeautiful» и «isMarried». В этом случае для описания типа данных можно использовать так называемые «вычисляемые выражения», которые позволяют вычислять те или иные значения в зависимости от конкретных значений полей и от других параметров контекста, например, текущее время, суммарный размер данных в байтах и др. Пример использования вычисляемых выражений в описании типа данных «девушка» выглядит так: { The data type is “girl”, which has three fields: “isBeautiful” (beautiful), “isMarried” (married) and “phoneNumber” (phone number). At the same time, the “isBeautiful” and “isMarried” fields are always obligatory, and the “phoneNumber” field is mandatory only if the girl is beautiful and not married. This means that the obligatory “phoneNumber” field depends on specific values in the “isBeautiful” and “isMarried” fields. In this case, to describe the data type, you can use the so-called "calculated expressions", which allow you to calculate certain values depending on specific field values and other context parameters, for example, current time, total data size in bytes, etc. An example of using calculated expressions in describing the data type “girl” looks like this: {

"isBeauitiful" : true,  "isBeauitiful": true

"isMarried" : false,  "isMarried": false,

"phoneNumber" : "+79043378139", "@isBeautiful" : {"required" : true},  "phoneNumber": "+79043378139", "@isBeautiful": {"required": true},

"@isMarried" : {"required" : true},  "@isMarried": {"required": true},

"@phoneNumber" {"required" "this.isBeautiful && ! this. isMarried"}  "@phoneNumber" {"required" "this.isBeautiful &&! this. isMarried"}

}  }

В данном примере использовано вычисляемое выражение «this.isBeautiful && ! this. isMarried » для вычисления обязательности поля «phoneNumber». Это выражение записано в синтаксисе языка JavaScript и обозначает логическое выражение: «красивая И НЕ женатая». Синтаксис языка выражений не имеет решающего значения — можно использовать любой подходящий синтаксис. Выражение может возвращать данные любого допустимого типа, а также может содержать внутри себя операнды и функции для работы с любыми типами данных: строки, числа, объекты, массивы и т. д. Экранирование символов, обозначающие служебные поля. In this example, the calculated expression “this.isBeautiful &&! this. isMarried "to calculate the mandatory field" phoneNumber ". This expression is written in the syntax of the JavaScript language and denotes a logical expression: "beautiful and NOT married." The syntax of the expression language is not decisive - you can use any suitable syntax. The expression can return data of any valid type, and also can contain operands and functions for working with any data types: strings, numbers, objects, arrays, etc. Shielding of characters denoting service fields.

При использовании заявляемого способа описания составных типов данных может возникнуть ситуация, при которой тип данных содержит поле, название которого соответствует принятому в данном языке обозначению служебных полей. Чтобы отличить это поле от служебного, используют технологию «экранирования» символов. Например, можно условиться, что начальный символ строки «@», который используется в указанных примерах для обозначения служебных полей можно экранировать символом «!». То есть последовательность символов «!@» в начале названия поля будет означать, что это не служебное поле, а обычное поле, которое начинается с символа «@». Например, если требуется в тип данных ввести поле «@name», то оно будет выглядеть так: «!@name». И тогда все описание типа данных может выглядеть так: When using the proposed method of describing composite data types, a situation may arise in which the data type contains a field whose name corresponds to the designation of service fields adopted in this language. To distinguish this field from service, use the technology of "shielding" characters. For example, it can be agreed that the initial character of the string “@”, which is used in these examples to denote service fields, can be escaped with the symbol “!”. That is, the sequence of characters "! @" At the beginning of the field name will mean that this is not a service field, but a regular field that starts with the "@" symbol. For example, if required in the data type to enter the field "@name", then it will look like this: "! @name". And then the entire description of the data type may look like this:

Jname" : "Николай" Jname ":" Nikolay "

Подобным способом можно экранировать и сам начальный символ «!», который в данном случае тоже стал служебным. То есть, например, если хотят ввести в тип данных поле с названием «!@name», то в описании типа данных нужно экранировать первый символ «!», таким образом получают: In a similar way, the initial “!” Symbol itself can also be escaped, which in this case also became official. That is, for example, if they want to enter a field with the name “! @Name” in the data type, then in the description of the data type, the first character “!” Must be escaped, so that:

"!!@name" : "Николай" "!! @ name": "Nikolay"

}  }

Подобным приёмом можно решить любые проблемы, связанные с необходимостью различать, когда служебные символы имеют служебное значение, а когда собственное значение. Such a technique can solve any problems associated with the need to distinguish when the service characters have a service value, and when their own value.

Пример в формате XML. XML example.

Пример типа данных «Сотрудник» выглядит так:  An example of the “Employee” data type is:

<?xml version="1.0" encoding="UTF-8"?> <? xml version = "1.0" encoding = "UTF-8"?>

<user login="lapkina">  <user login = "lapkina">

<пате>Лапкина</пате>  <pate> Lapkina </ pate>

<email>email@yandex.ru</email>  <email> email@yandex.ru </ email>

<salary>12.5</salary>  <salary> 12.5 </ salary>

<isActive>true</isActive>  <isActive> true </ isActive>

<roles>  <roles>

<role>manager</role>  <role> manager </ role>

<role>admin</role>  <role> admin </ role>

</roles>  </ roles>

<birthday>1990-05-14</birthday>  <birthday> 1990-05-14 </ birthday>

<address> <country>Russia</country> <address> <country> Russia </ country>

<zipcode>123434</zipcode>  <zipcode> 123434 </ zipcode>

<address1 >pr. M. Kazakova, 31-24</address1>  <address1> pr. M. Kazakova, 31-24 </ address1>

<address2 />  <address2 />

</address>  </ address>

<created>2015-02-13T12:34:23Z</created>  <created> 2015-02-13T12: 34: 23Z </ created>

</user>  </ user>

На языке XSD схема для такого XML документа может выглядеть так: In XSD, the schema for this XML document might look like this:

<?xml version="1.0" encoding="UTF-8"?> <? xml version = "1.0" encoding = "UTF-8"?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"  <xs: schema attributeFormDefault = "unqualified" elementFormDefault = "qualified" xmlns: xs = "http://www.w3.org/2001/XMLSchema"

xmlns:vc='^ttp://www.w3.org/2007/XMLSchema-versioning,,> xmlns: vc = '^ ttp: //www.w3.org/2007/XMLSchema-versioning ,, >

<xs:element name="user">  <xs: element name = "user">

<xs:complexType>  <xs: complexType>

<xs:sequence>  <xs: sequence>

<xs:element type="xs:string" name="name'7>  <xs: element type = "xs: string" name = "name'7>

<xs:element type="email" name="email"/>  <xs: element type = "email" name = "email" />

<xs:element type="xs:float" name="salary"/>  <xs: element type = "xs: float" name = "salary" />

<xs:element type="xs:boolean" name="isActive"/>  <xs: element type = "xs: boolean" name = "isActive" />

<xs:element name="roles">  <xs: element name = "roles">

<xs:complexType>  <xs: complexType>

<xs:sequence>  <xs: sequence>

<xs:element type="xs:string" name="role" maxOccurs="unbounded" minOccurs="0"/>  <xs: element type = "xs: string" name = "role" maxOccurs = "unbounded" minOccurs = "0" />

</xs:sequence>  </ xs: sequence>

</xs:complexType>  </ xs: complexType>

</xs:element>  </ xs: element>

<xs:element type="xs: string" name="birthday"/>  <xs: element type = "xs: string" name = "birthday" />

<xs:element name="address">  <xs: element name = "address">

<xs:complexType>  <xs: complexType>

<xs:sequence>  <xs: sequence>

<xs:element type="xs:string" name="country"/>  <xs: element type = "xs: string" name = "country" />

<xs:element type="xs:int" name="zipcode"/> <xs:element type="xs:string" name="address1"/> <xs: element type = "xs: int" name = "zipcode"/> <xs: element type = "xs: string" name = "address1"/>

<xs:element type="xs:string" name="address2"/>  <xs: element type = "xs: string" name = "address2" />

</xs:sequence>  </ xs: sequence>

</xs:complexType>  </ xs: complexType>

</xs:element>  </ xs: element>

<xs:element type="xs:dateTime" name="created"/>  <xs: element type = "xs: dateTime" name = "created" />

</xs:sequence>  </ xs: sequence>

<xs:attribute type="login" name- 1ogin"/>  <xs: attribute type = "login" name- 1ogin "/>

</xs : com plexType>  </ xs: com plexType>

</xs:element>  </ xs: element>

<xs:simpleType name="login">  <xs: simpleType name = "login">

<xs: restriction base="xs:string">  <xs: restriction base = "xs: string">

<xs:pattern value="[A-Za-z1 -9]+"/>  <xs: pattern value = "[A-Za-z1 -9] +" />

</xs:restriction>  </ xs: restriction>

</xs:simpleType>  </ xs: simpleType>

<xs:simpleType name="name">  <xs: simpleType name = "name">

<xs: restriction base="xs:string">  <xs: restriction base = "xs: string">

<xs:pattern value="[A\\t]"/> <xs: pattern value = "[ A \\ t]"/>

</xs: restriction >  </ xs: restriction>

</xs:simpleType>  </ xs: simpleType>

<xs:simpleType name="email">  <xs: simpleType name = "email">

<xs: restriction base="xs:string">  <xs: restriction base = "xs: string">

<xs:pattern value="[A@]+@[A\.]+\..+'7> <xs: pattern value = "[ A @] + @ [ A \.] + \ .. + '7>

</xs:restriction>  </ xs: restriction>

</xs:simpleType>  </ xs: simpleType>

</xs:schema>  </ xs: schema>

Применяя заявляемый способ, описание типа данных «Сотрудник» может выглядеть, например, так: Using the inventive method, the description of the “Employee” data type may look like this:

<?xml version="1.0" encoding="UTF-8"?> <? xml version = "1.0" encoding = "UTF-8"?>

<user login="lapkina">  <user login = "lapkina">

<пате>Лапкина</пате>  <pate> Lapkina </ pate>

<email>email@yandex.ru</email>  <email> email@yandex.ru </ email>

<salary>12.5</salary> <isActive>true</isActive> <salary> 12.5 </ salary> <isActive> true </ isActive>

<roles> <roles>

<role>manager</role>  <role> manager </ role>

<role>admin</role>  <role> admin </ role>

</roles> </ roles>

<birthday>1990-05-14</birthday>  <birthday> 1990-05-14 </ birthday>

<address> <address>

<country>Russia</country>  <country> Russia </ country>

<zipcode> 123434 </zipcode>  <zipcode> 123434 </ zipcode>

<address1 >pr. M. Kazakova, 31-24</address1 > <address1> pr. M. Kazakova, 31-24 </ address1>

<address2 /> <address2 />

</address> </ address>

<created>2015-02-13T12:34:23Z</created>  <created> 2015-02-13T12: 34: 23Z </ created>

<_login regex="[A-Za-z1-9]+" /> <_login regex = "[A-Za-z1-9] +" />

<_name regex="[A\\t]" /> <_name regex = "[ A \\ t]"/>

<_email type="email" /> <_email type = "email" />

<_salary min="123" max="200" /> <_salary min = "123" max = "200" />

<_roles type="array" min="1" max="5"> <_roles type = "array" min = "1" max = "5">

<enum>  <enum>

<item>manager</item>  <item> manager </ item>

< item >ad m i n </item >  <item> ad m i n </ item>

<item>superadmin</item> </enum>  <item> superadmin </ item> </ enum>

</_roles> </ _ roles>

<_birthday type="date" />  <_birthday type = "date" />

<_address> <_address>

<default>  <default>

</default>  </ default>

</_address> </ _ address>

<_created type="datetime" />  <_created type = "datetime" />

< required> <required>

<item>email</item>  <item> email </ item>

<item>salary</item> <item>login</item> <item> salary </ item> <item> login </ item>

</ required>  </ required>

</user>  </ user>

В этом примере для обозначения служебных полей в качестве служебного символа используется символ «_», так как спецификация языка XML не позволяет использовать в начале названия элемента символ «@». In this example, the symbol “_” is used to denote service fields as the service symbol, since the XML specification does not allow the “@” symbol to be used at the beginning of the element name.

Очевидно, что схема документа на языке XSD воспринимается значительно сложнее, чем описание типа данных с применением заявляемого способа. It is obvious that the scheme of the document in the XSD language is perceived much more complicated than the description of the data type using the proposed method.

Этот пример наглядно показывает, что описанная нами методика демонстрирует свои описанные выше преимущества в том числе и на языке XML.  This example clearly shows that the technique described by us demonstrates its advantages described above, including in XML.

Ниже показано применение заявляемого способа к формату YAML. Пример типа данных «Сотрудник» выглядит следующим образом: login: lapkina  The following shows the application of the proposed method to the format YAML. An example of the data type “Employee” is as follows: login: lapkina

name: Лапкина  name: Lapkina

email: email@yandex.ru  email: email@yandex.ru

salary: 12.1  salary: 12.1

isActive: true  isActive: true

roles: [manager, admin]  roles: [manager, admin]

birthday: 1990-05-12  birthday: 1990-05-12

address:  address:

country: Russia  country: Russia

zipcode: "123434"  zipcode: "123434"

addressl : "pr. M. Bluhera, 31-24"  addressl: "pr. M. Bluhera, 31-24"

address2: ""  address2: ""

created: 2015-05-12T12:34:23.003+04:21  created: 2015-05-12T12: 34: 23.003 + 04: 21

На языке Kwalify схема для такого XML документа может выглядеть так: type: map In Kwalify, the schema for such an XML document might look like this: type: map

mapping:  mapping:

login:  login:

type: str pattern: /[A-Za-z1-9]+/ required: yes type: str pattern: / [A-Za-z1-9] + / required: yes

name: name:

type: str  type: str

required: yes  required: yes

email: email:

type: str  type: str

pattern: /@/  pattern: / @ /

required: yes  required: yes

salary: salary:

type: number  type: number

range: {min: 10, max: 2000}  range: {min: 10, max: 2000}

required: yes  required: yes

isActive: isActive:

type: bool  type: bool

roles: roles:

type: seq  type: seq

sequence:  sequence:

- type: str  - type: str

enum: [manager, admin, superadmin] birthday:  enum: [manager, admin, superadmin] birthday:

type: date  type: date

address: address:

type: map  type: map

mapping:  mapping:

country:  country:

type: str  type: str

required: yes  required: yes

zipcode:  zipcode:

type: str  type: str

pattern: Ad+/  pattern: Ad + /

addressl :  addressl:

type: str  type: str

required: yes  required: yes

address2: type: str address2: type: str

created:  created:

type: timestamp  type: timestamp

Применяя заявляемый способ, описание типа данных «Сотрудн выглядеть, например, так: login: lapkina Using the inventive method, the description of the data type “It looks like, for example, login: lapkina

name: Лапкина  name: Lapkina

email: email@yandex.ru  email: email@yandex.ru

salary: 12.5  salary: 12.5

isActive: true  isActive: true

roles: [manager, admin]  roles: [manager, admin]

birthday: 1990-05-12  birthday: 1990-05-12

address:  address:

country: Russia  country: Russia

zipcode: 23434"  zipcode: 23434 "

addressl : "pr. M. Bluhera, 31-24"  addressl: "pr. M. Bluhera, 31-24"

address2: ""  address2: ""

_zipcode": _zipcode ":

regex: "\\d+"  regex: "\\ d +"

doc: "Address zipcode."  doc: "Address zipcode."

message: "One or more digits required."  message: "One or more digits required."

required: [country, addressl] created: 2015-05-12T12:34:23.003+04:21  required: [country, addressl] created: 2015-05-12T12: 34: 23.003 + 04: 21

Jogin: Jogin:

regex: n[A-Za-z1-9]+" regex: n [a-za-z1-9] + "

_email:  _email:

type: email  type: email

_salary: {min: 10, max: 2000}  _salary: {min: 10, max: 2000}

_roles:  _roles:

type: array enum: [manager, admin, superadmin] type: array enum: [manager, admin, superadmin]

min: 1  min: 1

max: 5  max: 5

_birthday:  _birthday:

type: date  type: date

_created:  _created:

type: datetime required: [email, salary, login]  type: datetime required: [email, salary, login]

В этом примере для обозначения служебных полей в качестве служебного символа используется символ «_», так как спецификация языка YAML не позволяет использовать в начале названия элемента символ «@». In this example, the symbol “_” is used to denote service fields as a service symbol, since the YAML language specification does not allow the use of the symbol “@” at the beginning of the element name.

Очевидно, что схема документа на языке Kwalify воспринимается значительно сложнее, чем описание типа данных с применением нашей методики.  It is obvious that the scheme of the document in the Kwalify language is perceived to be much more complicated than the description of the data type using our methodology.

Этот пример наглядно показывает, что описанная нами методика демонстрирует свои описанные выше преимущества в том числе и на языке YAML.  This example clearly shows that the technique described by us demonstrates its advantages described above, including in the YAML language.

Таким образом, в качестве языка описания типа данных за основу берут тот же язык, на котором будут формироваться данные указанного типа данных. Например, для данных типа JSON описание будет создаваться на языке JSON. Это требование не является обязательным, но при выполнении этого требования, разработчик получает дополнительные удобства при работе с описанием типа данных и примерами данных этого типа, когда они составлены на одном языке.  Thus, as a language for describing a data type, the basis is the same language in which data of a specified data type will be formed. For example, for JSON type data, a description will be created in JSON. This requirement is not mandatory, but when this requirement is fulfilled, the developer gets additional convenience when working with the description of the data type and examples of this type of data when they are compiled in one language.

Минимальное описание типа данных в точности соответствует примеру данных этого типа.  The minimum description of the data type corresponds exactly to the sample data of this type.

Расширение описания типа данных осуществляют за счёт внедрения в минимальное описание типа данных дополнительных элементов по определённым заранее условленным правилам написания расширений описания типа данных.  Expansion of the description of the data type is carried out by introducing into the minimum description of the data type of additional elements according to certain predetermined rules for writing extensions of the description of the data type.

Правила написания расширений описания типа данных должны удовлетворять следующим условиям:  The rules for writing data type description extensions must satisfy the following conditions:

- элементы расширений должны легко визуально отличаться от элементов, относящихся к минимальному описанию типа данных (в данном примере для JSON они все начинаются с символа «@»); - элементы расширений должны вводиться таким образом, чтобы можно было визуально легко определить, к какому элементу минимального описания типа данных они относятся, в данном примере, они имеют тот же уровень вложенности и имеют похожее имя, например, элемент расширения «@login» относится к элементу «login». - elements of extensions should be easily visually different from elements related to the minimum description of the data type (in this example, for JSON, they all begin with the “@” symbol); - extension elements must be entered in such a way that it is visually easy to determine which element of the minimum description of the data type they belong to; in this example, they have the same nesting level and have a similar name, for example, the @login extension element refers to the login element.

Заявляемый способ описания типов данных обладает теми же возможностями, что и традиционные методики описания типов данных, такие как JSON-Schema, XSD, Kwalify и др.  The inventive method of describing data types has the same capabilities as traditional methods of describing data types, such as JSON-Schema, XSD, Kwalify, etc.

Заявляемый способ описания типов данных легко создается человеком и быстро воспринимается человеком.  The inventive method of describing data types is easily created by man and quickly perceived by man.

Дополнительными преимуществами описанной методики являются: описание типа данных содержит в себе примеры использования, которые могут пригодиться при разработке; использование визуального выделения синтаксических конструкций позволяет значительно упростить восприятие структуры описываемого типа данных.  Additional advantages of the described methodology are: the description of the data type contains examples of use that may be useful in the development; The use of visual highlighting of syntactic structures makes it possible to significantly simplify the perception of the structure of the described data type.

Эти преимущества достигаются за счёт того, что основой для описания типа данных является пример данных этого типа, что позволяет быстро создавать основу для описания типа данных, а также позволяет легко усваивать структуру типа данных; а расширения описания типа данных не уменьшают преимущества, указанного в предыдущем пункте, так как эти расширения визуально отделены от «примера».  These advantages are achieved due to the fact that the basis for describing a data type is an example of data of this type, which allows you to quickly create a basis for describing a data type, and also makes it easy to assimilate the structure of a data type; and data type description extensions do not diminish the advantages indicated in the previous paragraph, since these extensions are visually separated from the “example”.

Указанные положительные эффекты заявляемого способа сильнее проявляются при описании несложных типов данных, что особенно важно, так как на практике подавляющее число используемых типов данных являются достаточно простыми.  These positive effects of the proposed method are more pronounced when describing simple data types, which is especially important, since in practice the overwhelming number of data types used are quite simple.

Приведённые примеры являются частными случаями и не исчерпывают всех возможных реализаций заявляемого изобретения.  These examples are special cases and do not exhaust all possible implementations of the claimed invention.

Специалисту в данной области техники должно быть понятно, что различные вариации заявляемого способа не изменяют сущность изобретения, а лишь определяют его конкретные воплощения.  It should be clear to a person skilled in the art that various variations of the proposed method do not change the essence of the invention, but only determine its specific embodiments.

Claims

ФОРМУЛА ИЗОБРЕТЕНИЯ CLAIM 1. Способ описания составного типа данных, характеризующийся тем, что для минимального описания составного типа данных используют пример данных1. A method for describing a composite data type, characterized in that, for a minimal description of a composite data type, an example of data is used. 5 этого типа, отдельно определяют правила интерпретации присутствия или отсутствия элемента примера данных этого типа в описании составного типа данных, определяют правила внедрения расширений описания типа данных в описание составного типа данных, осуществляют расширение минимального описания составного типа данных за счёт внедрения в минимальное описание ю составного типа данных дополнительных элементов по определённым ранее правилам внедрения расширений описания типа данных в описание составного типа данных и определяют правила интерпретации расширений описания составного типа данных. 5 of this type, separately determine the rules for interpreting the presence or absence of an element of an example of this type of data in the description of a composite data type, define the rules for introducing data type description extensions into the description of a composite data type, expand the minimum description of a composite data type by embedding it into a minimal description data type of additional elements according to the previously defined rules for introducing data type description extensions into the description of a composite data type and define rules interpretation of a composite data type description of extensions. 2. Способ по п. 1 , характеризующийся тем, что проверяют корректность 15 данных на соответствие описанию составного типа данных.  2. The method according to claim 1, characterized in that they check the correctness of 15 data for compliance with the description of the composite data type. 3. Способ по п. 2, характеризующийся тем, что отображают сообщения об ошибках в проверяемых данных.  3. The method according to claim 2, characterized in that the display error messages in the data being verified. 4. Способ по п. 2, характеризующийся тем, что отображают советы по устранению ошибок в проверяемых данных.  4. The method according to p. 2, characterized by the fact that display tips on eliminating errors in the data being verified. 20 5. Способ по п.1 , характеризующийся тем, что создают электронную документацию на составной тип данных.  20 5. The method according to claim 1, characterized in that it creates electronic documentation on the composite data type. 6. Способ по п.1 , характеризующийся тем, что визуально выделяют синтаксические конструкции описания составного типа данных.  6. The method according to claim 1, characterized in that the syntactic constructions describing the composite data type are visually distinguished. 7. Способ по п.1 , характеризующийся тем, что генерируют пример типа 25 данных на основе описания составного типа данных.  7. The method according to claim 1, characterized in that generate an example of the type 25 data based on the description of the composite data type.
PCT/RU2017/000706 2017-08-25 2017-09-26 Method of describing a composite data type Ceased WO2019039958A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
RU2017130137 2017-08-25
RU2017130137 2017-08-25

Publications (1)

Publication Number Publication Date
WO2019039958A1 true WO2019039958A1 (en) 2019-02-28

Family

ID=65439196

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/RU2017/000706 Ceased WO2019039958A1 (en) 2017-08-25 2017-09-26 Method of describing a composite data type

Country Status (1)

Country Link
WO (1) WO2019039958A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986519A (en) * 2021-12-29 2022-01-28 深圳市毕美科技有限公司 Data scheduling processing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2438263C2 (en) * 2007-06-19 2011-12-27 Квэлкомм Инкорпорейтед Methods and apparatus for dataset synchronisation in wireless environment
US20160124722A1 (en) * 2014-10-31 2016-05-05 Oracle International Corporation Json stylesheet language transformation
US20170153887A1 (en) * 2015-11-30 2017-06-01 International Business Machines Corporation Tracking changes within javascript object notation
US9678726B1 (en) * 2015-03-27 2017-06-13 Amazon Technologies, Inc. Automatic generation of plugins for development tools

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2438263C2 (en) * 2007-06-19 2011-12-27 Квэлкомм Инкорпорейтед Methods and apparatus for dataset synchronisation in wireless environment
US20160124722A1 (en) * 2014-10-31 2016-05-05 Oracle International Corporation Json stylesheet language transformation
US9678726B1 (en) * 2015-03-27 2017-06-13 Amazon Technologies, Inc. Automatic generation of plugins for development tools
US20170153887A1 (en) * 2015-11-30 2017-06-01 International Business Machines Corporation Tracking changes within javascript object notation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986519A (en) * 2021-12-29 2022-01-28 深圳市毕美科技有限公司 Data scheduling processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
Tidwell XSLT: mastering XML transformations
CN111400387B (en) Conversion method and device for import and export data, terminal equipment and storage medium
KR100977352B1 (en) System and method for supporting non-native MBL in native MBL of word processor document
US6662342B1 (en) Method, system, and program for providing access to objects in a document
US9098476B2 (en) Method and system for mapping between structured subjects and observers
CN102567539B (en) Intelligent WEB report implementation method and intelligent WEB report implementation system
US20040216086A1 (en) XML types in Java
US8918710B2 (en) Reducing programming complexity in applications interfacing with parsers for data elements represented according to a markup language
KR20050056123A (en) Programmable object model for namespace or schema library support in a sofrware application
JP2002196967A (en) Method for redirecting source of data object displayed on html document
JP2004178602A (en) Method for importing and exporting hierarchized data, and computer-readable medium
CN110825382A (en) Front-end big data tree structure display method
Faulkner et al. HTML 5.2
CN102567514B (en) A data processing method and system
WO2024066094A1 (en) Cross-data-source visual construction method and system for database view
US20210012444A1 (en) Automated patent preparation
CN108664546B (en) XML data structure conversion method and device
US7844898B2 (en) Exporting a document in multiple formats
CN107122486A (en) A kind of polynary big data fusion method and system for supporting BLOB
US20100269032A1 (en) Advanced text completion, such as for markup languages
CN114490651A (en) Data storage method and device
WO2019039958A1 (en) Method of describing a composite data type
US20070067323A1 (en) Fast file shredder system and method
CN110147358B (en) Construction method and construction system of automatic question-answering knowledge base
Nolan et al. Javascript object notation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17922238

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17922238

Country of ref document: EP

Kind code of ref document: A1