forked from dajobe/rasqal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog.7
2946 lines (2399 loc) · 130 KB
/
ChangeLog.7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2009-12-16 Dave Beckett <dave@dajobe.org>
* Snapshotted rasqal_0_9_17 for 0.9.17 release (SVN 15914)
* src/rasqal_literal.c:
(rasqal_literal_compare): When comparing URIs and get error, pass
through cleanup to deallocate promoted literals.
* src/rasqal_algebra.c:
(rasqal_free_algebra_node): Free graph and var fields.
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_read_row): During join, do not lose track
of right_row rows that are discarded.
* src/rasqal_rowsource_graph.c:
(rasqal_graph_next_dg): Do not keep extra reference to o; pass it
to con->var
* src/rasqal_query_write.c:
(rasqal_query_write_sparql_literal): Handle printing out UDT URIs
correctly.
* src/rasqal_query_write.c:
(rasqal_query_write_sparql_graph_pattern): Do not add {}s around
FILTER; it never appears on it's own.
2009-12-15 Dave Beckett <dave@dajobe.org>
* utils/roqet.1: spellings
* utils/roqet.1: Add longer examples section
2009-12-14 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c: (rasqal_query_engine_1_set_origin_triples):
Re-initialise column for origin to first triple seen - for QE1.
* docs/tmpl/section-graph_pattern.sgml: Update tmpl for
rasqal_graph_pattern_get_origin
* src/rasqal_query_transform.c:
(rasqal_query_triples_build_bound_in): Initialise bound_in array
to BOUND_IN_UNBOUND.
(rasqal_query_graph_pattern_build_bound_in): If a GRAPH is seen,
set any variable seen to BOUND_ELSEWHERE.
(rasqal_query_build_bound_in): Initialise bound_in array to
BOUND_IN_UNBOUND. Set any select expression variables to
BOUND_IN_ELSEWHERE.
(rasqal_query_check_unused_variables): Update FIXME comment - does
not handle LET. Only warn for variables BOUND_IN_UNBOUND.
* src/rasqal_query.c: (rasqal_query_variable_bound_in_triple):
Return not bound for non-column values.
* src/rasqal_graph_pattern.c:
(rasqal_graph_pattern_variable_bound_in): Return not bound for
non-column values.
* src/rasqal_engine.c: (rasqal_query_engine_1_set_origin_triples):
Use column is BOUND_IN_UNBOUND for variable unbound check.
* src/rasqal_internal.h: Define magic (non-column number ) values
for query->variables_bound_in BOUND_IN_UNBOUND and
BOUND_IN_ELSEWHERE
* src/rasqal_graph_pattern.c: autodocs
* docs/rasqal-sections.txt, src/rasqal.h,
src/rasqal_graph_pattern.c: (rasqal_graph_pattern_get_origin):
Added to public api for GRAPH graph pattern
* src/rasqal_query_write.c:
(rasqal_query_write_sparql_graph_pattern): Write GRAPH pattern
literal from gp->origin field.
* src/sparql_parser.y: err typo
* docs/tmpl/section-general.sgml: Update generated tmpls for new
version macros
* configure.ac, docs/rasqal-sections.txt, src/rasqal.h,
src/rasqal_general.c, src/win32_rasqal_config.h: Add version
defines to rasqal.h
Hard-code RASQAL_VERSION, RASQAL_VERSION_STRING,
RASQAL_VERSION_MAJOR, RASQAL_VERSION_MINOR and
RASQAL_VERSION_RELEASE into rasqal.h to make it easier for
clients.
Remove version_decimal computation and substution fron
configure.in
Remove version defines from win32_rasqal_config.h.
Add defines to docs.
rasqal_version_decimal now uses RASQAL_VERSION.
rasqal_version_string now uses the RASQAL_VERSION_STRING (not
VERSION)
2009-12-13 Dave Beckett <dave@dajobe.org>
* src/rasqal_general.c, src/rasqal_engine.c,
src/rasqal_format_table.c, src/rasqal_literal.c: Casts for C++
* src/rasqal_rowsource_join.c:
rasqal_join_rowsource_context struct gains right_rows_joined_count
field to count number of right rows generated per left row.
(rasqal_join_rowsource_read_row): Use above to generate a new left
row - for left join - once only when entire right rowsource
generated no results. This should fix the semantics of left outer
join.
2009-12-12 Dave Beckett <dave@dajobe.org>
* src/rasqal-config.in: remove warning
* src/rasqal_engine.c: Update comment in rasqal_engine_gp_data
referring to old flags.
* src/rasqal.h: Removed rasqal_triple_flags enum with unused
flags: RASQAL_TRIPLE_FLAGS_EXACT, RASQAL_TRIPLE_FLAGS_OPTIONAL and
RASQAL_TRIPLE_FLAGS_LAST
* src/rasqal.h: rasqal_compare_flags autodocs
* src/rasqal-config.in: Add warning
* src/rasqal-config.in: Try computing the decimal version another way
* docs/rasqal-sections.txt, docs/tmpl/rasqal-unused.sgml,
docs/tmpl/section-data.sgml, docs/tmpl/section-expression.sgml,
docs/tmpl/section-graph_pattern.sgml,
docs/tmpl/section-prefix.sgml,
docs/tmpl/section-triples_source.sgml,
docs/tmpl/section-variable.sgml, docs/tmpl/section-xsd.sgml:
Update gtk-doc templates
* src/rasqal.h: autodocs
* src/rasqal.h: rasqal_graph_pattern_variable_bound_in is RASQAL_API
* src/rasqal_graph.c: autodocs
however this is unused/uncompiled code at this point
* docs/Makefile.am: Ignore rasqal_graph.c
* src/rasqal_graph_pattern.c:
(rasqal_graph_pattern_variable_bound_in): autodocs
* src/rasqal_algebra.c:
(rasqal_algebra_query_to_algebra): For construct, walk selects to
make projection. The query->constructs is an array of triples,
not variables.
* tests/engine/rasqal_construct_test.c:
(main): removed unused var i
* src/rasqal_variable.c:
(rasqal_new_variable_from_variable): Copy vars_table
* src/rasqal_variable.c:
(rasqal_variables_table_add): Assign vars_table to owning object.
* src/rasqal_internal.h: Move typedef rasqal_variables_table to
rasqal.h
* src/rasqal.h: Give all public structures a pointer to their
owner object - usually rasqal_world as the first element in
structure; since we're breaking the ABI.
rasqal_prefix, rasqal_data_graph, rasqal_literal, rasqal_expression,
rasqal_triples_match, rasqal_triples_match_s: moved rasqal_world*
to start.
rasqal_expression: added autodocs
rasqal_variable: add pointer to variables table.
* tests/engine/rasqal_construct_test.c:
(main): Fix error printf using uninitialized var
* src/rasqal_redland.c:
(rasqal_redland_finish): handle early finish before init is done.
* src/rasqal_redland.c: fixes
* src/rasqal-config.in: Update to latest common code.
* src/rasqal.h, src/rasqal_raptor.c, src/rasqal_redland.c,
src/rasqal_triples_source.c: Add versioning to the structures
registered by user API.
rasqal_triples_source gains API version field. Current API is V1.
rasqal_triples_source_factory gains API version field. Current
API is V1.
Added typedef rasqal_triples_source_factory_register_fn which
registers a triples source factory and returns an error status.
(rasqal_set_triples_source_factory): Check error return from TSF
registration function. Checks API version of passed in factory is
in supported range or log failure. Returns errors.
(rasqal_new_triples_source): Check API version of constructed triple
source is in supported range or log failure.
(rasqal_raptor_new_triples_source): Return API V1.
(rasqal_raptor_register_triples_source_factory): Return factory
API v1 qnd return code.
(rasqal_redland_new_triples_source): Return API V1
(rasqal_redland_register_triples_source_factory): Return factory
API v1 qnd return code.
Code style and tidying in above modules.
* src/rasqal.h, src/rasqal_decimal.c, src/rasqal_literal.c:
(rasqal_new_xsd_decimal): Add rasqal_world arg to constructor to
match all other classes.
* src/rasqal.h, src/rasqal_algebra.c, src/rasqal_graph_pattern.c:
Remove deprecated rasqal_graph_pattern_get_constraint
* src/rasqal_graph_pattern.c, src/rasqal_internal.h: struct
rasqal_graph_pattern_s loses constraints field used to support
deprecate functions
* src/rasqal.h, src/rasqal_graph_pattern.c:
Removed deprecated rasqal_graph_pattern_get_constraint_sequence
* src/rasqal.h, src/rasqal_graph_pattern.c:
Removed deprecated rasqal_graph_pattern_add_constraint
* src/rasqal.h, src/rasqal_algebra.c, src/rasqal_engine.c,
src/rasqal_engine_sort.c, src/rasqal_expr.c,
src/rasqal_query_transform.c, src/rasqal_rowsource_assignment.c,
src/rasqal_rowsource_filter.c, src/rasqal_rowsource_join.c,
src/rasqal_rowsource_project.c:
Removed deprecated rasqal_expression_evaluate
Replaced rasqal_expression_evaluate with formerly named
rasqal_expression_evaluate2 with an extra rasqal_world arg.
* configure.ac: RASQAL_LIBTOOL_VERSION 2:0:0
* Breaking ABI/API and bumping library soname after this commit.
Removing deprecated functions, methods.
2009-12-10 Dave Beckett <dave@dajobe.org>
* tests/algebra/test-05.out, tests/algebra/test-06.out,
tests/algebra/test-08.out, tests/algebra/test-09.out:
Update expected results to remove optimized-out expr(boolean(true))
* src/rasqal_algebra.c:
(rasqal_algebra_remove_znodes): Only merge join nodes with two
nodes, one of which is an empty graph pattern. If there is a join
condition, it must be constant TRUE.
This optimization of constant join conditions - TRUE/FALSE should
be a separate previous path and replace join with always FALSE
conditions with an empty node.
* src/sparql_parser.y:
(Collection): Free sequence of formulas after processing the
triples.
(GraphNodeListNotEmpty): Join node to sequence and initialise if
NULL, handle errors and cleanup.
* src/sparql_lexer.l:
(sparql_token_free): Free more literal types when debugging lexing.
* src/rasqal_rowsource_triples.c:
(rasqal_new_triples_rowsource): If this is an empty triple
pattern, free owned bound_in before calling return
rasqal_new_empty_rowsource constructor.
* tests/rdql/testsuite/check-rdql, tests/sparql/check-sparql:
Allow check-rdql and check-sparql to override roqet and rapper
using envariables ROQET and RAPPER
* src/rasqal_literal.c:
(rasqal_literal_string_equals): Only free dt1 and dt2 if allocated
here.
2009-12-10 Lauri Aalto <laalto@iki.fi>
* src/sparql_parser.y:
(ConstructTriplesOpt): Initialize empty query->constructs
sequence. Fixes
sparql/SyntaxDev/Syntax-SPARQL2/syntax-form-construct05.rq test.
2009-12-10 Dave Beckett <dave@dajobe.org>
* src/rasqal_literal.c:
(rasqal_literal_string_equals): Free dt1 and dt2 on success and
error.
* src/rasqal_literal.c:
(rasqal_new_integer_literal): Assign static string for
RASQAL_LITERAL_BOOLEAN to avoid memory leak on string later.
* src/rasqal_raptor.c:
(rasqal_raptor_new_triples_source): Free name_uri when copied
here.
2009-12-08 Dave Beckett <dave@dajobe.org>
* docs/tmpl/rasqal-unused.sgml, docs/tmpl/section-expression.sgml,
docs/tmpl/section-graph_pattern.sgml,
docs/tmpl/section-literal.sgml, docs/tmpl/section-unused.sgml:
update derived docs
2009-12-07 Dave Beckett <dave@dajobe.org>
* src/rasqal_format_table.c: Remove several #if 1 blocks for
writing padded strings
* src/rasqal.h, src/rasqal_engine.c, src/rasqal_engine_sort.c,
src/rasqal_expr.c, src/rasqal_query_transform.c,
src/rasqal_rowsource_assignment.c, src/rasqal_rowsource_filter.c,
src/rasqal_rowsource_join.c,
src/rasqal_rowsource_project.c:
(rasqal_expression_evaluate2): Renamed from
rasqal_expression_evaluate_v2
* src/rasqal_query.c:
(rasqal_query_get_engine_by_name): Set default query engine based
on RASQAL_QUERY_ENGINE_VERSION define. This function is currently
only ever called in the library with NULL as a value, so users
cannot switch query engine after configure.
* configure.ac:
Added --with-query-engine-version arg with values 1 or 2
Defines RASQAL_QUERY_ENGINE_VERSION with value.
Just adding this to allow people to switch to old engine when
building, if necessary. Default query engine is now V2.
2009-12-04 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c:
(rasqal_engine_graph_pattern_init): use
rasqal_query_variable_bound_in_triple not
rasqal_graph_pattern_variable_bound_in to check when found the
triple to bind in. Former returns true for every variable in a
triple loop so caused mis-binding.
* src/rasqal_query_transform.c:
(rasqal_query_triples_build_bound_in_internal): Add debug messages
when a variable binding triple is found.
* src/rasqal_internal.h, src/rasqal_query.c:
(rasqal_query_variable_bound_in_triple): Added to check if a
variable is bound in a triple/column.
* src/sparql_parser.y:
(WhereClause): Added
(WhereClauseOpt): Use above or empty.
(SelectQuery, ConstructQuery, AskQuery): Use required WhereClause for
SELECT, CONSTRUCT and ASK queries
(DescribeQuery): Use optional WhereClauseOpt for DESCRIBE queries.
* src/sparql_parser.y:
(WhereClauseOpt): WHERE is optional but the graph pattern is not.
* tests/sparql/syntax/0triples.rq:
Add where {} with empty graph pattern to 0triples.rq
* tests/sparql/syntax/Makefile.am,
tests/sparql/syntax/select-no-gp.rq: Add select * as bad query in
new query select-no-gp.rq
2009-11-30 Dave Beckett <dave@dajobe.org>
* src/rasqal_format_sparql_xml.c:
(rasqal_query_results_write_sparql_xml): Remove unused code that
attempted to write W3C XML Schemas XSD header. Out of date and
not needed.
* src/rasqal_engine.c:
(rasqal_engine_graph_pattern_order): Removed - dead code.
2009-11-29 Dave Beckett <dave@dajobe.org>
* src/rasqal_query_transform.c:
Rename functions and args/variables for terminology: use_map for a
2D array, use_map row for a 1D row in use-map
* src/rasqal_query_transform.c:
(rasqal_query_build_variables_sequence_use_map,
rasqal_query_build_literals_sequence_use_map): Remove unused query
arg.
* src/rasqal_query_transform.c:
(rasqal_query_triples_build_variables_use_map,
rasqal_query_build_variables_sequence_use_map,
rasqal_query_build_literals_sequence_use_map): Return status code
(rasqal_query_build_variables_use_map): Check return code of above
for failures.
* src/rasqal_query_transform.c:
(rasqal_query_build_expressions_sequence_use_map): Added.
(rasqal_query_build_variables_use_map): Use above to mark use of
variables in query order_conditions_sequence (ORDER BY) sequence
of rasqal_expression
* src/rasqal_query_transform.c:
Restore indenting messed up in SVN r15741
* src/rasqal_query_transform.c:
indenting
* src/rasqal_query_transform.c:
(rasqal_query_triples_build_variables_use_map): Renamed from
rasqal_query_triples_build_variables_use_map_internal but now only
used in this file.
* src/rasqal_internal.h:
Remove rasqal_query_triples_build_variables_use_map prototype -
never called outside module.
* src/rasqal_query_transform.c:
(rasqal_query_triples_build_variables_use_map): Removed, never
called.
* src/rasqal_query_transform.c:
(rasqal_query_triples_build_variables_use_map_internal): Take a
triples sequence arg so can be used for construct.
(rasqal_query_triples_build_variables_use_map): Pass in triples
seq.
(rasqal_query_graph_pattern_build_variables_use_map): Pass in
triples seq.
(rasqal_query_build_variables_use_map): Use
rasqal_query_triples_build_variables_use_map_internal for
construct triples, putting them in the
RASQAL_VAR_USE_MAP_OFFSET_VERBS row.
* src/rasqal_query_transform.c:
(rasqal_query_build_literals_sequence_use_map): Added.
(rasqal_query_build_variables_use_map): Use above for DESCRIBE
args which are a sequence of literals.
* src/rasqal_query_transform.c:
(rasqal_query_build_variables_use_map): Move code comments into
internal docucomment.
* src/rasqal_query_transform.c:
(rasqal_query_build_variables_use_map): Expand comments and fixmes
* configure.ac:
Warn if pkg-config is not found - will be a fatal error when
raptor2 is required.
Prefer pkg-config raptor to raptor-config but accept both for
now. pkg-config will not allow compiling against raptor in source
tree.
* ChangeLog, ChangeLog.6, Makefile.am:
Add ChangeLog.6 for 2008.
2009-11-29 Lauri Aalto <laalto@iki.fi>
* autogen.sh: Reduce autogen noise on systems where uname is not
in /usr/bin
2009-11-17 Lauri Aalto <laalto@iki.fi>
* src/rasqal.h:
Define RASQAL_LITERAL_UDT_DEFINED for rdf_query_rasqal.c
* src/rasqal_rowsource_distinct.c:
(rasqal_new_distinct_rowsource): Free passed in rowsource on failure.
* src/rasqal_rowsource.c:
(rasqal_rowsource_read_all_rows): Check for
rasqal_rowsource_ensure_variables() failure.
* src/rasqal_rowsource_sort.c:
(rasqal_sort_rowsource_ensure_variables): Check return value from
inner rasqal_rowsource_ensure_variables() call.
* src/rasqal_literal.c:
(rasqal_literal_get_rdf_term_type): Always return proper enum
value instead of int. Fixed typo in docs.
* src/rasqal_query_results.c:
(rasqal_query_results_execute_with_engine): Also check return
value from execute_init() for errors.
* src/rasqal_engine_algebra.c, src/rasqal_internal.h,
src/rasqal_rowsource_sort.c:
(rasqal_new_sort_rowsource): Do not take in a triples sequence as
one is allocated internally, messing up ownership. Free passed in
rowsource on failure.
2009-11-16 Dave Beckett <dave@dajobe.org>
* src/rasqal_redland.c:
(rasqal_literal_to_redland_node): Use
rasqal_literal_get_rdf_term_type to check RDF terminess to get
away from ever-expanding if conditions.
* src/rasqal.h, src/rasqal_internal.h, src/rasqal_literal.c:
(rasqal_literal_get_rdf_term_type): Added to public API to return
the RDF term type of a literal.
(rasqal_literal_is_rdf_literal): Added calling above to return if
a term is an RDF literal.
2009-11-16 Lauri Aalto <laalto@iki.fi>
* src/rasqal_rowsource_sort.c:
(rasqal_sort_rowsource_process): Check rasqal_row_set_order_size()
return value and clean up on failure.
* src/rasqal_query_transform.c:
(rasqal_graph_patterns_join): Check and return errors from
raptor_sequence_join()
* src/rasqal_algebra.c:
(rasqal_algebra_group_graph_pattern_to_algebra): Always free
anode, prevent double deletes.
* src/rasqal_algebra.c:
(rasqal_algebra_group_graph_pattern_to_algebra): Free anode on
failure.
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_read_row): Discard unused right_row.
2009-11-13 Dave Beckett <dave@dajobe.org>
* src/rasqal_query_transform.c:
(rasqal_expression_expr_build_variables_use_map): Move earlier and
take a use_map row.
(rasqal_query_build_variables_sequence_use_map): Added to mark
variables bound and used in a sequence of vars with optional
project expressions.
(rasqal_query_build_variables_use_map): Use
rasqal_query_build_variables_sequence_use_map for SELECT and
DESCRIBE to mark variables.
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_build_merged_row): Set row offset from
current rowsource context offset.
2009-11-13 Lauri Aalto <laalto@iki.fi>
* src/rasqal_algebra.c:
(rasqal_algebra_basic_graph_pattern_to_algebra,
rasqal_algebra_group_graph_pattern_to_algebra): Prevent double
free of filter set.
* src/rasqal_rowsource_union.c:
(rasqal_union_rowsource_read_row): Don't leak rows on failure.
* src/rasqal_rowsource_union.c:
(rasqal_union_rowsource_ensure_variables): Check error code from
rasqal_rowsource_copy_variables().
* src/rasqal_rowsource_union.c:
(rasqal_new_union_rowsource): Free owned rowsources on failure.
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_build_merged_row): Free passed in right_row
on failure.
Added FIXME note to a no-op assignment.
* src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_filter.c, src/rasqal_rowsource_join.c:
(rasqal_rowsource_copy_variables): Changed internal function
prototype to return int error code e.g. in case
rasqal_rowsource_add_variable() fails.
(rasqal_filter_rowsource_ensure_variables,
rasqal_join_rowsource_ensure_variables): Check for
rasqal_rowsource_copy_variables() failures.
* src/rasqal_rowsource.c, src/rasqal_rowsource_filter.c,
src/rasqal_rowsource_project.c:
(rasqal_filter_rowsource_ensure_variables,
rasqal_project_rowsource_ensure_variables):
rasqal_rowsource_ensure_variables() success and return error on
failure.
(rasqal_rowsource_read_row): Check
rasqal_rowsource_ensure_variables() success and return NULL on
failure.
* src/rasqal_rowsource_join.c:
(rasqal_new_join_rowsource): Free passed in rowsource params on
failure.
* src/rasqal_rowsource_filter.c:
(rasqal_new_filter_rowsource): Free passed in rowsource, expr on
failure.
* src/rasqal_row_compatible.c, src/rasqal_rowsource_join.c:
(rasqal_new_row_compatible): Check for alloc failures.
(rasqal_join_rowsource_init): Check for
rasqal_new_row_compatible() failure.
* src/rasqal_algebra.c:
(rasqal_algebra_group_graph_pattern_to_algebra): Free A node on
failure. Prevent double delete of true_expr -
rasqal_new_leftjoin_algebra_node() takes ownership of passed in
expr.
* src/rasqal_rowsource_project.c:
(rasqal_new_project_rowsource): Free rowsource param on error.
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_init): Return error if vars sequence
push fails.
2009-11-11 Lauri Aalto <laalto@iki.fi>
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_finish): Only free the triple meta if
the meta array was allocated.
* src/rasqal_engine_algebra.c:
(rasqal_query_engine_algebra_execute_finish): Do not assume
execution_data allocation succeeded. Cannot check this in caller
since it is valid for a query engine to have ex_size 0 and thus no
execution_data allocated but still require a call to
execute_finish.
* src/rasqal_query_transform.c:
(rasqal_query_prepare_common): Return failure if a called function
fails.
* src/rasqal_algebra.c:
(rasqal_algebra_query_to_algebra): Code style: return NULL
explicitly.
* src/rasqal_algebra.c:
(rasqal_algebra_remove_znodes): Free the struct memory of nodes
merged to other nodes.
2009-11-10 Lauri Aalto <laalto@iki.fi>
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_finish, rasqal_join_rowsource_read_row): Do
not leak left_rows
* src/rasqal_algebra.c:
(rasqal_new_filter_algebra_node): Made param ownership consistent
with other algebra_node types.
(rasqal_new_2op_algebra_node, rasqal_new_leftjoin_algebra_node):
Ownership documentation fixes.
* src/rasqal_algebra.c:
(rasqal_algebra_query_to_algebra): Support
CONSTRUCT query form on QE2.
2009-11-08 Dave Beckett <dave@dajobe.org>
* src/rasqal_query_transform.c:
(rasqal_query_graph_pattern_build_variables_use_map): adjust
output offset to skip the non-GP rows.
use_map_offset_labels: added
use_map_flags_labels: renamed from use_map_str and made static
const.
(rasqal_query_print_variables_use_map): Adjust to handle non-GP
rows as well as GP rows.
* src/rasqal_internal.h:
rasqal_var_use_map_offset: added to reserve use_map rows for
marking variable uses outside of graph patterns.
* src/rasqal_query_transform.c:
(rasqal_query_print_variables_use_map): off by 1 in unknown flag
check
* src/rasqal_query_transform.c:
(rasqal_query_build_variables_use_map): Document note of missing
query parts that may need variable use map scans.
2009-11-06 Dave Beckett <dave@dajobe.org>
* src/rasqal_query_transform.c:
(rasqal_query_prepare_common): Move rasqal_query_build_bound_in
and rasqal_query_check_unused_variables to later so that
rasqal_query_build_variables_use_map happens before
rasqal_query_build_bound_in.
* src/rasqal_engine.c:
(rasqal_engine_get_next_result): Remove FIXMEs that are real
errors - no graph patterns in query, already reported as such and
not fixable.
* src/rasqal_engine.c:
(rasqal_engine_group_graph_pattern_get_next_match): Engine V1 is
never going to implement group graph pattern - remove fixme.
2009-11-03 Dave Beckett <dave@dajobe.org>
* src/rasqal.h, src/rasqal_expr.c, src/rasqal_query_write.c,
src/sparql_lexer.l, src/sparql_parser.y,
tests/laqrs/syntax/Makefile.am, tests/laqrs/syntax/coalesce1.rq:
Implement LAQRS (possible SPARQL 1.1) COALESCE
rasqal_op gains RASQAL_EXPR_COALESCE
(COALESCE): Keyword added to laqrs lexer
(CoalesceExpression): Added to laqrs grammar.
(BuiltInCall): Add CoalesceExpression to option.
(rasqal_new_coalesce_expression): Added.
(rasqal_expression_clear, rasqal_expression_visit,
rasqal_expression_evaluate_v2, rasqal_expression_write,
rasqal_expression_print, rasqal_expression_is_constant): Implement
coalesce
* src/rasqal_query_results.c:
(rasqal_query_results_get_binding_name): Get variables by select
order not variable table order so that project expressions work -
from SPARQL1.1 / LAQRS.
* src/rasqal_rowsource_project.c:
(rasqal_project_rowsource_read_row): Calculate project expressions.
2009-10-26 Dave Beckett <dave@dajobe.org>
* src/sparql_parser.y:
(LetGraphPattern): Free expression on error path
* src/sparql_parser.y:
(LetGraphPattern): Set $$ on error path
* src/Makefile.am, src/rasqal.h, src/rasqal_algebra.c,
src/rasqal_engine_algebra.c, src/rasqal_graph_pattern.c,
src/rasqal_internal.h, src/rasqal_query_transform.c,
src/rasqal_query_write.c, src/rasqal_rowsource_assignment.c,
src/sparql_lexer.l, src/sparql_parser.y,
tests/laqrs/syntax/Makefile.am, tests/laqrs/syntax/let1.rq,
tests/laqrs/syntax/let1.ttl, tests/laqrs/syntax/let2.rq,
tests/laqrs/syntax/let3.rq, tests/laqrs/syntax/let3.ttl:
Added LAQRS sparql extension LET ?var := expression evaluated
in-order inside a graph pattern
rasqal_graph_pattern_operator gains RASQAL_GRAPH_PATTERN_OPERATOR_LET
rasqal_algebra_node_operator gains RASQAL_ALGEBRA_OPERATOR_ASSIGN
struct rasqal_graph_pattern_s shares filter_expression and gains
variable field 'var' for GP LET.
rasqal_algebra_node gains variable field 'var' for GP LET.
(rasqal_new_assignment_algebra_node): Added.
rasqal_algebra_node_operator_labels gains "Assignment"
(rasqal_algebra_algebra_node_write_internal): Print variable name for
assignment
(rasqal_algebra_group_graph_pattern_to_algebra): Only AND filter
graph patterns, not everything witha filter_expression.
(rasqal_algebra_let_graph_pattern_to_algebra): Added.
(rasqal_algebra_graph_pattern_to_algebra): Handle new
RASQAL_GRAPH_PATTERN_OPERATOR_LET
(rasqal_new_let_graph_pattern): Added.
rasqal_graph_pattern_operator_labels gains "Let"
(rasqal_graph_pattern_write_internal): Write Let GP
for RASQAL_GRAPH_PATTERN_OPERATOR_LET
(rasqal_query_let_build_variables_use_map_in_internal): Added
(rasqal_query_graph_pattern_build_variables_use_map): Handle
RASQAL_GRAPH_PATTERN_OPERATOR_LET using
rasqal_query_let_build_variables_use_map_in_internal.
(rasqal_query_print_variables_use_map): Tidy code and ignore unknown
flags.
SPARQL lexer and parser gain LET (LET) and ':' (ASSIGN) keywords.
(GraphPatternNotTriples): Add option for LetGraphPattern
(LetGraphPattern): Added to construct a
RASQAL_GRAPH_PATTERN_OPERATOR_LET for LAQRS.
(rasqal_query_write_sparql_graph_pattern): Print the GP out with LET
?var := ?expr.
(rasqal_new_assignment_rowsource): Added assignment rowsource with
this constructor.
(rasqal_algebra_assignment_algebra_node_to_rowsource): Added.
(rasqal_algebra_node_to_rowsource): Call above for
RASQAL_ALGEBRA_OPERATOR_ASSIGN.
2009-10-22 Dave Beckett <dave@dajobe.org>
* src/rasqal_format_json.c:
(rasqal_init_result_format_json): Restored old URIs
2009-10-21 Dave Beckett <dave@dajobe.org>
* src/rasqal_format_sv.c: Sep is a single char
Write empty values as empty field ie foo,,bar or foo\t\tbar
Write integer, float, double and decimal XSD types without quotes.
2009-10-21 Lauri Aalto <laalto@iki.fi>
* src/rasqal_literal.c:
(rasqal_literal_string_equals): Fixed compilation with
RAPTOR_V2_AVAILABLE
2009-10-20 Dave Beckett <dave@dajobe.org>
* src/rasqal.h, src/rasqal_engine.c, src/rasqal_graph_pattern.c,
src/rasqal_internal.h, src/rasqal_query.c,
src/rasqal_query_transform.c:
Replace mentioned_in with a variables use map concept that has
several flags per variable/gp combination. Set the mentioned flag
for now - RASQAL_VAR_USE_MENTIONED_HERE
Added num rasqal_var_use_map_flags with the flags.
Renamed functions/fields with *_mentioned_in to be *_use_map
(rasqal_query_print_variables_use_map): Added debug function to
print use map and flags better.
(rasqal_expression_expr_build_variables_use_map,
rasqal_query_filter_build_variables_use_map_in_internal): Added to
find variables mentioned in a filter expression.
(rasqal_graph_pattern_variable_bound_in): Added to wrap bound_in
that will be moving to query->use_map.
* src/rasqal_internal.h: update comments for format file renamings
* src/Makefile.am, src/rasqal_format_sparql_xml.c:
Rename rasqal_sparql_xml.c to rasqal_format_sparql_xml.c
* src/rasqal_sparql_xml.c: update label and url for this format
* src/rasqal_format_json.c: update label and url for this format
* src/rasqal_format_sv.c: Add labels for messages
* src/Makefile.am, src/rasqal_format_csv.c, src/rasqal_format_sv.c
Rename rasqal_format_csv.c to rasqal_format_sv.c
* src/rasqal_format_csv.c, src/rasqal_internal.h,
src/rasqal_result_formats.c:
Lets go crazy and add TSV too
* src/rasqal_format_csv.c: tidy code
* src/Makefile.am, src/rasqal_format_csv.c, src/rasqal_internal.h,
src/rasqal_result_formats.c:
Added CSV output for query results - why not?
* src/rasqal.h, src/rasqal_expr.c, src/rasqal_internal.h,
src/rasqal_literal.c, tests/sparql/check-sparql:
rasqal_literal gains a valid flag to indicate when an XSD type is
known and has a valid literal form. Otherwise on construction, it
gets turned into a RASQAL_LITERAL_UDT aka invalid/unknown type.
(rasqal_new_*_literal): Set valid flag explicitly when known good.
(rasqal_literal_set_typed_value): Turn invalid known types into
RASQAL_LITERAL_UDT.
(rasqal_literal_not_equals_flags): Added internal function to
parallel rasqal_literal_equals_flags. The logic may be different
soon.
(rasqal_literal_write, rasqal_literal_print): Emit INV: before
invalid literals for debugging.
(rasqal_expr_evaluate_v2): Use rasqal_literal_not_equals_flags()
for RASQAL_EXPR_NEQ.
2009-10-18 Dave Beckett <dave@dajobe.org>
* src/rasqal_expr.c:
(rasqal_expression_evaluate_v2): Disallow comparing invalid
literals Adjust datatype of plain literal to new xsd:string form.
* src/rasqal_literal.c:
(rasqal_new_numeric_literal, rasqal_literal_set_typed_value,
rasqal_free_literal, rasqal_literal_cast): Handle
RASQAL_LITERAL_XSD_STRING and RASQAL_LITERAL_XSD_UDT.
(rasqal_literal_string_interpreted_as_boolean): Added, pulled out
of rasqal_literal_set_typed_value.
(rasqal_literal_set_typed_value): Use
rasqal_literal_string_interpreted_as_boolean for decoding
RASQAL_LITERAL_BOOLEAN string.
(rasqal_literal_string_to_native): do nothing for
RASQAL_LITERAL_STRING; set RASQAL_LITERAL_XSD_STRING and otherwise
set unknown types to RASQAL_LITERAL_UDT Ensure the l->type is set
via rasqal_literal_set_typed_value even if the function will fail
due to a type error when rasqal_xsd_datatype_check is called.
Update rasqal_literal_type_labels to add xsdstring and udt.
(rasqal_literal_write, rasqal_literal_print): write/print xsd
strings and UDT
(rasqal_literal_as_boolean): Interpret RASQAL_LITERAL_XSD_STRING
as booleans. RASQAL_LITERAL_UDT as error.
(rasqal_literal_as_integer, rasqal_literal_as_floating,
rasqal_literal_as_string_flags): Interpret
RASQAL_LITERAL_XSD_STRING same as RASQAL_LITERAL_STRING.
RASQAL_LITERAL_UDT as error.
(rasqal_literal_get_rdf_term_type): Turn UDT into a
RASQAL_LITERAL_STRING when flattening to an RDF term.
(rasqal_new_literal_from_promotion): autodocs and add flags
argument to allow promotion of strings to boolean (for RDQL) when
RASQAL_COMPARE_URI is given.
Interpret RASQAL_LITERAL_UDT as plain literal
RASQAL_LITERAL_STRING but ensure the datatype is coopied.
case RASQAL_LITERAL_BOOLEAN: Separated from RASQAL_LITERAL_INTEGER
and use rasqal_literal_string_interpreted_as_boolean to handle
promotion of strings to boolean.
case RASQAL_LITERAL_XSD_STRING: Added, copying the string and
type.
case RASQAL_LITERAL_UDT: Added, causing error.
(rasqal_literal_string_compare): Return an error if types are
neigther plain literal or user defined datatyped literals
(rasqal_literal_rdql_promote_calculate): Handle and ignore
XSD_STRING and UDT for rdql promotions. If seen boolean and
string, aim for destination type boolean.
(rasqal_literal_compare): Return failure with UDT - cannot compare
them. Handle UDT<>UDT compare same as STRING and
XSD_STRING<>XSD_STRING as simple literal compare.
(rasqal_literal_string_equals): Use XSD_STRING to get
xsd_string_uri. Promote plain literals to xsd:string-typed for
purpose of equality checking.
Equality checking on user defined types fails with a type error.
(rasqal_literal_equals_flags): Handle RASQAL_LITERAL_XSD_STRING
and RASQAL_LITERAL_UDT as plain literal string.
(rasqal_literal_as_node): Handle RASQAL_LITERAL_XSD_STRING and
RASQAL_LITERAL_UDT as other XSD types.
(rasqal_literal_add, rasqal_literal_subtract,
rasqal_literal_multiply, rasqal_literal_divide,
rasqal_literal_negate): Handle RASQAL_LITERAL_XSD_STRING and
RASQAL_LITERAL_UDT as other XSD types. Update check so URI can be
cast to xsd:string and no other type. RASQAL_LITERAL_XSD_STRING
and RASQAL_LITERAL_XSD_UDT are errors.
* tests/rdql/testsuite/check-rdql, tests/sparql/check-sparql:
Adjust roqet output to hide udt(); replace with string() for
comparison purposes.
* src/rasqal_format_json.c, src/rasqal_query_results.c,
src/rasqal_query_write.c, src/rasqal_sparql_xml.c: Add cases
RASQAL_LITERAL_XSD_STRING and RASQAL_LITERAL_UDT to various
switches usually near RASQAL_LITERAL_STRING.
* src/rasqal_xsd_datatypes.c: sparql_xsd_names: insert entry for
RASQAL_LITERAL_STRING parent_xsd_type: adjust parents for
separation of plain literal (RASQAL_LITERAL_STRING),
xsd:string (RASQAL_LITERAL_XSD) and user/unknown
datatype (RASQAL_LITERAL_UDT)
* src/rasqal.h: rasqal_literal_type gains
1) RASQAL_LITERAL_XSD_STRING - for xsd:string typed literals
2) RASQAL_LITERAL_UDT - for unknown data typed literals separated
out of RASQAL_LITERAL_STRING which is for RDF plain literals and
plain/typed turned into RDF terms only
rasqal_compare_flags gains RASQAL_COMPARE_URI - now also provides
RDQL string to bool comparison
2009-10-13 Dave Beckett <dave@dajobe.org>
* src/rasqal_rowsource_graph.c:
(rasqal_graph_next_dg): Walk through all the named graphs and
set the origin; do not end if default graph is seen.
Improve error recovery.
* src/rasqal_rowsource.c:
(rasqal_rowsource_ensure_variables): Print rowsource variables
after ensure_variables is called when debugging.
(rasqal_rowsource_read_row): Print rowsource ptr when debugging.
* src/rasqal_rowsource_join.c: Add rowsource ptr to debug messages.
* src/rasqal_row_compatible.c:
(rasqal_print_row_compatible): Tidy output ot remove all the "-1"s
* src/rasqal_rowsource_union.c:
(rasqal_union_rowsource_get_inner_rowsource): Return inner
rowsources correctly.
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_get_inner_rowsource): Return inner
rowsources correctly.
* src/rasqal_rowsource_graph.c:
(rasqal_graph_rowsource_init): Use rasqal_graph_rowsource_reset to
set up initial graph state.
(rasqal_graph_rowsource_reset): Call rasqal_graph_next_dg to set
graph variable and start state.
* src/rasqal_rowsource_graph.c:
(rasqal_graph_rowsource_read_row): Set new row to size of new
rowsource.
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_read_row): For natural join, return only
compatible rows - both present - and with filter true.