Skip to content

Commit 15dd8f5

Browse files
committedJan 5, 2011
Kill support for Raptor V1
1 parent c5183b7 commit 15dd8f5

39 files changed

+37
-1518
lines changed
 

‎INSTALL.html

-12
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,6 @@ <h3>2.2 Options for <tt>configure</tt></h3>
160160
</p>
161161
</dd>
162162

163-
<dt><tt>--enable-raptor2</tt><br /></dt>
164-
<dd><p>Build raptor against the
165-
beta <a href="http://librdf.org/raptor/">Raptor</a>
166-
V2 APIs (libraptor2) rather than the default V1 APIs (libraptor). This
167-
is a developer option for testing against the raptor 2 beta APIs. In
168-
some future version, this will be the default and rasqal will depend
169-
on raptor2. When rasqal is built in this way and librdf is built
170-
against it, librdf also has to be built with a configure
171-
<code>--enable-raptor</code> option.
172-
</p>
173-
</dd>
174-
175163
<dt><tt>--with-memory-signing</tt><br /></dt>
176164
<dd><p>Enable signing of memory allocations so that when memory is
177165
allocated with malloc() and released free(), a check is made that the

‎configure.ac

+11-111
Original file line numberDiff line numberDiff line change
@@ -305,110 +305,29 @@ if test $have_tm_gmtoff = "yes" ; then
305305
fi
306306

307307

308-
# raptor is REQUIRED despite the checking here
309-
RAPTOR_MIN_VERSION=1.4.19
310-
RAPTOR_MAX_VERSION=1.8.99
311-
RAPTOR2_MIN_VERSION=1.9.2
308+
# raptor V2 is REQUIRED; --enable-raptor2 option was removed
309+
RAPTOR_MIN_VERSION=1.9.2
312310

313-
raptor2=no
314-
AC_ARG_ENABLE(raptor2, [ --enable-raptor2 Enable use of raptor2], raptor2="$enableval", raptor2="no")
315-
316-
AC_SUBST(RAPTOR_MIN_VERSION)
317-
AC_SUBST(RAPTOR_MAX_VERSION)
318311

319312
AC_CHECK_PROGS(PKG_CONFIG, pkg-config)
320313
if test "X$PKG_CONFIG" = X; then
321-
AC_MSG_WARN(pkg-config not found. configuring raptor 2.0 will require it. Get it from http://pkg-config.freedesktop.org/)
314+
AC_MSG_ERROR(pkg-config not found. configuring raptor V2 requires it. Get it from http://pkg-config.freedesktop.org/)
322315
fi
323316

324317
AC_MSG_CHECKING(for raptor)
325-
RAPTOR_VERSION_DEC=0
326-
if test "X$PKG_CONFIG" != X; then
327-
# When raptor2 is stable, this can be changed to prefer raptor2
328-
# For now an explicit configure --enable-raptor2 is required.
329-
if test "X$raptor2" = "Xyes"; then
330-
RAPTOR_MIN_VERSION=$RAPTOR2_MIN_VERSION
331-
332-
if $PKG_CONFIG raptor2 --exists; then
333-
RAPTOR_CONFIG="$PKG_CONFIG raptor2"
334-
RAPTOR_PACKAGE="raptor2"
335-
else
336-
AC_MSG_ERROR(Raptor2 is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION)
337-
fi
338-
else
339-
if $PKG_CONFIG raptor --exists; then
340-
if $PKG_CONFIG raptor --atleast-version=$RAPTOR_MIN_VERSION --max-version=$RAPTOR_MAX_VERSION; then
341-
RAPTOR_CONFIG="$PKG_CONFIG raptor"
342-
RAPTOR_PACKAGE="raptor"
343-
else
344-
AC_MSG_ERROR(Installed raptor $RAPTOR_VERSION is not in supported range - $RAPTOR_MIN_VERSION to $RAPTOR_MAX_VERSION)
345-
fi
346-
else
347-
AC_MSG_ERROR(Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION)
348-
fi
349-
fi
350318

351-
with_raptor=system
352-
RAPTOR_VERSION=`$RAPTOR_CONFIG --modversion 2>/dev/null`
319+
if $PKG_CONFIG raptor2 --exists; then
320+
RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
353321
RAPTOR_VERSION_DEC=`echo $RAPTOR_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
322+
AC_MSG_RESULT(system $RAPTOR_VERSION)
354323
else
355-
# otherwise use raptor-config for raptor V1 only
356-
raptor2=no
357-
AC_CHECK_PROG(RAPTOR_CONFIG, raptor-config, raptor-config)
358-
AC_ARG_WITH(raptor, [ --with-raptor=SOURCE Pick raptor source - system/internal (default auto)], with_raptor="$withval", with_raptor="auto")
359-
360-
if test "X$RAPTOR_CONFIG" = X; then
361-
with_raptor=internal
362-
else
363-
RAPTOR_VERSION=`$RAPTOR_CONFIG --version 2>/dev/null`
364-
365-
RAPTOR_VERSION_DEC=`$RAPTOR_CONFIG --version-decimal 2>/dev/null`
366-
RAPTOR_MIN_VERSION_DEC=`echo $RAPTOR_MIN_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
367-
RAPTOR_MAX_VERSION_DEC=`echo $RAPTOR_MAX_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
368-
369-
if test "X$with_raptor" = Xauto; then
370-
if test "X$RAPTOR_VERSION" != X -a $RAPTOR_VERSION_DEC -ge $RAPTOR_MIN_VERSION_DEC -a $RAPTOR_VERSION_DEC -le $RAPTOR_MAX_VERSION_DEC; then
371-
with_raptor=system
372-
else
373-
AC_MSG_WARN(System raptor $RAPTOR_VERSION is not in supported range - $RAPTOR_MIN_VERSION to $RAPTOR_MAX_VERSION)
374-
with_raptor=internal
375-
fi
376-
elif test $with_raptor = system; then
377-
if test $RAPTOR_VERSION_DEC -lt $RAPTOR_MIN_VERSION_DEC -o $RAPTOR_VERSION_DEC -gt $RAPTOR_MAX_VERSION_DEC; then
378-
AC_MSG_WARN(System raptor $RAPTOR_VERSION is not in supported range - $RAPTOR_MIN_VERSION to $RAPTOR_MAX_VERSION)
379-
AC_MSG_WARN(Proceeding anyway since --with-raptor=system was given)
380-
AC_MSG_WARN(To use the internal raptor use --with-raptor=internal)
381-
AC_MSG_WARN(or omit any --with-raptor argument.)
382-
fi
383-
fi
324+
AC_MSG_RESULT(not found)
384325

385-
unset RAPTOR_MIN_VERSION_DEC RAPTOR_MAX_VERSION_DEC
386-
fi
387-
RAPTOR_PACKAGE="raptor"
326+
AC_MSG_ERROR(Raptor V2 is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION)
388327
fi
389-
AC_SUBST(with_raptor)
390-
AC_SUBST(RAPTOR_PACKAGE)
391328

392-
if test $with_raptor = system; then
393-
AC_MSG_RESULT(system $RAPTOR_VERSION)
394-
else
395-
RAPTOR_VERSION=internal
396-
AC_MSG_RESULT(internal)
397-
if test ! -r $srcdir/../raptor/src/raptor_general.c; then
398-
AC_MSG_ERROR(Raptor sources missing from $srcdir/../raptor directory - cannot use internal)
399-
fi
400-
fi
401329
AC_SUBST(RAPTOR_VERSION_DEC)
402330

403-
AM_CONDITIONAL(RAPTOR2, test "X$raptor2" = "Xyes")
404-
if test "X$raptor2" = "Xyes"; then
405-
AC_DEFINE(HAVE_RAPTOR2_API, 1, [Raptor2 API is available])
406-
HAVE_RAPTOR2_API=1
407-
else
408-
HAVE_RAPTOR2_API=0
409-
fi
410-
AC_SUBST(HAVE_RAPTOR2_API)
411-
412331

413332
AC_CHECK_PROG(REDLAND_CONFIG, redland-config, redland-config)
414333
AC_ARG_WITH(redland-config, [ --with-redland-config=PATH Location of redland redland-config ()], redland_config="$withval", redland_config="")
@@ -750,28 +669,9 @@ AC_MSG_RESULT($query_engine_version)
750669
AC_DEFINE_UNQUOTED(RASQAL_QUERY_ENGINE_VERSION, $query_engine_version, [Query engine version])
751670

752671

753-
if test $with_raptor = internal; then
754-
RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS -I\$(top_srcdir)/../raptor/src"
755-
RASQAL_INTERNAL_LIBS="$RASQAL_INTERNAL_LIBS \$(top_builddir)/../raptor/src/libraptor.la"
756-
RAPPER_PATH=":\$(top_srcdir)/../raptor/utils"
757-
else
758-
RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS `$RAPTOR_CONFIG --cflags`"
759-
RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS `$RAPTOR_CONFIG --libs`"
760-
RAPPER_PATH=""
761-
fi
762-
763-
764-
oLIBS="$LIBS"
765-
LIBS="$LIBS $RASQAL_EXTERNAL_LIBS"
766-
# FIXME remove these raptor checks when RAPTOR2_MIN_VERSION increases
767-
# raptor_stringbuffer_append_hexadecimal() is in raptor2 >1.9.0
768-
AC_CHECK_FUNC(raptor_stringbuffer_append_uri_escaped_counted_string, have_rsauecs=yes, have_rsauecs=no)
769-
LIBS="$oLIBS"
770-
771-
if test "X$have_rsauecs" = Xyes; then
772-
AC_DEFINE(RAPTOR_STRINGBUFFER_APPEND_URI_ESCAPED_COUNTED_STRING, 1, [Have raptor_stringbuffer_append_uri_escaped_counted_string()])
773-
fi
774-
672+
RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS `$PKG_CONFIG raptor2 --cflags`"
673+
RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS `$PKG_CONFIG raptor2 --libs`"
674+
RAPPER_PATH=""
775675

776676
if test $need_regex_pcre = 1; then
777677
C=`$PCRE_CONFIG --cflags`

‎rasqal.pc.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ exec_prefix=@exec_prefix@
33
libdir=@libdir@
44
includedir=@includedir@/@PACKAGE@
55

6-
have_raptor2_api=@HAVE_RAPTOR2_API@
6+
have_raptor2_api=1
77

88
Name: Rasqal RDF Query Library
99
Description: Rasqal RDF Query parsing and execution library
10-
Requires: @RAPTOR_PACKAGE@ >= @RAPTOR_MIN_VERSION@
10+
Requires: raptor2 >= @RAPTOR_MIN_VERSION@
1111
Requires.private: @PKGCONFIG_REQUIRES@
1212
Version: @VERSION@
1313
Libs: -L${libdir} -lrasqal

‎src/rasqal.h.in

+9-10
Original file line numberDiff line numberDiff line change
@@ -971,20 +971,16 @@ void rasqal_world_set_raptor(rasqal_world* world, raptor_world* raptor_world_ptr
971971
RASQAL_API
972972
raptor_world *rasqal_world_get_raptor(rasqal_world* world);
973973

974-
#if @HAVE_RAPTOR2_API@
975974
RASQAL_API
976975
void rasqal_world_set_log_handler(rasqal_world* world, void *user_data, raptor_log_handler handler);
977-
#endif
978976

979977
RASQAL_API
980978
int rasqal_world_set_default_generate_bnodeid_parameters(rasqal_world* world, char *prefix, int base);
981979
RASQAL_API
982980
int rasqal_world_set_generate_bnodeid_handler(rasqal_world* world, void *user_data, rasqal_generate_bnodeid_handler2 handler);
983981

984-
#if @HAVE_RAPTOR2_API@
985982
RASQAL_API
986983
const raptor_syntax_description* rasqal_world_get_query_results_format_description(rasqal_world* world, unsigned int counter);
987-
#endif
988984

989985
RASQAL_API
990986
const char* rasqal_world_guess_query_results_format_name(rasqal_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier);
@@ -1022,15 +1018,18 @@ const char* rasqal_query_get_name(rasqal_query* query);
10221018
RASQAL_API
10231019
const char* rasqal_query_get_label(rasqal_query* query);
10241020

1025-
/* on raptor2: use rasqal_world_set_log_handler() instead of these */
1026-
#if @HAVE_RAPTOR2_API@
1021+
/* This is a typedef to let these deprecated API work with raptor2
1022+
* which removed this typedef and changed the way error handling was
1023+
* done. Use rasqal_world_set_log_handler() on the world class
1024+
* instead of these functions.
1025+
*/
10271026
typedef void* raptor_message_handler;
1028-
#endif
1029-
RASQAL_API
1027+
1028+
RASQAL_API RASQAL_DEPRECATED
10301029
void rasqal_query_set_fatal_error_handler(rasqal_query* query, void *user_data, raptor_message_handler handler);
1031-
RASQAL_API
1030+
RASQAL_API RASQAL_DEPRECATED
10321031
void rasqal_query_set_error_handler(rasqal_query* query, void *user_data, raptor_message_handler handler);
1033-
RASQAL_API
1032+
RASQAL_API RASQAL_DEPRECATED
10341033
void rasqal_query_set_warning_handler(rasqal_query* query, void *user_data, raptor_message_handler handler);
10351034

10361035
RASQAL_API

‎src/rasqal_algebra.c

-25
Original file line numberDiff line numberDiff line change
@@ -1398,13 +1398,8 @@ rasqal_algebra_get_variables_mentioned_in(rasqal_query* query,
13981398
short *row;
13991399
int i;
14001400

1401-
#ifdef HAVE_RAPTOR2_API
14021401
seq = raptor_new_sequence((raptor_data_free_handler)rasqal_free_variable,
14031402
(raptor_data_print_handler)rasqal_variable_print);
1404-
#else
1405-
seq = raptor_new_sequence((raptor_sequence_free_handler*)rasqal_free_variable,
1406-
(raptor_sequence_print_handler*)rasqal_variable_print);
1407-
#endif
14081403
if(!seq)
14091404
return NULL;
14101405

@@ -1591,22 +1586,12 @@ rasqal_algebra_extract_aggregate_expressions(rasqal_query* query,
15911586
/* flags */ 0);
15921587

15931588
/* Sequence to hold list of aggregate expressions */
1594-
#ifdef HAVE_RAPTOR2_API
15951589
seq = raptor_new_sequence((raptor_data_free_handler)rasqal_free_expression,
15961590
(raptor_data_print_handler)rasqal_expression_print);
1597-
#else
1598-
seq = raptor_new_sequence((raptor_sequence_free_handler*)rasqal_free_expression,
1599-
(raptor_sequence_print_handler*)rasqal_expression_print);
1600-
#endif
16011591
ae->agg_exprs = seq;
16021592

1603-
#ifdef HAVE_RAPTOR2_API
16041593
seq = raptor_new_sequence((raptor_data_free_handler)rasqal_free_variable,
16051594
(raptor_data_print_handler)rasqal_variable_print);
1606-
#else
1607-
seq = raptor_new_sequence((raptor_sequence_free_handler*)rasqal_free_variable,
1608-
(raptor_sequence_print_handler*)rasqal_variable_print);
1609-
#endif
16101595
ae->agg_vars_seq = seq;
16111596

16121597
/* init internal variable counter */
@@ -1997,13 +1982,8 @@ rasqal_algebra_query_add_projection(rasqal_query* query,
19971982
if(seq)
19981983
vars_size = raptor_sequence_size(seq);
19991984

2000-
#ifdef HAVE_RAPTOR2_API
20011985
vars_seq = raptor_new_sequence((raptor_data_free_handler)rasqal_free_variable,
20021986
(raptor_data_print_handler)rasqal_variable_print);
2003-
#else
2004-
vars_seq = raptor_new_sequence((raptor_sequence_free_handler*)rasqal_free_variable,
2005-
(raptor_sequence_print_handler*)rasqal_variable_print);
2006-
#endif
20071987
if(!vars_seq) {
20081988
rasqal_free_algebra_node(node);
20091989
return NULL;
@@ -2339,13 +2319,8 @@ main(int argc, char *argv[]) {
23392319
/* This is an artificial order conditions sequence equivalent to
23402320
* ORDER BY 1, 2 which would probably never appear in a query.
23412321
*/
2342-
#ifdef HAVE_RAPTOR2_API
23432322
conditions = raptor_new_sequence((raptor_data_free_handler)rasqal_free_expression,
23442323
(raptor_data_print_handler)rasqal_expression_print);
2345-
#else
2346-
conditions = raptor_new_sequence((raptor_sequence_free_handler*)rasqal_free_expression,
2347-
(raptor_sequence_print_handler*)rasqal_expression_print);
2348-
#endif
23492324
if(!conditions)
23502325
FAIL;
23512326
lit3 = rasqal_new_integer_literal(world, RASQAL_LITERAL_INTEGER, 1);

‎src/rasqal_dataset.c

-43
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ rasqal_free_dataset(rasqal_dataset* ds)
131131

132132
static void
133133
rasqal_dataset_statement_handler(void *user_data,
134-
#ifndef HAVE_RAPTOR2_API
135-
const
136-
#endif
137134
raptor_statement *statement)
138135
{
139136
rasqal_dataset* ds;
@@ -162,34 +159,6 @@ rasqal_dataset_statement_handler(void *user_data,
162159
}
163160

164161

165-
#ifndef HAVE_RAPTOR2_API
166-
/* Raptor V1 only */
167-
static void
168-
rasqal_dataset_raptor_error_handler(void *user_data,
169-
raptor_locator* locator,
170-
const char *message)
171-
{
172-
rasqal_world* world = (rasqal_world*)user_data;
173-
int locator_len;
174-
175-
if(locator &&
176-
(locator_len = raptor_format_locator(NULL, 0, locator)) > 0
177-
) {
178-
char *buffer = (char*)RASQAL_MALLOC(cstring, locator_len + 1);
179-
raptor_format_locator(buffer, locator_len, locator);
180-
181-
rasqal_log_error_simple(world, RAPTOR_LOG_LEVEL_ERROR,
182-
locator,
183-
"Failed to parse %s - %s", buffer, message);
184-
RASQAL_FREE(cstring, buffer);
185-
} else
186-
rasqal_log_error_simple(world, RAPTOR_LOG_LEVEL_ERROR,
187-
locator,
188-
"Failed to parse - %s", message);
189-
}
190-
#endif
191-
192-
193162
int
194163
rasqal_dataset_load_graph_iostream(rasqal_dataset* ds,
195164
const char* format_name,
@@ -223,24 +192,12 @@ rasqal_dataset_load_graph_iostream(rasqal_dataset* ds,
223192
format_name = "guess";
224193

225194
/* parse iostr with parser and base_uri */
226-
#ifdef HAVE_RAPTOR2_API
227195
parser = raptor_new_parser(ds->world->raptor_world_ptr, format_name);
228196
raptor_parser_set_statement_handler(parser, ds,
229197
rasqal_dataset_statement_handler);
230-
#else
231-
parser = raptor_new_parser(format_name);
232-
raptor_set_statement_handler(parser, ds,
233-
rasqal_dataset_statement_handler);
234-
raptor_set_error_handler(parser, ds->world,
235-
rasqal_dataset_raptor_error_handler);
236-
#endif
237198

238199
/* parse and store triples */
239-
#ifdef HAVE_RAPTOR2_API
240200
raptor_parser_parse_iostream(parser, iostr, base_uri);
241-
#else
242-
rasqal_raptor_parse_iostream(parser, iostr, base_uri);
243-
#endif
244201

245202
raptor_free_parser(parser);
246203

0 commit comments

Comments
 (0)
Please sign in to comment.