<query> := <list> (* clausola iniziale *)
<list> := ( <list> ) (* parentesizazione *)
- | <list> UNION <list> (* unione *)
- | <list> INTERSECT <list> (* intersezione *)
- | <list> DIFF <list> (* differenza *)
+ | <rvar> (* lista singoletto var
+ (lista valori) *)
+ | <lvar> (* lista singoletto var
+ (lista valori) *)
+ | REFERENCE <reference> (* oggetto referenziato da
+ pattern costante *)
+ | PATTERN <pattern> (* espansione del pattern *)
| SELECT <rvar> IN <list> WHERE <bool> (* selezione *)
| EXISTS <rvar> IN <list> WHERE <bool> (* esistenziale *)
+ | LET <lvar> BE <list> IN <list> (* assegnazione a var in
+ contesto *)
| USE <list> POSITION <svar> (* unione lista backward *)
| USEDBY <list> POSITION <svar> (* unione lista forward *)
| CONTRUCTORS <list> (* unione costruttori della
lista oggetti*)
- | PATTERN <pattern> (* espansione del pattern *)
- | REFERENCE <reference> (* oggetto referenziato *)
- | INTHEORY <list> ITEMTYPE <svar> (* unione oggetti lista teorie *)
+ | INTHEORY <list> ITEMTYPE <svar> (* unione oggetti lista
+ teorie *)
| THEORYREFTO <list> (* unione teorie che fanno
riferimento a lista oggetti *)
| <list> OFTYPE <svar> (* unione oggetti in base a
- classi *)
+ classi RDF *)
| <list> OFSUPERTYPE <svar> (* unione oggetti in base a
classi e loro superclassi *)
| <list> OFSUBTYPE <svar> (* unione oggetti in base a
classi e loro sottoclassi *)
- | <rvar> (* valore della var*)
+ | <list> UNION <list> (* unione *)
+ | <list> INTERSECT <list> (* intersezione *)
+ | <list> DIFF <list> (* differenza *)
<bool> := ( <bool> ) (* parentesizzazione *)
- | <bool> AND <bool> (* congiunzione *)
- | <bool> OR <bool> (* disgiunzione *)
- | NOT <bool> (* negazione *)
| TRUE (* vero *)
| FALSE (* falso *)
+ | NOT <bool> (* negazione *)
+ | <bool> AND <bool> (* congiunzione *)
+ | <bool> OR <bool> (* disgiunzione *)
| <string> IS <string> (* case sensitive matching *)
| <list> SETEQUAL <list> (* uguaglianza tra liste *)
- | <list> SUBSET <list> (* operazione di sottoinsieme *)
-
-<pattern> := <"-quoted-constant-string> (* pattern costante *)
-<reference> := <'-quoted-constant-string> (* riferimento costante *)
-
+ | <list> SUBSET <list> (* operazione di sottoinsieme *)
+
<string> := <'-quoted-constant-string> (* costante letterale *)
- | CONCLUSION | HYPOTHESIS | BODY (* costanti simboliche *)
- | MAINCONCLUSION | MAINHYPOTHESIS
- | <rvar> (* variabile *)
+ | MAINHYPOTHESIS | HYPOTHESIS (* costanti simboliche *)
+ | MAINCONCLUSION | CONCLUSION | BODY
| <svar> (* variabile *)
+ | <rvar> (* variabile *)
| <function> <rvar> (* applicazione di funzione *)
<function> := NAME (* URIREF -> nome_oggetto *)
- | <property>
+ | <property> (* proprieta' RDF *)
-<property> := THEORY (* URIREF -> valore_Proprieta' *)
- | TITLE (* URIREF -> valore_Prop_DC *)
+<property> := THEORY (* URIREF -> valore_proprieta' *)
+ | TITLE (* URIREF -> valore_prop_DC *)
| CONTRIBUTOR
| CREATOR
| PUBLISHER
| CONTACT
| FIRSTVERSION
| MODIFIED
+ | VALUEOF <propname> (* nome_propr URIREF ->
+ valore_Proprieta' *)
| <refineprop> <property>
<refineprop> := SUB (* proprieta' e sotto-proprieta'
di *)
| SUPER (* proprieta' e super-proprieta'
di *)
+<propname> := <'-quoted-constant-string> (* costante letterale *)
+
+<pattern> := <"-quoted-constant-string> (* pattern costante *)
+<reference> := <'-quoted-constant-string> (* riferimento costante *)
-<rvar> := <not-reserved-identifier> (* variabile per risorse *)
+<rvar> := <not-reserved-identifier> (* variabile per riferimenti *)
<svar> := $ <not-reserved-identifier> (* variabile per stringhe *)
+<lvar> := % <not-reserved-identifier> (* variabile per liste *)
- () = lista vuota (?)
- le stringhe sono "case sensitive"
<!ATTLIST SortField
order %order; #IMPLIED>
- RILASSAMENTO degli operatori UNION e INTERSECT. Operatori fuzzy con
- introduzione di pesi associati ai risultati.
\ No newline at end of file
+ introduzione di pesi associati ai risultati.
+- VALUEOF restituisce il valore o, ricorsivamente sulla struttura, i valori
+ (delle proprieta' delle classi di valori) della proprieta' passatagli.
+ Problema: e' necessario gestire sia i nomi delle classi (costrutti TYPEOF)
+ sia i nomi delle proprieta' (menu a tendina di suggerimenti all'utente in
+ base agli Schemi RDF relativi ai dati).
\ No newline at end of file
<!-- http://cs.unibo.it/helm/. -->
<!--*****************************************************************-->
-<!-- DTD FOR the MATHEMATICAL QUERY MARKUP LANGUAGE (MathQML) -->
+<!-- DTD FOR the MATHEMATICAL QUERY MARKUP LANGUAGE (XMathQL) -->
<!-- First draft: April 2002, Irene Schena -->
<!--*****************************************************************-->
<!-- 3) reusing queries saved in a standard format -->
<!-- The syntax reflects the structure of the grammar productions of -->
<!-- MathQL. -->
-<!-- The %queryexpr parameter entity is used to allow all query -->
-<!-- expression types to occur -->
<!-- Operators are unambiguous (binary or unary), so there isn't any -->
<!-- grouping operator. -->
-<!-- CONST is the constant string. -->
-<!-- The attributes binder and rvar declare variables which are -->
-<!-- referred to and used by means of respectively BINDER and RVAR -->
+<!-- CONST is the constant string; rvar is for references and lvar -->
+<!-- for list. -->
+<!-- The attributes binder, rvar, lvar declare variables which are -->
+<!-- referred to and used by means of respectively BINDER, Rvar and -->
+<!-- RVAR, Lvar and LVAR. -->
+<!-- Rvar (Lvar) is casted to a list, on the contrary the use of RVAR-->
+<!-- (LVAR) is casted to a string. -->
+<!-- PROPERTY works on a specified RDF property returning its value. -->
<!--*****************************************************************-->
-<!ENTITY % position '(Conclusion|Hypothesis|Body|MainConclusion|
- MainHypothesis)'>
+<!ENTITY % position '(MainHypothesis|Hypothesis|MainConclusion|Conclusion|
+ Body)'>
<!ENTITY % bool '(True|False)'>
-<!-- MathQL query expression declaration -->
+<!ENTITY % token '(CONST|STAR|TWOSTARS|SLASH|QUESTIONMARK)'>
-<!ENTITY % queryexpr '(Union|Intersect|Diff|Select|Exists|Use|UsedBy|
- ConstructorsOf|Pattern|InTheory|TheoryRefTo|TypeOf|
- SuperTypeOf|SubTypeOf|Group)'>
+<!-- MathQL list expression declaration -->
+
+<!ENTITY % listexpr '(Rvar|Lvar|Reference|Pattern|Select|Exists|LetIn|
+ Use|UsedBy|ConstructorsOf|InTheory|TheoryRefTo|
+ TypeOf|SuperTypeOf|SubTypeOf|Union|Intersect|Diff)'>
<!-- MathQL boolean expression declaration -->
-<!ENTITY % boolexpr '(AND|OR|NOT|BOOL|IS|GROUP)'>
+<!ENTITY % boolexpr '(BOOL|NOT|AND|OR|IS|SETEQUAL|SUBSET)'>
<!-- MathQL string expression declaration -->
<!ENTITY % stringexpr '(CONST|POSITION|RVAR|BINDER|%functexpr;)'>
-<!-- MathQL top-element -->
+<!-- MathQL query top-element -->
-<!ELEMENT MathQL %queryexpr;>
+<!ELEMENT MQLquery %listexpr;>
-<!-- MathQL query expressions -->
+<!-- MathQL list expressions -->
+<!ELEMENT Rvar EMPTY>
+<!ATTLIST Rvar
+ name CDATA #REQUIRED>
-<!ELEMENT Union (%queryexpr;, %queryexpr;)>
+<!ELEMENT Lvar EMPTY>
+<!ATTLIST Lvar
+ name CDATA #REQUIRED>
-<!ELEMENT Intersect (%queryexpr;, %queryexpr;)>
+<!ELEMENT Reference (RPrefix, RBody, Ext, (RFragmentID?))>
-<!ELEMENT Diff (%queryexpr;, %queryexpr;)>
+<!ELEMENT Pattern (PPrefix, PBody, (Ext?), (PFragmentID?))>
<!ELEMENT Select (In, Where)>
<!ELEMENT Exists (In, Where)>
-<!ELEMENT Use (%queryexpr;, Position)>
-
-<!ELEMENT Position EMPTY>
-<!ATTLIST Position
- binder CDATA #REQUIRED>
-
-<!ELEMENT UsedBy (%queryexpr;, Position)>
+<!ELEMENT LetIn (%listexpr;, Target)>
-<!ELEMENT ConstructorsOf %queryexpr;>
+<!ELEMENT Use (%listexpr;, Position)>
-<!ELEMENT Pattern (Prefix, TokenList, (FragmentID?))>
+<!ELEMENT UsedBy (%listexpr;, Position)>
-<!ELEMENT InTheory (%queryexpr;, ItemType)>
+<!ELEMENT ConstructorsOf %listexpr;>
-<!ELEMENT ItemType EMPTY>
-<!ATTLIST ItemType
- binder CDATA #REQUIRED>
+<!ELEMENT InTheory (%listexpr;, ItemType)>
-<!ELEMENT TheoryRefTo %queryexpr;>
+<!ELEMENT TheoryRefTo %listexpr;>
-<!ELEMENT TypeOf %queryexpr;>
+<!ELEMENT TypeOf %listexpr;>
<!ATTLIST TypeOf
binder CDATA #REQUIRED>
-<!ELEMENT SuperTypeOf %queryexpr;>
+<!ELEMENT SuperTypeOf %listexpr;>
<!ATTLIST SuperTypeOf
binder CDATA #REQUIRED>
-<!ELEMENT SubTypeOf %queryexpr;>
+<!ELEMENT SubTypeOf %listexpr;>
<!ATTLIST SubTypeOf
binder CDATA #REQUIRED>
-<!-- MathQL query sub-expressions -->
+<!ELEMENT Union (%listexpr;, %listexpr;)>
-<!ELEMENT In %queryexpr;>
+<!ELEMENT Intersect (%listexpr;, %listexpr;)>
-<!ELEMENT Where %boolexpr;>
-<!ATTLIST Where
- rvar CDATA #REQUIRED>
+<!ELEMENT Diff (%listexpr;, %listexpr;)>
-<!ELEMENT STAR EMPTY>
+<!-- MathQL list sub-expressions -->
-<!ELEMENT TWOSTARS EMPTY>
+<!ELEMENT RPrefix (CONST)>
-<!ELEMENT SLASH EMPTY>
+<!ELEMENT RBody (CONST)>
-<!ELEMENT QUESTIONMARK EMPTY>
+<!ELEMENT RFragmentID (NUMBER)+>
+
+<!ELEMENT Ext (CONST)>
+
+<!ELEMENT PPrefix (CONST|STAR)>
+
+<!ELEMENT PBody (%token;)+>
+
+<!-- XPointers have max depth = 2 (see CIC inductive definitions) -->
+<!ELEMENT PFragmentID (NUMBER|TWOSTARS|STAR)+>
<!ELEMENT NUMBER EMPTY>
<!ATTLIST NUMBER
value NMTOKEN #REQUIRED>
+<!-- We need SLASH for grouping CONST with QUESTIONMARK -->
+<!ELEMENT SLASH EMPTY>
+
<!-- STAR expands only to objects of the specified dir before the last "/":
ex. cic:/Algebra/* expands to every object in Algebra only -->
+<!ELEMENT STAR EMPTY>
+
<!-- TWOSTARS expands till the most complete name (with extension if not
specifified) -->
+<!ELEMENT TWOSTARS EMPTY>
+
<!-- QUESTIONMARK matches one character except "/" -->
-<!ELEMENT TokenList (CONST|STAR|TWOSTARS|SLASH|QUESTIONMARK)+>
+<!ELEMENT QUESTIONMARK EMPTY>
-<!ELEMENT Prefix (CONST|STAR)>
+<!ELEMENT In %listexpr;>
-<!-- XPointers have max depth = 2 (see CIC inductive definitions) -->
-<!ELEMENT FragmentID (NUMBER|TWOSTARS|STAR)+>
+<!ELEMENT Where %boolexpr;>
+<!ATTLIST Where
+ rvar CDATA #REQUIRED>
+
+<!ELEMENT Target %listexpr;>
+<!ATTLIST Target
+ lvar CDATA #REQUIRED>
+
+<!ELEMENT Position EMPTY>
+<!ATTLIST Position
+ binder CDATA #REQUIRED>
+
+<!ELEMENT ItemType EMPTY>
+<!ATTLIST ItemType
+ binder CDATA #REQUIRED>
<!-- MathQL boolean expressions -->
+<!ELEMENT BOOL EMPTY>
+<!ATTLIST BOOL
+ value %bool; #REQUIRED>
+
+<!ELEMENT NOT %boolexpr;>
+
<!ELEMENT AND (%boolexpr;, %boolexpr;)>
<!ELEMENT OR (%boolexpr;, %boolexpr;)>
-<!ELEMENT NOT %boolexpr;>
-
<!ELEMENT IS (%stringexpr;, %stringexpr;)>
-<!ELEMENT BOOL EMPTY>
-<!ATTLIST BOOL
- value %bool; #REQUIRED>
+<!ELEMENT SETEQUAL (%listexpr;, %listexpr;)>
+
+<!ELEMENT SUBSET (%listexpr;, %listexpr;)>
<!-- MathQL string expressions -->