]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_interpreter/relation.ml
structurated attribute names added
[helm.git] / helm / ocaml / mathql_interpreter / relation.ml
index 94dc10870475c468bdcfc8701c675a96a7d098ea..57b89122e1922132a0e09d84fc48acec16c4aa32 100644 (file)
@@ -39,7 +39,7 @@ open Utility;;
 
 
 let get_prop_id propl =
-  let prop = List.hd propl in
+  let prop = fst propl in
   if prop="refObj" then "F"
   else if prop="backPointer" then "B"
        else assert false
@@ -47,8 +47,6 @@ let get_prop_id propl =
 
 
 let relation_ex rop path rset attl =
-  if path = [] then []
-  else
   let usek = get_prop_id path in
   let vvar = if attl = [] then "position"
              else List.hd attl
@@ -61,7 +59,7 @@ let relation_ex rop path rset attl =
     let res = c#exec qq in
     (List.map
     (function 
-         [uri;context] -> [(uri,[[(vvar,[context])]])]
+         [uri;context] -> [(uri,[[((vvar, []),[context])]])]
        | _ -> assert false ) 
        res#get_list) @ acc
                  )                   
@@ -103,20 +101,18 @@ let tofname uri =
 let rec rsetl uril vvar = 
     match uril with                   
     | uri::tl -> let scuri = (*tofname*) uri in
-                   [(scuri, [[(vvar, [(List.hd tl)])]])]::(rsetl (List.tl tl) vvar)
+                   [(scuri, [[((vvar, []), [(List.hd tl)])]])]::(rsetl (List.tl tl) vvar)
     | [] -> [] 
 
 
 (* prende una resource e una vvar e  restituisce la lista delle resource in relazione (refObj o backPointer in base al parametro "path") con tale resource e associa alla proprieta' il nome della vvar contenuto in "attl" *)
 let muse path attl r =
-    if path = [] then []
-    else 
         let vvar = if attl = [] then "position"
                    else List.hd attl
         in         
         let uri = fst r in
        let furi = tofname uri in
-        let dtag = List.hd path in
+        let dtag = fst path in
         let dir =
           match dtag with
               "refObj" -> "/projects/helm/metadata/create4/forward"