1 <?xml version="1.0" encoding="ISO-8859-1"?>
3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <!--*****************************************************************-->
28 <!-- DTD FOR the MATHEMATICAL QUERY MARKUP LANGUAGE (XMathQL) -->
29 <!-- First draft: April 2002, Irene Schena -->
30 <!--*****************************************************************-->
32 <!--*****************************************************************-->
33 <!-- This syntax is not convenient for humans to read and write, but -->
34 <!-- it is for programs. -->
35 <!-- XMathQL is useful for: -->
36 <!-- 1) generating queries in a XML-orienting programming environment-->
37 <!-- 2) embedding queries in XML documents -->
38 <!-- 3) reusing queries saved in a standard format -->
39 <!-- The syntax reflects the structure of the grammar productions of -->
41 <!-- Operators are unambiguous (binary or unary), so there isn't any -->
42 <!-- grouping operator. -->
43 <!-- CONST is the constant string; rvar is for references and lvar -->
45 <!-- The attributes binder, rvar, lvar declare variables which are -->
46 <!-- referred to and used by means of respectively BINDER, Rvar and -->
47 <!-- RVAR, Lvar and LVAR. -->
48 <!-- Rvar (Lvar) is casted to a list, on the contrary the use of RVAR-->
49 <!-- (LVAR) is casted to a string. -->
50 <!-- PROPERTY works on a specified RDF property returning its value. -->
51 <!--*****************************************************************-->
53 <!ENTITY % position '(MainHypothesis|Hypothesis|MainConclusion|Conclusion|
56 <!ENTITY % bool '(True|False)'>
58 <!ENTITY % token '(CONST|STAR|TWOSTARS|SLASH|QUESTIONMARK)'>
60 <!-- MathQL list expression declaration -->
62 <!ENTITY % listexpr '(Rvar|Lvar|Reference|Pattern|Select|Exists|LetIn|
63 Use|UsedBy|ConstructorsOf|InTheory|TheoryRefTo|
64 TypeOf|SuperTypeOf|SubTypeOf|Union|Intersect|Diff)'>
66 <!-- MathQL boolean expression declaration -->
68 <!ENTITY % boolexpr '(BOOL|NOT|AND|OR|IS|SETEQUAL|SUBSET)'>
70 <!-- MathQL string expression declaration -->
72 <!ENTITY % functexpr '(NAME|PROPERTY|SUPERPROPERTY|SUBPROPERTY)'>
74 <!ENTITY % stringexpr '(CONST|POSITION|RVAR|BINDER|%functexpr;)'>
77 <!-- MathQL query top-element -->
79 <!ELEMENT MQLquery %listexpr;>
81 <!-- MathQL list expressions -->
90 <!ELEMENT Reference (RPrefix, RBody, Ext, (RFragmentID?))>
92 <!ELEMENT Pattern (PPrefix, PBody, (Ext?), (PFragmentID?))>
94 <!ELEMENT Select (In, Where)>
96 <!ELEMENT Exists (In, Where)>
98 <!ELEMENT LetIn (%listexpr;, Target)>
100 <!ELEMENT Use (%listexpr;, Position)>
102 <!ELEMENT UsedBy (%listexpr;, Position)>
104 <!ELEMENT ConstructorsOf %listexpr;>
106 <!ELEMENT InTheory (%listexpr;, ItemType)>
108 <!ELEMENT TheoryRefTo %listexpr;>
110 <!ELEMENT TypeOf %listexpr;>
112 binder CDATA #REQUIRED>
114 <!ELEMENT SuperTypeOf %listexpr;>
115 <!ATTLIST SuperTypeOf
116 binder CDATA #REQUIRED>
118 <!ELEMENT SubTypeOf %listexpr;>
120 binder CDATA #REQUIRED>
122 <!ELEMENT Union (%listexpr;, %listexpr;)>
124 <!ELEMENT Intersect (%listexpr;, %listexpr;)>
126 <!ELEMENT Diff (%listexpr;, %listexpr;)>
128 <!-- MathQL list sub-expressions -->
130 <!ELEMENT RPrefix (CONST)>
132 <!ELEMENT RBody (CONST)>
134 <!ELEMENT RFragmentID (NUMBER)+>
136 <!ELEMENT Ext (CONST)>
138 <!ELEMENT PPrefix (CONST|STAR)>
140 <!ELEMENT PBody (%token;)+>
142 <!-- XPointers have max depth = 2 (see CIC inductive definitions) -->
143 <!ELEMENT PFragmentID (NUMBER|TWOSTARS|STAR)+>
145 <!ELEMENT NUMBER EMPTY>
147 value NMTOKEN #REQUIRED>
149 <!-- We need SLASH for grouping CONST with QUESTIONMARK -->
150 <!ELEMENT SLASH EMPTY>
152 <!-- STAR expands only to objects of the specified dir before the last "/":
153 ex. cic:/Algebra/* expands to every object in Algebra only -->
154 <!ELEMENT STAR EMPTY>
156 <!-- TWOSTARS expands till the most complete name (with extension if not
158 <!ELEMENT TWOSTARS EMPTY>
160 <!-- QUESTIONMARK matches one character except "/" -->
161 <!ELEMENT QUESTIONMARK EMPTY>
163 <!ELEMENT In %listexpr;>
165 <!ELEMENT Where %boolexpr;>
167 rvar CDATA #REQUIRED>
169 <!ELEMENT Target %listexpr;>
171 lvar CDATA #REQUIRED>
173 <!ELEMENT Position EMPTY>
175 binder CDATA #REQUIRED>
177 <!ELEMENT ItemType EMPTY>
179 binder CDATA #REQUIRED>
181 <!-- MathQL boolean expressions -->
183 <!ELEMENT BOOL EMPTY>
185 value %bool; #REQUIRED>
187 <!ELEMENT NOT %boolexpr;>
189 <!ELEMENT AND (%boolexpr;, %boolexpr;)>
191 <!ELEMENT OR (%boolexpr;, %boolexpr;)>
193 <!ELEMENT IS (%stringexpr;, %stringexpr;)>
195 <!ELEMENT SETEQUAL (%listexpr;, %listexpr;)>
197 <!ELEMENT SUBSET (%listexpr;, %listexpr;)>
199 <!-- MathQL string expressions -->
201 <!ELEMENT CONST (#PCDATA)>
203 <!ELEMENT RVAR EMPTY>
205 name CDATA #REQUIRED>
207 <!ELEMENT BINDER EMPTY>
209 name CDATA #REQUIRED>
211 <!ELEMENT POSITION EMPTY>
213 name %position; #REQUIRED>
215 <!ELEMENT NAME (RVAR)>
217 <!ELEMENT PROPERTY (RVAR)>
219 name CDATA #REQUIRED>
221 <!ELEMENT SUPERPROPERTY (RVAR)>
222 <!ATTLIST SUPERPROPERTY
223 name CDATA #REQUIRED>
225 <!ELEMENT SUBPROPERTY (RVAR)>
226 <!ATTLIST SUBPROPERTY
227 name CDATA #REQUIRED>