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|LetIn|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|%functexpr;)'>
69 <!-- MathQL query top-element -->
71 <!ELEMENT MQLquery %setexpr;>
73 <!-- MathQL set expressions -->
83 <!ELEMENT Ref %stringsetexpr;>
85 <!ELEMENT Pattern %stringsetexpr;>
87 <!ELEMENT Select (In, Where)>
89 <!ELEMENT LetIn (%setexpr;, Target)>
91 <!ELEMENT Relation (Refine?,%setexpr;, Attr+)>
94 refine (sub|super) #IMPLIED>
96 <!ELEMENT Union (%setexpr;, %setexpr;)>
98 <!ELEMENT Intersect (%setexpr;, %setexpr;)>
100 <!ELEMENT Diff (%setexpr;, %setexpr;)>
102 <!-- MathQL set sub-expressions -->
104 <!ELEMENT In %setexpr;>
106 <!ELEMENT Where %boolexpr;>
108 rvar CDATA #REQUIRED>
110 <!ELEMENT Target %setexpr;>
112 svar CDATA #REQUIRED>
114 <!ELEMENT Attr EMPTY>
116 binder CDATA #REQUIRED>
118 <!-- MathQL boolean expressions -->
120 <!ELEMENT BOOL EMPTY>
122 value %bool; #REQUIRED>
124 <!ELEMENT NOT %boolexpr;>
126 <!ELEMENT AND (%boolexpr;, %boolexpr;)>
128 <!ELEMENT OR (%boolexpr;, %boolexpr;)>
130 <!ELEMENT EQ (%stringsetexpr;, %stringsetexpr;)>
132 <!ELEMENT SUB (%stringsetexpr;, %stringsetexpr;)>
134 <!ELEMENT MEET (%stringsetexpr;, %stringsetexpr;)>
136 <!ELEMENT EX %boolexpr;>
138 <!-- MathQL string-set expressions -->
140 <!ELEMENT CONST (#PCDATA)>
142 <!ELEMENT CONSTLIST (CONST*)>
144 <!ELEMENT REFOF %setexpr;>
146 <!ELEMENT BINDER (Rvar)>
148 name CDATA #REQUIRED>
150 <!ELEMENT FUN %stringsetexpr;>
152 name CDATA #REQUIRED>
154 <!ELEMENT PROPERTY %stringsetexpr;>
157 refine (sub|super) #IMPLIED>