You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/note/VodmlTools.tex
+78-1Lines changed: 78 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -72,9 +72,47 @@ \section{A Brief History of VO-DML Tools}
72
72
\item Creating model documentation as a single HTML page.
73
73
\end{itemize}
74
74
75
+
Starting in early 2021 the author had a requirement to design some new data models
76
+
and create services against them.\footnote{This is the Polaris proposal tool \url{https://github.com/orppst} which uses ProposalDM \url{https://ivoa.github.io/ProposalDM/}}
77
+
It seemed sensible to try to use VO-DML to define the data models and try to revive the
78
+
code generation facilities of VO-URP. The way that the tooling was distributed was also changed
79
+
see section \ref{sec:technologies}. The facilities that the current tooling provides are
80
+
\begin{itemize}
81
+
\item Creating an XML schema that validates serialized instances of a particular data model
82
+
\item Creating a JSON schema that similarly can be used to validate serialized instances
83
+
\item Creating a TAPSchema representation (an XML serialization of the TAPSchemaDM also defined
84
+
in VO-DML\footnote{\url{https://ivoa.github.io/TAPSchemaDM/}})
85
+
\item Generation of Java code that can create instances of the data model and implements the serializations listed above
86
+
\item Generation of Python code that similarly does the same\footnote{the Python code generation is not as sophisticated as the Java code generation}
87
+
\item Generation of multi page documentation for the data model, which has several advantages over the single page HTML documentation;
88
+
\begin{itemize}
89
+
\item has better navigation.
90
+
\item resizes itself for modern mobile screen sizes.
91
+
\item has a localised diagram for each VO-DML element that shows its connection to the rest of the model.
92
+
\end{itemize}
93
+
\item Being able to author a VO-DML model in VODSL\footnote{\url{https://www.ivoa.net/documents/Notes/VODSL/}} as well as UML.
94
+
\end{itemize}
75
95
76
-
96
+
\label{sec:technologies}
77
97
\subsection{Technologies used to write the Tools}
98
+
As the VO-DML is expressed in XML the VO-DML tools made the early choice to implement all
99
+
of the business logic in XSLT. At the time of publishing VO-VML 1.0 the running of the various
100
+
XSLT transformations was orchestrated using the Ant\footnote{\url{https://ant.apache.org}} build tool.
101
+
The more recent versions of the VO-DML tools have been rewritten so that the Gradle\footnote{\url{https://gradle.org}} build tool, which
102
+
has the following advantages of the previous Ant orchestration;
103
+
\begin{itemize}
104
+
\item all of the associated XSLT and other files that are needed for the tools functionality can be packaged as a gradle plug-in
105
+
- this allows use of the tools by a simple textual reference to the plugin, rather than having to copy the required files from the VO-DML repository.
106
+
\item gradle makes it easy to include other dependencies via maven repositories
107
+
\end{itemize}
108
+
109
+
The choice of orchestration tools does look rather `Java-centric' and it reflects the fact that the
110
+
initial target of the code generation target was Java. However, this does not mean that the tools are
111
+
exclusively of utility to Java programmers - Indeed if only interested in the generated schema and
112
+
documentation there is no particular language association (apart from a requirement of an installed
113
+
Java Virtual Machine to run the tools). The tools can equally generate python code, and there is
114
+
a prototype orchestration that is implemented in Python - however, this orchestration implementation
115
+
is not as comprehensive in its functionality as the Gradle orchestration.
78
116
79
117
\section{Using the VO-DML tools}
80
118
@@ -84,6 +122,45 @@ \section{Using the VO-DML tools}
84
122
85
123
\section{Serialization}
86
124
125
+
One of the principle advantages of having a machine readable version of a data model is that it is
126
+
possible to further transform the model into other machine readable representations. One of the
127
+
principle reasons to create a data model in the first place
128
+
is to be able to exchange instances of that data model between
129
+
different systems that might be interested in the content of those instances and be sure that
130
+
the same interpretation will be made of the instance in each circumstance. Interchange is
131
+
done by a process known as serialization where the model instances are transformed into
132
+
a form that is easy to transport via some transport mechanism.
133
+
This often means that the
134
+
model instances are transformed into a textual form for transmission. In recent times
135
+
two popular methods of doing this have been XML and JSON - these formats have their own
136
+
meta-models that are typically generic enough to be able to express instances of complex
137
+
data models.
138
+
However, because they are generic they typically cannot express the same semanic
139
+
information that is in a data model. In addition these formats, because they were often
140
+
defined for interchange
141
+
purposes will have their own schema systems to be able to validate instances against
142
+
their meta-model.
143
+
It is therefore useful to be able to generate schema from a VO-DML model
144
+
so that the XML or JSON tools might be able to validate serialization instances of the
145
+
data model, as they cannot directly understand the VO-DML.
146
+
147
+
\subsection{References in serialization}
148
+
\subsection{Schema representations}
149
+
150
+
Depending to the complexity of a particular schema language and serializationformat, there might be several different
151
+
styles that can be used to represent data model instance serializations - A possibility that
152
+
occurs in XML is whether a particular VO-DML attribute should be represented by an
153
+
XML element or an XML attribute - somtimes, for instance, if the VO-DML is a DataType then
154
+
only an XML element would be the only formulation capable of being able to represent
155
+
the structure in a DataType - therefore the choice between XML element and XML attribute
156
+
cannot be a global choice, but can only be made on an attribute by attribute basis.
157
+
A purely stylistic choice that can be made with XML for instance is where an XML element
158
+
in a sequence that has a multiplicity of greater than one should be `wrapped' by another
159
+
element, and although this does not alter any of the semantics of the data model being represented
160
+
it often `reads better' to the human eye when looking at such an XML structure.
0 commit comments