1 (* Copyright (C) 2000, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://cs.unibo.it/helm/.
36 if (p = "refObj") then "F"
41 * implementazione delle funzioni dublin core
43 let rec property_ex rop path inv = function
45 | s::tl -> let mprop = fst path in
47 let prop = List.hd (snd path) in
50 "refObj" (* in base al valore di prop restituisco i valori del relativo campo della tabella relativa all'uri rappresentata da s *)
53 let mpid = getpid mprop in
56 let tv = pgresult_to_string (c#exec ("select id from registry where uri='" ^ s ^ "'")) in
57 let q = "select t" ^ tv ^ "." ^ prop ^ " from t" ^ tv ^ " where prop_id= '" ^ mpid ^ "'" in
59 pgresult_to_string_list (c#exec q)
61 append (res,(property_ex rop path inv tl))
63 (*Rimane da capire cosa restituire nelle inverse!!!!*)
68 if inv then (* restituisco gli uri che il valore della prop richiesta uguale a s *)
71 let q = ("select h" ^ mprop ^ ".uri from h" ^ mprop ^ " where h" ^ mprop ^ "." ^ prop ^ "= '" ^ s ^ "'") in
73 pgresult_to_string_list (c#exec q)
75 append (res,(property_ex rop path inv tl))
78 let res = (* restituisco il valore della prop relativo all'uri rappresentato da s*)
80 let q = ("select h" ^ mprop ^ "." ^ prop ^" from h" ^ mprop ^ " where h" ^ mprop ^ ".uri = '" ^ s ^ "'") in
81 pgresult_to_string_list (c#exec q)
83 append (res,(property_ex rop path inv tl))
87 | _ -> (* metadati DC !!!! Controllare se i nomi delle tabelle cominciano con h !!!!*)
91 let q = ("select " ^ mprop ^ ".uri from " ^ mprop ^ " where " ^ mprop ^ ".value = '" ^ s ^ "'") in
92 pgresult_to_string_list (c#exec q)
94 append (res,(property_ex rop path inv tl))
98 let q = ("select " ^ mprop ^ ".value from " ^ mprop ^ " where " ^ mprop ^ ".uri = '" ^ s ^ "'") in
99 pgresult_to_string_list (c#exec q)
101 append (res,(property_ex rop path inv tl))