]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql/mathQL.ml
structurated attribute names added
[helm.git] / helm / ocaml / mathql / mathQL.ml
index 71682f2a0792a34788b60140401ccda2728faa3f..04eb3b32d30e7900e854dd2cec055d81f5bcc346 100644 (file)
 (******************************************************************************)
 
 
+(* output data structures ***************************************************)
+
+type path            = string * (string list) (* the name of an attribute *)
+
+type value           = string list            (* the value of an attribute *)
+
+type attribute       = path * value           (* an attribute *)
+
+type attribute_group = attribute list         (* a group of attributes *)
+
+type attribute_set   = attribute_group list   (* the attributes of an URI *)
+
+type resource        = string * attribute_set (* an attributed URI *)
+
+type resource_set    = resource list          (* the query result *)
+
+type result = resource_set
+
+
 (* input data structures ****************************************************)
 
 type svar = string (* the name of a variable for a resource set *)
@@ -43,19 +62,17 @@ type rvar = string (* the name of a variable for a resource *)
 
 type vvar = string (* the name of a variable for an attribute value *)
 
-type refine_op = ExactOp
-               | SubOp
-              | SuperOp
+type inverse = bool 
 
-type path = string list
-
-type vvar_list = vvar list
+type refine = RefineExact
+            | RefineSub
+           | RefineSuper
 
 type set_exp = SVar of svar
             | RVar of rvar
              | Ref of val_exp
              | Pattern of val_exp
-            | Relation of bool * refine_op * path * set_exp * vvar_list
+            | Relation of inverse * refine * path * set_exp * string list
              | Select of rvar * set_exp * boole_exp
             | Union of set_exp * set_exp
             | Intersect of set_exp * set_exp
@@ -75,26 +92,9 @@ and boole_exp = False
               
 and val_exp = Const of string list 
             | RefOf of set_exp 
-           | Record of rvar * vvar
+           | Record of rvar * path
            | VVar of vvar
-           | Attribute of bool * refine_op * path * val_exp
+           | Attribute of inverse * refine * path * val_exp
            | Fun of string * val_exp
 
 type query = set_exp
-
-
-(* output data structures ***************************************************)
-
-type value           = string list            (* the value of an attribute *)
-
-type attribute       = string * value         (* an attribute *)
-
-type attribute_group = attribute list         (* a group of attributes *)
-
-type attribute_set   = attribute_group list   (* the attributes of an URI *)
-
-type resource        = string * attribute_set (* an attributed URI *)
-
-type resource_set    = resource list          (* the query result *)
-
-type result = resource_set