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 <!-- Second draft: Agust 2002, Irene Schena -->
31 <!--*****************************************************************-->
33 <!--*****************************************************************-->
34 <!-- This syntax is not convenient for humans to read and write, but -->
35 <!-- it is for programs. -->
36 <!-- XMathQL is useful for: -->
37 <!-- 1) generating queries in a XML-orienting programming environment-->
38 <!-- 2) embedding queries in XML documents -->
39 <!-- 3) reusing queries saved in a standard format -->
40 <!-- The syntax reflects the structure of the grammar productions of -->
42 <!-- Operators are unambiguous (binary or unary), so there isn't any -->
43 <!-- grouping operator. -->
44 <!-- CONST is the quoted constant string; rvar is for single -->
45 <!-- reference and svar for sets of references, i.e. query results. -->
46 <!-- The attributes binder, rvar, svar declare variables which are -->
47 <!-- referred to and used by means of respectively BINDER, Rvar, Svar-->
48 <!-- PROPERTY works on a specified RDF property returning its value. -->
49 <!--*****************************************************************-->
51 <!ENTITY % bool '(True|False)'>
53 <!-- MathQL query expression declaration -->
55 <!ENTITY % setexpr '(Rvar|Svar|Ref|Pattern|Select|LetSIn|LetVIn|Relation|
56 Union|Intersect|Diff)'>
58 <!-- MathQL boolean expression declaration -->
60 <!ENTITY % boolexpr '(BOOL|NOT|AND|OR|EQ|SUB|MEET|EX)'>
62 <!-- MathQL string-set expression declaration -->
64 <!ENTITY % functexpr '(FUN|PROPERTY)'>
66 <!ENTITY % stringsetexpr '(CONST|CONSTLIST|REFOF|BINDER|VVAR|%functexpr;)'>
68 <!-- MathQL query top-element -->
70 <!ELEMENT MQLquery %setexpr;>
72 <!-- MathQL set expressions -->
82 <!ELEMENT Ref %stringsetexpr;>
84 <!ELEMENT Pattern %stringsetexpr;>
86 <!ELEMENT Select (In, Where)>
88 <!ELEMENT LetSIn (%setexpr;, Starget)>
90 <!ELEMENT LetVIn (%stringsetexpr;, Vtarget)>
92 <!ELEMENT Relation (PName?,%setexpr;, Attr+)>
95 refine (sub|super) #IMPLIED>
97 <!ELEMENT Union (%setexpr;, %setexpr;)>
99 <!ELEMENT Intersect (%setexpr;, %setexpr;)>
101 <!ELEMENT Diff (%setexpr;, %setexpr;)>
103 <!-- MathQL set sub-expressions -->
105 <!ELEMENT In %setexpr;>
107 <!ELEMENT Where %boolexpr;>
109 rvar CDATA #REQUIRED>
111 <!ELEMENT Starget %setexpr;>
113 svar CDATA #REQUIRED>
115 <!ELEMENT Vtarget %setexpr;>
117 vvar CDATA #REQUIRED>
119 <!ELEMENT Attr EMPTY>
121 binder CDATA #REQUIRED>
123 <!ELEMENT PName (CONST+)>
125 <!-- MathQL boolean expressions -->
127 <!ELEMENT BOOL EMPTY>
129 value %bool; #REQUIRED>
131 <!ELEMENT NOT %boolexpr;>
133 <!ELEMENT AND (%boolexpr;, %boolexpr;)>
135 <!ELEMENT OR (%boolexpr;, %boolexpr;)>
137 <!ELEMENT EQ (%stringsetexpr;, %stringsetexpr;)>
139 <!ELEMENT SUB (%stringsetexpr;, %stringsetexpr;)>
141 <!ELEMENT MEET (%stringsetexpr;, %stringsetexpr;)>
143 <!ELEMENT EX %boolexpr;>
145 <!-- MathQL string-set expressions -->
147 <!ELEMENT CONST (#PCDATA)>
149 <!ELEMENT CONSTLIST (CONST*)>
151 <!ELEMENT REFOF %setexpr;>
153 <!ELEMENT VVAR %stringsetexpr;>
155 <!ELEMENT BINDER (Rvar)>
157 name CDATA #REQUIRED>
159 <!ELEMENT FUN %stringsetexpr;>
161 name CDATA #REQUIRED>
163 <!ELEMENT PROPERTY (Refine?,%stringsetexpr;)>
165 name CDATA #REQUIRED>