(******************************************************************************)
+(* 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 *)
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 refine = RefineExact
+ | RefineSub
+ | RefineSuper
-type vvar_list = vvar list
+type assign = path * path
type set_exp = SVar of svar
| RVar of rvar
| Ref of val_exp
| Pattern of val_exp
- | Relation of refine_op * path * set_exp * vvar_list
+ | Relation of inverse * refine * path * set_exp * assign list
| Select of rvar * set_exp * boole_exp
| Union of set_exp * set_exp
| Intersect of set_exp * set_exp
and val_exp = Const of string list
| RefOf of set_exp
- | Record of rvar * vvar
+ | Record of rvar * path
| VVar of vvar
+ | Property of inverse * refine * path * val_exp
| Fun of string * val_exp
- | Attribute of refine_op * path * bool * 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