Commit 5f10c3fe authored by Zoggy's avatar Zoggy
Browse files

remove files; will do a native ocaml library

parent ec2ca0d7
#################################################################################
# OCaml-RDF #
# #
# Copyright (C) 2011 Institut National de Recherche en Informatique #
# et en Automatique. All rights reserved. #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU Lesser General Public License version #
# 2.1 or later as published by the Free Software Foundation. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU Library General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public #
# License along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA #
# 02111-1307 USA #
# #
# Contact: Maxence.Guesdon@inria.fr #
# #
# #
#################################################################################
OCAMLC=ocamlc -g
OCAMLOPT=ocamlopt -g
OCAMLLEX=ocamllex
OCAMLYACC=ocamlyacc
OCAMLDOC=ocamldoc
OCAMLDOCOPT=ocamldoc.opt
CAMLP4O=camlp4o
OCAMLLIB:=`$(OCAMLC) -where`
OCAMLMKLIB=ocamlmklib
INSTALL_DIR=$(DEST_DIR)$(OCAMLLIB)/$(LIB_NAME)
GCC=gcc
C_INCLUDES=-I /opt/librdf/include -I /usr/include -I /usr/include/rasqal -I /usr/include/raptor2 -I $(OCAMLLIB)/caml
C_COMPFLAGS=$(C_INCLUDES)
LIB_LINKFLAGS= -ccopt -L/opt/librdf/lib -cclib -lrdf -cclib -lrasqal -cclib -lraptor2
INCLUDES=-I +ocamldoc
COMPFLAGS=$(INCLUDES) -annot
OCAMLPP=
ADDITIONAL_LIBS=
ADDITIONAL_LIBS_BYTE=
INSTALLDIR=$(OCAMLLIB)/rdf
RM=rm -f
CP=cp -f
MKDIR=mkdir -p
SYSLIBS=
SYSLIBS_BYTE=
LIB_C_FILES= \
wrappers.c \
ml_types.c \
ml_unicode.c \
ml_raptor.c \
ml_rasqal.c \
ml_init.c \
ml_stream.c \
ml_parser.c \
ml_hash.c \
ml_uri.c \
ml_node.c \
ml_statement.c \
ml_iterator.c \
ml_query_results.c \
ml_query.c \
ml_storage.c \
ml_model.c
LIB_O_FILES=$(LIB_C_FILES:.c=.o)
LIB_CMXFILES= \
rdf_pointer.cmx \
rdf_enums.cmx \
rdf_types.cmx \
rdf_unicode.cmx \
rdf_misc.cmx \
rdf_raptor.cmx \
rdf_uri.cmx \
rdf_rasqal.cmx \
rdf_init.cmx \
rdf_parser.cmx \
rdf_hash.cmx \
rdf_node.cmx \
rdf_statement.cmx \
rdf_stream.cmx \
rdf_iterator.cmx \
rdf_query_results.cmx \
rdf_query.cmx \
rdf_storage.cmx \
rdf_model.cmx
LIB_CMOFILES=$(LIB_CMXFILES:.cmx=.cmo)
LIB_CMIFILES=$(LIB_CMXFILES:.cmx=.cmi)
LIB_NAME=ocamlrdf
LIB=$(LIB_NAME).cmxa
LIB_BYTE=$(LIB:.cmxa=.cma)
all: opt byte
opt: lib
byte: lib_byte
enums: ml_enums.c ml_enums.h rdf_enums.ml
lib: enums $(LIB_O_FILES) $(LIB_CMIFILES) $(LIB_CMXFILES)
$(OCAMLMKLIB) -o $(LIB_NAME) $(LIB_O_FILES) $(LIB_CMXFILES) \
$(LIB_LINKFLAGS)
lib_byte: enums $(LIB_O_FILES) $(LIB_CMIFILES) $(LIB_CMOFILES)
$(OCAMLMKLIB) -custom -o $(LIB_NAME) $(LIB_O_FILES) $(LIB_CMOFILES) \
$(LIB_LINKFLAGS)
example: $(LIB) example.ml
$(OCAMLOPT) -verbose -o $@ unix.cmxa $^
example.byte: $(LIB_BYTE) example.ml
$(OCAMLC) -verbose -o $@ unix.cma $^
varcc: varcc.ml4
$(OCAMLC) -o $@ -pp "$(CAMLP4O) -impl" -impl $<
ml_enums.c ml_enums.h rdf_enums.ml: ml_enums.var varcc
./varcc $<
############
doc: dump.odoc odoc_librdf.cmo
$(MKDIR) ocamldoc
$(OCAMLDOC) -load $< -g odoc_librdf.cmo -d ocamldoc -t OCaml-RDF
$(CP) web/style.css rdf.png ocamldoc/
dump.odoc: rdf*.ml
$(OCAMLDOC) $(INCLUDES) rdf*.ml -dump $@
############
install:
$(MKDIR) $(INSTALL_DIR)
$(CP) $(LIB) $(LIB_BYTE) libocamlrdf.a ocamlrdf.a dllocamlrdf.so rdf*.cmi \
$(INSTALL_DIR)
###########
installweb: doc
(cd web && scp index.html style.css zoggy@ocamlcore.org:/home/groups/ocaml-rdf/htdocs/)
scp -r ocamldoc zoggy@ocamlcore.org:/home/groups/ocaml-rdf/htdocs/
############
clean:
$(RM) *.o *.cm* *.annot *.a *.so
$(RM) varcc rdf_enums.ml ml_enums.c ml_enums.h
# headers :
###########
HEADFILES= Makefile *.ml *.c *.h examples/*.ml
headers: dummy
echo $(HEADFILES)
headache -h header -c .headache_config `ls $(HEADFILES) `
noheaders: dummy
headache -r -c .headache_config `ls $(HEADFILES) `
dummy:
#############
.SUFFIXES: .mli .ml .cmi .cmo .cmx .cmxs .mll .mly .o .c
%.cmi:%.mli
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
%.cmo:%.ml
if test -f `dirname $<`/`basename $< .ml`.mli && test ! -f `dirname $<`/`basename $< .ml`.cmi ; then \
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c `dirname $<`/`basename $< .ml`.mli; fi
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
%.cmi %.cmo:%.ml
if test -f `dirname $<`/`basename $< .ml`.mli && test ! -f `dirname $<`/`basename $< .ml`.cmi ; then \
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c `dirname $<`/`basename $< .ml`.mli; fi
$(OCAMLC) $(OCAMLPP) $(COMPFLAGS) -c $<
%.cmx %.o:%.ml
$(OCAMLOPT) $(OCAMLPP) $(COMPFLAGS) -c $<
%.cmxs: %.ml
$(OCAMLOPT) -shared -o $@ $(OCAMLPP) $(COMPFLAGS) $<
%.o: %.c
$(OCAMLOPT) -ccopt -finstrument-functions $(COMPFLAGS) -c $< && $(MV) `basename $@` `dirname $@`
%.ml:%.mll
$(OCAMLLEX) $<
%.mli %.ml:%.mly
$(OCAMLYACC) -v $<
%.o: %.c
$(OCAMLC) $(C_INCLUDES) -c $<
.PHONY: clean depend
.depend depend:
ocamldep *.ml > .depend
include .depend
\ No newline at end of file
- check functions used to copy utf8-string
(Val_string, and so on)
(*********************************************************************************)
(* OCaml-RDF *)
(* *)
(* Copyright (C) 2011 Institut National de Recherche en Informatique *)
(* et en Automatique. All rights reserved. *)
(* *)
(* This program is free software; you can redistribute it and/or modify *)
(* it under the terms of the GNU Lesser General Public License version *)
(* 2.1 or later as published by the Free Software Foundation. *)
(* *)
(* This program is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU Library General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU Lesser General Public *)
(* License along with this program; if not, write to the Free Software *)
(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *)
(* 02111-1307 USA *)
(* *)
(* Contact: Maxence.Guesdon@inria.fr *)
(* *)
(* *)
(*********************************************************************************)
(** Example *)
let loop () =
prerr_endline "loop";
for i = 0 to 100000 do ignore(Unix.stat "/tmp")done;
prerr_endline "end of loop"
;;
let test_hash world =
let hash = Rdf_hash.new_from_string world ~name: "memory" ~string: "y='1'" in
Rdf_hash.put_strings hash ~key: "x" ~value: "2";
match Rdf_hash.get hash "y" with
None -> prerr_endline "NULL"
| Some s -> prerr_endline (Printf.sprintf "y=%s" s)
;;
let x =
let rasqal = Rdf_rasqal.new_world () in
let _ =
let raptor = Rdf_raptor.new_world () in
prerr_endline (Printf.sprintf "raptor address: %s"
(Nativeint.to_string (Rdf_raptor.Raw.pointer_of_world raptor)));
Rdf_rasqal.world_set_raptor rasqal (Some raptor) ;
loop();
ignore(raptor);
let world = Rdf_init.new_world () in
Rdf_init.open_world world;
Rdf_init.set_rasqal world (Some rasqal);
Rdf_init.init_mutex world;
Rdf_init.set_digest world "hello";
test_hash world;
let statement =
Rdf_statement.new_from_nodes world
(Rdf_node.new_from_uri_string world "http://www.dajobe.org/")
(Rdf_node.new_from_uri_string world "http://purl.org/dc/elements/1.1/creator")
(Rdf_node.new_from_literal world "Dave Beckett")
in
()
in
let foo =
let raptor = Rdf_rasqal.world_get_raptor rasqal in
match raptor with
None -> prerr_endline "No raptor !"
| Some r ->
prerr_endline
(Printf.sprintf "OK: there is a raptor; address is %s"
(Nativeint.to_string (Rdf_raptor.Raw.pointer_of_world r))
);
in
()
;;
loop();;
let () = ignore(x);;
let rasqal = ();;
loop();;
loop();;
OCaml-RDF
Copyright (C) 2011 Institut National de Recherche en Informatique
et en Automatique. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version
2.1 or later as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
Contact: Maxence.Guesdon@inria.fr
package "rdf"
type node_type = "LIBRDF_NODE_TYPE_"
[ `UNKNOWN | `RESOURCE | `LITERAL | `BLANK | `LAST ]
type get_method_flags = "LIBRDF_ITERATOR_GET_METHOD_"
[ `GET_OBJECT | `GET_CONTEXT | `GET_KEY | `GET_VALUE ]
\ No newline at end of file
/*********************************************************************************/
/* OCaml-RDF */
/* */
/* Copyright (C) 2011 Institut National de Recherche en Informatique */
/* et en Automatique. All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License version */
/* 2.1 or later as published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
/* 02111-1307 USA */
/* */
/* Contact: Maxence.Guesdon@inria.fr */
/* */
/* */
/*********************************************************************************/
/* */
#include "ml_hash.h"
Make_Val_final_pointer(librdf_hash, Ignore, Ignore, 0)
/*
ML_2 (librdf_new_hash, Librdf_world_val, String_val, Val_option_librdf_hash)
*/
ML_1 (librdf_new_hash_from_hash, Librdf_hash_val, Val_option_librdf_hash)
ML_3 (librdf_new_hash_from_string, Librdf_world_val, String_val, String_val, Val_option_librdf_hash)
ML_1 (librdf_free_hash, Librdf_hash_val, Unit)
ML_2 (librdf_hash_get, Librdf_hash_val, String_val, Val_option_string_free)
ML_2 (librdf_hash_get_as_boolean, Librdf_hash_val, String_val, Val_int)
ML_2 (librdf_hash_get_as_long, Librdf_hash_val, String_val, Val_long)
ML_2 (librdf_hash_get_del, Librdf_hash_val, String_val, Val_string_free)
ML_3 (librdf_hash_put_strings, Librdf_hash_val, String_val, String_val, Val_int)
ML_4 (librdf_hash_interpret_template, UString_val, Librdf_hash_val, UString_val, UString_val, Val_ustring)
ML_2 (librdf_hash_from_string, Librdf_hash_val, String_val, Val_int)
/*
ML_2 (librdf_hash_to_string, Librdf_hash_val, ???, Val_string_free)
*/
/*
void librdf_hash_print (librdf_hash *hash,
FILE *fh);
void librdf_hash_print_keys (librdf_hash *hash,
FILE *fh);
void librdf_hash_print_values (librdf_hash *hash,
const char *key_string,
FILE *fh);
librdf_hash * librdf_new_hash_from_array_of_strings
(librdf_world *world,
const char *name,
const char **array);
*/
/*********************************************************************************/
/* OCaml-RDF */
/* */
/* Copyright (C) 2011 Institut National de Recherche en Informatique */
/* et en Automatique. All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License version */
/* 2.1 or later as published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
/* 02111-1307 USA */
/* */
/* Contact: Maxence.Guesdon@inria.fr */
/* */
/* */
/*********************************************************************************/
/* */
#include <librdf.h>
#include "ml_types.h"
#ifndef ML_HASH
#define ML_HASH
#endif
\ No newline at end of file
/*********************************************************************************/
/* OCaml-RDF */
/* */
/* Copyright (C) 2011 Institut National de Recherche en Informatique */
/* et en Automatique. All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License version */
/* 2.1 or later as published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
/* 02111-1307 USA */
/* */
/* Contact: Maxence.Guesdon@inria.fr */
/* */
/* */
/*********************************************************************************/
/* */
#include <librdf.h>
#include "wrappers.h"
#include "ml_init.h"
#include "ml_rasqal.h"
Make_Val_final_pointer(librdf_world, Ignore, Ignore, 0)
ML_0 (librdf_new_world, Val_option_librdf_world)
ML_1 (librdf_free_world, Librdf_world_val, Unit)
ML_1 (librdf_world_open, Librdf_world_val, Unit)
ML_2 (librdf_world_set_rasqal, Librdf_world_val, Rasqal_world_option_val, Unit)
ML_1 (librdf_world_get_rasqal, Librdf_world_val, Val_option_rasqal_world)
ML_1 (librdf_world_init_mutex, Librdf_world_val, Unit)
ML_2 (librdf_world_set_digest, Librdf_world_val, String_val, Unit)
/*
void librdf_world_set_error (librdf_world *world,
void *user_data,
librdf_log_level_func error_handler);
void librdf_world_set_warning (librdf_world *world,
void *user_data,
librdf_log_level_func warning_handler);
void librdf_world_set_logger (librdf_world *world,
void *user_data,
librdf_log_func log_handler);
#define LIBRDF_WORLD_FEATURE_GENID_BASE
#define LIBRDF_WORLD_FEATURE_GENID_COUNTER
librdf_node * librdf_world_get_feature (librdf_world *world,
librdf_uri *feature);
int librdf_world_set_feature (librdf_world *world,
librdf_uri *feature,
librdf_node *value);
*/
/*********************************************************************************/
/* OCaml-RDF */
/* */
/* Copyright (C) 2011 Institut National de Recherche en Informatique */
/* et en Automatique. All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License version */
/* 2.1 or later as published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
/* 02111-1307 USA */
/* */
/* Contact: Maxence.Guesdon@inria.fr */
/* */
/* */
/*********************************************************************************/
/* */
#include "ml_types.h"
#ifndef ML_INIT
#define ML_INIT
#endif
/*********************************************************************************/
/* OCaml-RDF */
/* */
/* Copyright (C) 2011 Institut National de Recherche en Informatique */
/* et en Automatique. All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License version */
/* 2.1 or later as published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
/* 02111-1307 USA */
/* */
/* Contact: Maxence.Guesdon@inria.fr */
/* */
/* */
/*********************************************************************************/
/* */
#include "ml_iterator.h"
Make_Val_final_pointer(librdf_iterator, Ignore, Ignore, 0)
ML_1 (librdf_free_iterator, Librdf_iterator_val, Unit)
ML_1 (librdf_iterator_end, Librdf_iterator_val, Val_bool)
ML_1 (librdf_iterator_next, Librdf_iterator_val, Val_bool)
ML_1 (librdf_iterator_get_object, Librdf_iterator_val, Val_option_void)
ML_1 (librdf_iterator_get_context, Librdf_iterator_val, Val_option_void)
ML_1 (librdf_iterator_get_key, Librdf_iterator_val, Val_option_void)
ML_1 (librdf_iterator_get_value, Librdf_iterator_val, Val_option_void)
/*********************************************************************************/
/* OCaml-RDF */
/* */
/* Copyright (C) 2011 Institut National de Recherche en Informatique */
/* et en Automatique. All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License version */
/* 2.1 or later as published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
/* 02111-1307 USA */
/* */
/* Contact: Maxence.Guesdon@inria.fr */
/* */
/* */
/*********************************************************************************/
/* */
#include <librdf.h>
#include "ml_types.h"
#ifndef ML_ITERATOR
#define ML_ITERATOR
#endif
\ No newline at end of file
/*********************************************************************************/
/* OCaml-RDF */
/* */
/* Copyright (C) 2011 Institut National de Recherche en Informatique */
/* et en Automatique. All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License version */
/* 2.1 or later as published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Library General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public */
/* License along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
/* 02111-1307 USA */
/* */
/* Contact: Maxence.Guesdon@inria.fr */
/* */
/* */
/*********************************************************************************/