forked from dajobe/rasqal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChangeLog.6
3715 lines (2908 loc) · 138 KB
/
ChangeLog.6
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
2008-12-30 Dave Beckett <dave@dajobe.org>
* src/rasqal_graph_pattern.c:
(rasqal_graph_pattern_set_origin): Just set the origin; do not
touch all the triples with the origin literal, that's for the
query engine to do at some point. See
rasqal_query_engine_1_set_origin_triples() for QE#1 where the old
triple origin-setting code moved.
* src/sparql_parser.y:
(GraphGraphPattern): Construct a GP for a GRAPH saving the literal
as the origin.
* src/rasqal_algebra.c, src/rasqal_internal.h: Added
RASQAL_ALGEBRA_OPERATOR_GRAPH.
(rasqal_new_graph_algebra_node): Added to use
RASQAL_ALGEBRA_OPERATOR_GRAPH
(rasqal_algebra_algebra_node_write_internal): Updated to print
graph literal.
(rasqal_algebra_graph_graph_pattern_to_algebra): Added to use
graph pattern origin to make a new graph algebra node over the
inner single graph pattern.
(rasqal_algebra_graph_pattern_to_algebra): Call the above.
* src/rasqal_internal.h, src/rasqal_rowsource.c: Added typedef
rasqal_rowsource_visit_fn.
(rasqal_rowsource_visit): Added to walk rowsource tree using
rasqal_rowsource_get_inner_rowsource.
2008-11-30 Lauri Aalto <laalto@iki.fi>
* src/rasqal_query.c:
(rasqal_query_dataset_contains_named_graph): Fixed for raptor v2
2008-11-30 Dave Beckett <dave@dajobe.org>
* src/rasqal_internal.h: Added rasqal_rowsource_ensure_variables
prototype
* src/rasqal_internal.h: Fix source file names for rowsources
* src/rasqal.h, src/rasqal_query.c:
(rasqal_query_dataset_contains_named_graph): Added.
* src/rasqal_graph_pattern.c, src/rasqal_internal.h:
rasqal_graph_pattern gains origin field
(rasqal_free_graph_pattern): Free it if set. Uppercase grpah
pattern operator labels in rasqal_graph_pattern_operator_labels
for easier reading.
(rasqal_graph_pattern_write_internal): Print out GP origin if set.
* src/rasqal_query_transform.c:
(rasqal_graph_patterns_join): Handle merging GRAPH patterns with
an origin
2008-11-26 Lauri Aalto <laalto@iki.fi>
* src/rasqal_rowsource.c:
(rasqal_rowsource_read_row): casts for c++
2008-11-16 Dave Beckett <dave@dajobe.org>
* src/rasqal_raptor.c: code style. replace all strcpy() with
strncpy()
2008-11-15 Dave Beckett <dave@dajobe.org>
* src/rasqal_graph.c: docs
* src/rasqal_graph.c: terminology - use dataset not graph
* src/rasqal_graph.c: Add functions to enumerate and alter the
dataset of graphs
* src/rasqal_graph.c: more api thoughts in code form
2008-11-14 Dave Beckett <dave@dajobe.org>
* src/rasqal_graph.c, src/rasqal_internal.h: Add tentative graph
API to replace rasqal_triples_source_factory,
rasqal_triples_source, rasqal_triple_meta and rasqal_triples_match
maybe.
2008-11-12 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine_algebra.c, src/rasqal_internal.h,
src/rasqal_rowsource.c: Add simple printing out of rowsource query
plan structure.
(rasqal_rowsource_write_indent, rasqal_rowsource_write_internal):
Added
(rasqal_rowsource_write): Added using
rasqal_rowsource_write_internal.
(rasqal_rowsource_print): Added using rasqal_rowsource_write.
* src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_empty.c, src/rasqal_rowsource_filter.c,
src/rasqal_rowsource_join.c, src/rasqal_rowsource_project.c,
src/rasqal_rowsource_rowsequence.c, src/rasqal_rowsource_sort.c,
src/rasqal_rowsource_triples.c, src/rasqal_rowsource_union.c:
Added get_inner_rowsource factory method for
rasqal_rowsource_handler. This allows walking the tree of
rowsources aka query execution plan.
(rasqal_rowsource_get_inner_rowsource): Added.
* src/rasqal_internal.h: docs
2008-11-09 Dave Beckett <dave@dajobe.org>
* src/rasqal_internal.h: Delete unused fields from struct
rasqal_query_s
* src/rasqal_rowsource_filter.c, src/rasqal_rowsource_join.c,
src/rasqal_rowsource_triples.c: Replace query->world with
rowsource->world
* src/rasqal_engine.c, src/rasqal_engine_algebra.c,
src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_empty.c, src/rasqal_rowsource_filter.c,
src/rasqal_rowsource_join.c, src/rasqal_rowsource_project.c,
src/rasqal_rowsource_rowsequence.c, src/rasqal_rowsource_sort.c,
src/rasqal_rowsource_triples.c, src/rasqal_rowsource_union.c,
src/rasqal_sparql_xml.c: Add world from struct rasqal_rowsource_s.
Add world arg to all rowsource constructors.
(rasqal_new_rowsource_from_handler): Add world arg
(rasqal_rowsource_get_query): Deleted, never used.
* src/rasqal_rowsource_filter.c, src/rasqal_rowsource_join.c,
src/rasqal_rowsource_sort.c, src/rasqal_rowsource_triples.c,
src/rasqal_rowsource_union.c: Remove query from rowsource context,
use rowsource->query
* src/rasqal_engine.c, src/rasqal_engine_sort.c,
src/rasqal_internal.h, src/rasqal_query_transform.c,
src/rasqal_rowsource.c, src/rasqal_rowsource_empty.c,
src/rasqal_rowsource_filter.c, src/rasqal_rowsource_join.c,
src/rasqal_rowsource_project.c,
src/rasqal_rowsource_rowsequence.c, src/rasqal_rowsource_sort.c,
src/rasqal_rowsource_triples.c, src/rasqal_rowsource_union.c,
src/rasqal_sparql_xml.c: Add query to the rasqal_rowsource
structure. Remove the get_query method from the rowsource handler
and typedef rasqal_rowsource_get_query_func .
(rasqal_sort_rowsource_get_query,
rasqal_union_rowsource_get_query,
rasqal_empty_rowsource_get_query,
rasqal_rowsequence_rowsource_get_query,
rasqal_project_rowsource_get_query,
rasqal_triples_rowsource_get_query,
rasqal_rowsource_engine_get_query): Deleted the get_query method
from all rowsources.
Replace rasqal_expression_evaluate calls with
rasqal_expression_evaluate_v2.
* src/rasqal.h, src/rasqal_expr.c:
(rasqal_expression_evaluate_strmatch): Replace query with world
and locator args and call rasqal_expression_evaluate_v2.
(rasqal_expression_evaluate_v2): Take world and locator args.
(rasqal_expression_evaluate): Call rasqal_expression_evaluate_v2.
Deprecate rasqal_expression_evaluate for rasqal_expression_evaluate_v2.
* src/rasqal_internal.h: docs
2008-11-07 Dave Beckett <dave@dajobe.org>
* configure.ac: Require raptor 1.4.18 for
raptor_sequence_delete_at (at least)
* configure.ac: handle empty LEX in test
* src/rasqal_rowsource.c:
(rasqal_rowsource_read_row): Use raptor_sequence_delete_at to
delete/return.
* src/rasqal_internal.h, src/rasqal_rowsource.c: struct
rasqal_rowsource_s gains rows_sequence and offset vars for storing
a sequence of rows in order to generate them 1-by-1.
(rasqal_rowsource_read_row): Use rows_sequence and offset above
with method rasqal_rowsource_read_all_rows() to convert a sequence
of results into an incremental one.
2008-11-05 Dave Beckett <dave@dajobe.org>
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_read_row): declare i outside debug ifdef
* src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_filter.c, src/rasqal_rowsource_join.c,
src/rasqal_rowsource_project.c, src/rasqal_rowsource_triples.c,
src/rasqal_rowsource_union.c: Add set_preserve method to
rasqal_rowsource_handler with typedef
rasqal_rowsource_set_preserve_func.
(rasqal_rowsource_set_preserve): Added
(rasqal_filter_rowsource_set_preserve,
rasqal_union_rowsource_set_preserve,
rasqal_project_rowsource_set_preserve,
rasqal_join_rowsource_set_preserve): Added to pass on the
set_preserve call to inner rowsource(s). Added
preserve_on_all_finished to rasqal_triples_rowsource_context.
(rasqal_triples_rowsource_finish): Reset column triple meta.
(rasqal_triples_rowsource_get_next_row): Do not trigger reset when
last match found if con->preserve_on_all_finished set.
(rasqal_triples_rowsource_set_preserve): Set preserve flag.
(rasqal_join_rowsource_init): Set preserve flag on inner
rowsources.
* src/rasqal_rowsource.c:
(rasqal_rowsource_read_row): Add debug print of read row
* src/rasqal_rowsource_join.c: oops
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_init): Check for constant join expressions
and optimize them away if constant and true or false.
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_read_row): get vars from rowsource by
offset. Replace rasqal_row_set_values_from_variables_table with
loop to set row values from variables in rowsource by offset , not
in variables table by offset.
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_init): Calculate rowsize con->size from
columns
(rasqal_new_triples_rowsource): Remove initing rowsize from query
fields, let rasqal_triples_rowsource_init do it later.
* src/rasqal_engine_algebra.c, src/rasqal_internal.h,
src/rasqal_rowsource_triples.c: rasqal_triples_rowsource_context
gains declared_in array.
(rasqal_triples_rowsource_init): Use passed-in declared_in array
rather than make one locally.
(rasqal_new_triples_rowsource): Add declared_in parameter.
(main): Update test to new calling convention.
(rasqal_algebra_basic_algebra_node_to_rowsource): Update to create
declared_in and pass it in to rasqal_new_triples_rowsource.
* src/rasqal_rowsource_triples.c: Remove new_bindings_count from
rasqal_triples_rowsource_context - not used. Removed resets
return value variable.
2008-11-02 Dave Beckett <dave@dajobe.org>
* tests/algebra/test-01.out, tests/algebra/test-02.out,
tests/algebra/test-03.out, tests/algebra/test-04.out,
tests/algebra/test-05.out, tests/algebra/test-06.out,
tests/algebra/test-07.out, tests/algebra/test-08.out,
tests/algebra/test-09.out: Add Project() to outer scope of all
expected results
2008-11-01 Dave Beckett <dave@dajobe.org>
* src/rasqal_rowsource_project.c:
(rasqal_project_rowsource_ensure_variables): Allow projecting
variables not in input - allowable for cases with optionals. Warn
about it when debugging for now.
(rasqal_project_rowsource_read_row): Handle projecting variables
with no value for optionals.
* src/rasqal_rowsource_union.c:
(rasqal_union_rowsource_ensure_variables): Allocate array of ints
not bytes for right_map
* src/rasqal_rowsource_join.c:
(rasqal_join_rowsource_ensure_variables): Allocate array of ints
not bytes for right_map
(rasqal_join_rowsource_build_merged_row): Extra debug info
2008-10-30 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine_algebra.c:
(rasqal_algebra_leftjoin_algebra_node_to_rowsource): Added.
(rasqal_algebra_node_to_rowsource): Use above to handle LEFTJOIN
* src/rasqal_internal.h, src/rasqal_rowsource_join.c:
(rasqal_new_join_rowsource): Take join type and join expression.
Only support join type 0 - left outer join today
2008-10-29 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine_algebra.c:
(rasqal_algebra_project_algebra_node_to_rowsource): Added.
(rasqal_algebra_node_to_rowsource): Use
rasqal_algebra_project_algebra_node_to_rowsource to convert
project algebra nodes.
* src/rasqal_algebra.c:
(rasqal_new_project_algebra_node): Added
(rasqal_free_algebra_node): Free vars_seq.
(rasqal_algebra_algebra_node_write_internal): Print project vars.
(rasqal_algebra_query_to_algebra): Use
rasqal_new_project_algebra_node to add a PROJECT node at the top
of every query to select the right variables.
* src/rasqal_internal.h: rasqal_algebra_node_s gains vars_seq
* src/rasqal_rowsource_empty.c, src/rasqal_rowsource_filter.c,
src/rasqal_rowsource_join.c, src/rasqal_rowsource_project.c,
src/rasqal_rowsource_triples.c, src/rasqal_rowsource_union.c:
Implement rowsource reset functions
(rasqal_filter_rowsource_reset, rasqal_union_rowsource_reset,
rasqal_project_rowsource_reset, rasqal_triples_rowsource_reset):
Added.
(rasqal_join_rowsource_reset): Updated to reset and reset internal
rowsources.
* src/rasqal_rowsource.c:
(rasqal_rowsource_reset): Return 0 if no handler present - it may
not be needed.
* src/Makefile.am, src/rasqal_rowsource_join.c: Added join
rowsource.
(rasqal_new_join_rowsource): Added join rowsource constructor.
* src/rasqal_rowsource_rowsequence.c: Implement reset method via
rasqal_rowsequence_rowsource_reset
(rasqal_rowsequence_rowsource_read_row): Copy rows to return them.
(rasqal_rowsequence_rowsource_read_all_rows): Create new sequence
to return it.
(rasqal_rowsequence_rowsource_reset): Added.
* src/rasqal_internal.h, src/rasqal_rowsource.c:
(rasqal_rowsource_reset): Added.
rasqal_rowsource_reset_func added
* src/rasqal_rowsource_project.c:
(rasqal_project_rowsource_ensure_variables): Fix offset vars
(main): Make test use non-trivial projection.
* src/Makefile.am, src/rasqal_internal.h,
src/rasqal_rowsource_project.c: Added project (variables
projection) rowsource
(rasqal_new_project_rowsource): Added new project rowsource
constructor.
2008-10-28 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine_algebra.c:
(rasqal_algebra_union_algebra_node_to_rowsource): Added to use
union rowsource to execute UNION.
(rasqal_algebra_node_to_rowsource): Call above for UNION operator.
* src/rasqal_rowsource_union.c: Union rowsource now works.
Constructs a map for moving variable offsets from right rowsource
into results via con->right_map.
(rasqal_union_rowsource_ensure_variables): Construct map while
adding variables from right row to result rowsource.
(rasqal_union_rowsource_adjust_right_row): Added to do right row
variable offset fixing for a row.
(rasqal_union_rowsource_read_row): Expand output row sizes and
adjust offsets if needed. Assign output rowsource and correct
offset.
(rasqal_union_rowsource_read_all_rows): Transform left and right
input rowsequences for correct size, offsets, rowsource. Use
rasqal_union_rowsource_adjust_right_row to adjust right row orders
(main): Update tests to use non-square tables to ensure no
confusion of row/columns
* src/rasqal_internal.h, src/rasqal_rowsource_rowsequence.c: Add
vars_seq to context.
(rasqal_rowsequence_rowsource_init): Adjust offset of all rows.
(rasqal_rowsequence_rowsource_ensure_variables): Add variables
from input variables sequence.
(rasqal_new_rowsequence_rowsource) Now takes in variables sequence
for handling rowsources that share variables.
(main): Update tests to new calling convention and vars_seq.
* src/rasqal_internal.h, src/rasqal_rowsource.c:
(rasqal_rowsource_add_variable): Return offset to var and <0 on
failure.
(rasqal_rowsource_print_row_sequence): Added for debugging.
(rasqal_rowsource_print_header): Added called by above
* src/rasqal_internal.h, src/rasqal_row.c,
src/rasqal_rowsource_rowsequence.c, src/rasqal_rowsource_union.c:
(rasqal_new_row_for_size): Renamed from
rasqal_new_row_for_variables and now with a size
arg. (rasqal_new_row_sequence): Add out parameter vars_seq_p to
return variables sequence in order declared..
2008-10-27 Dave Beckett <dave@dajobe.org>
* src/rasqal_internal.h, src/rasqal_row.c:
(rasqal_row_expand_size): Added to expand a row when it gets
combined with others
* src/rasqal_rowsource_union.c: Union rowsource proper test case
with 2 rowsources that return data. Returns correct counts.
* src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_filter.c, src/rasqal_rowsource_sort.c,
src/rasqal_rowsource_union.c:
(rasqal_rowsource_add_variable): Get int return value to indicate
when a dup variable was not stored.
(rasqal_rowsource_copy_variables): Do not reset dest size to 0.
(rasqal_filter_rowsource_ensure_variables,
rasqal_sort_rowsource_ensure_variables): Set dest rowsource size
to 0.
(rasqal_union_rowsource_ensure_variables): Copy in variables from
both sub-rowsources.
* src/rasqal_row.c: autodocs
* src/rasqal_rowsource.c:
(rasqal_rowsource_copy_variables): Ensure dest size is
correct. autodocs.
* src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_filter.c, src/rasqal_rowsource_sort.c:
(rasqal_rowsource_copy_variables): Added to copy variables from
one rowsource into another.
(rasqal_filter_rowsource_ensure_variables,
rasqal_sort_rowsource_ensure_variables): Use to set up variable
projection sequence from inner rowsource.
2008-10-27 Lauri Aalto <laalto@iki.fi>
* src/rasqal_engine.c:
(rasqal_rowsource_engine_process): Check for
rasqal_row_set_order_size() failure
* src/rasqal_variable.c:
(rasqal_new_variables_table): Set usage count earlier so that
tidying with rasqal_free_variables_table() works.
* src/rasqal_algebra.c, src/rasqal_engine.c, src/rasqal_query.c,
src/rasqal_query_transform.c: whitespace
2008-10-26 Dave Beckett <dave@dajobe.org>
* Checkpoint in query engine refactoring.
SVN 14834 at 2008-10-26 22:28:24 -0700 (Sun, 26 Oct 2008)
A top level 'make check' passes at this SVN commit.
* src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_rowsequence.c,
src/rasqal_rowsource_triples.c, src/rasqal_sparql_xml.c: Restore
variables_sequence to rowsource for use as the projected variables
from the variables table.
(rasqal_new_rowsequence_rowsource): add all named variables using
rasqal_rowsource_add_variable.
(rasqal_rowsource_add_variable): Added/reverted.
(rasqal_sparql_xml_sax2_start_element_handler): Use
rasqal_rowsource_add_variable after rasqal_variables_table_add
creates the variable, to add it to the projection.
(rasqal_triples_rowsource_init): Use
rasqal_query_triples_build_declared_in to initialise projected
variables in rowsource->variables_sequence.
(rasqal_new_rowsource_from_handler, rasqal_free_rowsource):
Restore initialise/free of variables_sequence.
(rasqal_rowsource_get_variable_by_offset,
rasqal_rowsource_get_variable_offset_by_name): Use
variables_sequence to walk the variables associated with the row,
not the variables table.
* src/rasqal_query_transform.c: Document what declared_in
functions are for and revert so that they are marked in graph
pattern order, for query->variables_declared_in. use.
(rasqal_query_triples_build_declared_in_internal): Added, from
part of rasqal_query_build_declared_in.
(rasqal_query_triples_build_declared_in): Added as internal
function for calculating declared_in for a sequence of triples.
(rasqal_query_graph_pattern_build_declared_in): Added/reverted to
calculate it recursively in graph pattern order.
(rasqal_query_build_declared_in): Reverted to do all the work for
a query graph pattern.
(rasqal_query_prepare_common): Use new
rasqal_query_build_declared_in form.
2008-10-25 Dave Beckett <dave@dajobe.org>
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_init): tidy
* src/rasqal_query_transform.c:
(rasqal_query_graph_pattern_build_declared_in_variable): Deleted.
(rasqal_query_graph_pattern_build_declared_in): Deleted.
(rasqal_query_build_declared_in): Comments and work on all triples
in a column range.
(rasqal_query_check_unused_variables): Added to just do checking
and warning.
(rasqal_query_prepare_common): Call rasqal_query_build_declared_in
and rasqal_query_check_unused_variables
* src/rasqal_algebra.c: code style
* src/rasqal_variable.c: code style
* src/rasqal_query_transform.c: code style
* src/rasqal_engine_algebra.c: code style
* src/rasqal_engine.c: code style
* src/rasqal_rowsource_union.c: code style
* src/rasqal_rowsource_union.c: code style
* src/rasqal_rowsource_triples.c: code style
* src/rasqal_rowsource_sort.c: code style
* src/rasqal_rowsource_empty.c: code style
* src/rasqal_rowsource_filter.c: ws
* src/rasqal_engine_sort.c: ws
* src/rasqal_internal.h: rasqal_rowsource docs
* src/rasqal_rowsource.c: code style
* src/rasqal_query_results.c: update internal docs
* src/rasqal_row.c: code style
* tests/engine/rasqal_order_test.c: check arg failure before run
* tests/engine/rasqal_graph_test.c: check arg failure before run
* src/rasqal_query.c: code style
* src/rasqal_query_results.c: code style
* utils/srxread.c: Update to new rasqal_new_query_results args
* src/rasqal_sparql_xml.c:
(rasqal_sparql_xml_sax2_end_element_handler): Set variables
count/size as soon as possible so that rasqal_new_row() works
properly.
(rasqal_query_results_get_rowsource_sparql_xml): Now takes
variables table arg and sets it internally rather than making a
new one.
* src/rasqal_result_formats.c:
(rasqal_query_results_formatter_read): Pass in variables table
from result set when reading results from syntax
* src/rasqal_internal.h: rasqal_query_results_get_rowsource_func
now has a vars_table arg to write new variables found (read from
syntax) into. Added rasqal_query_results_get_variables_table
* src/rasqal_query_results.c:
(rasqal_new_query_results): autodocs
(rasqal_query_results_get_row_from_saved): Handle NULL query
(rasqal_query_results_ensure_have_row_internal): Handle NULL
execution factory.
(rasqal_query_results_get_triple,
rasqal_query_results_next_triple): Fail with result set with NULL
query.
(rasqal_query_results_add_row): Tidy.
(rasqal_query_results_execute_and_store_results): Handle being run
with NULL query.
(rasqal_query_results_get_variables_table): Added.
2008-10-24 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c:
(rasqal_engine_make_rowsource): Update
rasqal_new_rowsource_from_handler call
* src/rasqal_sparql_xml.c: rasqal_rowsource_sparql_xml_context
gains a vars_table field
(rasqal_sparql_xml_sax2_start_element_handler): Add new variable
direct to variables table. Use
rasqal_rowsource_get_variable_offset_by_name to get offset and
rasqal_variables_table_get_named_variables_count to get count.
(rasqal_rowsource_sparql_xml_finish): Call
rasqal_free_variables_table
(rasqal_query_results_get_rowsource_sparql_xml): Create new
variables table.
* src/rasqal_rowsource_union.c:
(rasqal_new_union_rowsource): fail on NULL query, triples_source
or triples. Update rasqal_new_rowsource_from_handler call
(main): Update test to allocate real world and query objects
* src/rasqal_rowsource_triples.c:
(rasqal_new_triples_rowsource): fail on NULL query, triples_source
or triples. Update rasqal_new_rowsource_from_handler call
(main): Update test to allocate real query object
* src/rasqal_rowsource_sort.c:
(rasqal_new_sort_rowsource): Update
rasqal_new_rowsource_from_handler call
* src/rasqal_rowsource_rowsequence.c:
(rasqal_new_rowsequence_rowsource): Update
rasqal_new_rowsource_from_handler call Do not copy variables but
use rasqal_variables_table_get_named_variables_count to get row
size.
(main): Update test to allocate real world and query objects.
* src/rasqal_rowsource_filter.c:
(rasqal_new_filter_rowsource): fail on NULL query, rowsource or
expr. Update rasqal_new_rowsource_from_handler call
* src/rasqal_rowsource_empty.c:
(rasqal_new_empty_rowsource): fail on NULL query Update
rasqal_new_rowsource_from_handler call
(main): Update test to allocate real world and query objects.
* src/rasqal_internal.h: rasqal_rowsource has a variables table to
replace a variables sequence rasqal_new_rowsource_from_handler
prototype gains variables table arg rasqal_rowsource_add_variable
prototype deleted. rasqal_rowsource_get_variable_offset_by_name
has unsigned name
* src/rasqal_rowsource.c:
(rasqal_new_rowsource_from_handler): Add variables table arg to
store variables, shared with other objects such as
query/query_results.
(rasqal_free_rowsource): Free variables table
(rasqal_rowsource_add_variable): Deleted, not needed.
(rasqal_rowsource_get_variable_by_offset): Just call
rasqal_variables_table_get.
(rasqal_rowsource_get_variable_offset_by_name): Just call
rasqal_variables_table_get_by_name
* src/rasqal_engine.c: (rasqal_engine_make_rowsource): Protect
NULL order_conditions_sequence
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_ensure_variables): Do not set order_size
* src/rasqal_rowsource.c:
(rasqal_new_rowsource_from_handler): Note no @flags have been
defined.
* src/rasqal_engine.c:
(rasqal_rowsource_engine_ensure_variables): Do not set order_size,
gone.
(rasqal_engine_make_rowsource): Do not use flags for creating
rowsource, not needed and none defined now.
* src/rasqal_internal.h: Add flags arg back to
rasqal_new_rowsource_from_handler but do not use it.
* src/rasqal_internal.h: Remove flags from rowsource.
* src/rasqal_internal.h: Remove order_size from rowsource. No
need for RASQAL_ROWSOURCE_FLAGS_ORDERING flags for
rasqal_new_rowsource_from_handler
* src/rasqal_engine.c: Calculate order_size once for inner
rowsource.
(rasqal_rowsource_engine_process): Update row size if needed.
(rasqal_rowsource_engine_ensure_variables): Set rowsource order
size from context.
(rasqal_engine_make_rowsource): Calculate order_size here.
* src/rasqal_internal.h, src/rasqal_row.c, src/rasqal_rowsource.c,
src/rasqal_rowsource_filter.c, src/rasqal_rowsource_rowsequence.c,
src/rasqal_rowsource_sort.c: Remove order_size from rowsource - no
longer needed, the sort rowsource or other sorting code stores
this in row or context.
(rasqal_new_row): Use rasqal_rowsource_get_size
(rasqal_rowsource_add_variable): Remove (wrong, bad) reference to
order_size here. It was adding one per variable, which was never
going to be always correct.
(rasqal_rowsource_get_size): Renamed from
rasqal_rowsource_get_sizes
* src/rasqal_internal.h, src/rasqal_row.c:
(rasqal_new_row_from_row_deep): Removed, no longer used
* src/rasqal_internal.h, src/rasqal_row.c, src/rasqal_rowsource_sort.c:
(rasqal_row_set_order_size): renamed from
rasqal_row_move_to_rowsource and just sets order_size.
* src/rasqal_internal.h, src/rasqal_query_results.c,
src/rasqal_result_formats.c, src/rasqal_rowsource.c:
(rasqal_query_results_set_variables): Deleted, just sets size and
this is only needed in 1 place.
(rasqal_rowsource_update_variables): Deleted, since vars table is
shared between query and query results, there is no need to pass
this info along.
(rasqal_query_results_formatter_read): Remove call to
rasqal_rowsource_update_variables.
(rasqal_query_results_execute_with_engine): Remove calls to
rasqal_query_results_set_variables and set size of query results
based on size of top row returned.
2008-10-22 Dave Beckett <dave@dajobe.org>
* src/rasqal_query_results.c: autodocs
* src/rasqal_internal.h, src/rasqal_query_results.c: Remove
variables fields from query results structure and use variables
table, shared with query object. rasqal_query_results loses
order_size field - never used and variable_names,
varaibles_Sequence, variables. Gains pointer to vars_table.
(rasqal_new_query_results): Add vars_table arg.
(rasqal_query_results_execute_with_engine): Use new call for
rasqal_new_query_results and rasqal_query_results_set_variables.
Do not set useless order_size field.
(rasqal_free_query_results): Remove freeing old variables fields,
free vars_table.
(rasqal_query_results_get_bindings): Switch to use
rasqal_variables_table_get_names.
(rasqal_query_results_get_binding_name): Switch to use
rasqal_variables_table_get.
(rasqal_query_results_get_binding_value_by_name): Switch to use
rasqal_variables_table_get_by_name.
(rasqal_query_results_set_variables): Change from variables seq to
variables table. Remove all variables* fields setting. Do not
set order_size which is never used.
(rasqal_query_results_update_bindings): Use query_results
variables table and tidy code.
* src/rasqal_query.c:
(rasqal_free_query): Do not free vars table twice.
* src/rasqal_variable.c:
(rasqal_new_variables_table): Set initial usage to 1
* src/rasqal_query_results.c: revert
* src/rasqal_query_results.c:
(rasqal_free_query_results): Free variables table
* src/rasqal_query.c:
(rasqal_free_query): Free variables table
* src/rasqal_query_results.c:
(rasqal_query_results_execute_with_engine): Call
rasqal_new_query_results with world
* src/rasqal_query_results.c: Use results world field in
preference to query world field
* src/rasqal_internal.h, src/rasqal_query_results.c:
(rasqal_new_query_results): Add world and type arg.
(rasqal_query_results_execute_with_engine): Update calling
convention and compute results type first.
* src/rasqal_internal.h: Added prototypes for
rasqal_new_variables_table_from_variables_table and
rasqal_variables_table_get_names
* src/rasqal_variable.c: Add generating of variable names and
reference/usage counting.
(rasqal_new_variables_table_from_variables_table): Added copy
constructor to increase reference count.
(rasqal_free_variables_table): Free only when use count is 0.
(rasqal_variables_table_add): Delete any variable names list when
a new variable is added.
(rasqal_variables_table_get_names): Added
2008-10-20 Lauri Aalto <laalto@iki.fi>
* src/rasqal_map.c:
(rasqal_new_map): Free compare_data on alloc failure.
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_read_row): Fixed compiler warning about
unused variable when not compiling in debug mode
2008-10-18 Dave Beckett <dave@dajobe.org>
* src/rasqal_internal.h, src/rasqal_variable.c:
(rasqal_variables_table_get_by_name): Renamed from
rasqal_variables_table_find_by_name and made public.
* src/rasqal_engine.c, src/rasqal_engine_sort.c,
src/rasqal_internal.h, src/rasqal_map.c,
src/rasqal_rowsource_sort.c: Alter rasqal_compare_fn to take a
user data pointer in map comparisons.
(rasqal_new_map): Take a compare_user_data pointer and free
function to pass in state to comparisons.
(rasqal_free_map): Free compare data if a free function is passed.
(rasqal_map_node_add_kv): Call compare function with user data.
(rasqal_engine_rowsort_compare_literals_sequence): Take
compare_flags arg not query, and pass on to
rasqal_literal_compare.
(rasqal_engine_rowsort_free_compare_data): Added.
(rasqal_engine_rowsort_row_compare): Use rowsort_compare_data
pointer to get distinct, compare_flags and
order_conditions_sequence args context as passed in by
rasqal_engine_new_rowsort_map.
(rasqal_engine_rowsort_row_compare_distinct): Deleted.
(rasqal_engine_new_rowsort_map): add distinct, compare_flags and
order_conditions_sequence constructor args.
(rasqal_engine_make_rowsource,rasqal_sort_rowsource_init):
Update calls to rasqal_engine_new_rowsort_map.
* src/rasqal_internal.h: Added prototypes for
rasqal_row_set_values_from_variables_table,
rasqal_row_move_to_rowsource and
rasqal_engine_rowsort_calculate_order_values
* src/rasqal_rowsource_triples.c:
(rasqal_triples_rowsource_read_row): Use
rasqal_row_set_values_from_variables_table to copy/set row values.
* src/rasqal_rowsource_sort.c: rasqal_sort_rowsource_context gains
an order_size field to save re-calculating this many times.
(rasqal_sort_rowsource_init): Calculate order_size for above. Do
not init con->seq here since it may not be needed.
(rasqal_sort_rowsource_process): Init con->seq here. Use
rasqal_row_move_to_rowsource and
rasqal_engine_rowsort_calculate_order_values to freshen and
calculate any new row fields needed for sorting.
(rasqal_sort_rowsource_read_all_rows): If no ordering conditions
exist, just call rowsource read_all_rows method.
* src/rasqal_row.c:
(rasqal_row_set_values_from_variables_table): Added based on
former rasqal_engine_row_update code.
(rasqal_row_move_to_rowsource): Added to reassign/move a row to a
new rowsource and if necessary, allocate the order_values of the
new rowsource.
* src/rasqal_engine_sort.c:
(rasqal_engine_rowsort_calculate_order_values): Added based on
former rasqal_engine_row_update code
* src/rasqal_engine.c:
(rasqal_engine_row_update): Turned into calls to two new
functions: rasqal_row_set_values_from_variables_table and
rasqal_engine_rowsort_calculate_order_values
2008-10-15 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c: rasqal_engine_execution_data gains row size
field.
(rasqal_engine_get_next_result, rasqal_engine_row_update,
rasqal_rowsource_engine_ensure_variables): Do not calc size here,
use execution_data->size
(rasqal_query_engine_1_execute_init): Init size
* src/rasqal_engine_sort.c: autodocs
* src/rasqal_engine.c:
(rasqal_engine_row_update): Use query direct, do not
query_results, can assume that the query results is of right type
in this internal function.
* src/Makefile.am, src/rasqal_engine_algebra.c,
src/rasqal_rowsource_sort.c:
(rasqal_algebra_orderby_algebra_node_to_rowsource): Added
(rasqal_algebra_node_to_rowsource): Use above for ORDERBY algebra
node.
Added sort rowsource
(rasqal_new_sort_rowsource): Added sort rowsource constructor.
* src/rasqal_rowsource_filter.c:
(rasqal_filter_rowsource_finish): Free inner rowsource when done.
2008-10-14 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c, src/rasqal_engine_sort.c,
src/rasqal_internal.h: Moved all engine sorting routines into new
rasqal_engine_sort.c
(rasqal_rowsource_engine_process): Call new
rasqal_engine_rowsort_map_add_row to build the map and
rasqal_engine_rowsort_map_to_sequence to do the sorting.
(rasqal_engine_make_rowsource): Use new
rasqal_engine_new_rowsort_map to create the rowsource sorting map,
with distinct flags.
(rasqal_engine_rowsort_compare_literals_sequence): Added based on
rasqal_query_result_literal_sequence_compare.
(rasqal_engine_rowsort_literal_sequence_equals): Added based on
rasqal_query_result_literal_sequence_equals. Removed query arg.
(rasqal_engine_rowsort_row_compare,
rasqal_engine_rowsort_row_compare_distinct): Added based on
rasqal_engine_row_compare with distinct/not-distinct case pulled out.
(rasqal_engine_rowsort_map_free_row): Added based on
rasqal_engine_map_free_row.
(rasqal_engine_rowsort_map_print_row): Added based on
rasqal_engine_map_print_row.
(rasqal_engine_new_rowsort_map): Added
(rasqal_engine_rowsort_map_add_row): Added
(rasqal_engine_rowsort_map_add_to_sequence): Added based on
rasqal_engine_map_add_to_sequence.
(rasqal_engine_rowsort_map_to_sequence): Added to do the sorting.
* src/rasqal_internal.h: struct rasqal_algebra_node_s gains seq
for ORDERBY. Added rasqal_new_orderby_algebra_node prototype
* src/rasqal_algebra.c:
(rasqal_new_orderby_algebra_node): Added with a sequence of
expressions in ->seq
(rasqal_free_algebra_node): Free sequence.
(rasqal_algebra_algebra_node_write_internal): Write conditions
seq.
(rasqal_algebra_query_to_algebra): Add ORDERBY algebra node if an
order conditions sequence is present.
(main): Add ORDERBY algebra node to test
* src/rasqal_engine.c, src/rasqal_query_results.c:
(rasqal_query_results_ensure_have_row_internal): Invoke
rasqal_row_to_nodes here after getting a new row, for all query
execution engines.
(rasqal_query_engine_1_get_row): Remove call from here.
2008-10-13 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine.c: Give rowsources a name
* src/rasqal_internal.h, src/rasqal_rowsource.c,
src/rasqal_rowsource_empty.c, src/rasqal_rowsource_filter.c,
src/rasqal_rowsource_rowsequence.c,
src/rasqal_rowsource_triples.c, src/rasqal_rowsource_union.c,
src/rasqal_sparql_xml.c: Give rowsources a name
2008-10-13 Lauri Aalto <laalto@iki.fi>
* src/rasqal_query.c:
(rasqal_query_add_query_result): Changed static function to return
int error code. Switch order of usage counter increment and
sequence push to ensure the sequence free handler does not kill
the query object if sequence push fails.
(rasqal_query_execute_with_engine): Check return value from
rasqal_query_add_query_result() and return failure accordingly.
* src/rasqal_engine.c:
(rasqal_query_engine_1_execute_init): Set error_p on gp_data
alloc/push failure
2008-10-12 Lauri Aalto <laalto@iki.fi>
* src/rasqal_rowsource_triples.c:
(main): Fixed test segfaults in RAPTOR_V2_AVAILABLE mode.
2008-10-12 Dave Beckett <dave@dajobe.org>
* src/rasqal_engine_algebra.c:
(rasqal_algebra_filter_algebra_node_to_rowsource): Added, calling
rasqal_new_filter_rowsource
(rasqal_algebra_node_to_rowsource): Handle
RASQAL_ALGEBRA_OPERATOR_FILTER
* src/rasqal_internal.h: Added rasqal_new_filter_rowsource
* src/Makefile.am, src/rasqal_rowsource_filter.c: Added Rasqal
filter rowsource class
* src/rasqal_query.c:
(rasqal_query_get_engine_by_name): Allow overriding query engine
with envariable RASQAL_DEBUG_ENGINE
* src/Makefile.am: Make rasqal_rowsource_triples_test run
* src/rasqal_rowsource_triples.c:
(main): unit test work
* data/Makefile.am, data/one.nt: Added one.net
* src/rasqal_engine_algebra.c:
(rasqal_algebra_basic_algebra_node_to_rowsource): Added.
(rasqal_algebra_node_to_rowsource): Added, calling
rasqal_algebra_basic_algebra_node_to_rowsource for BGP nodes.
(rasqal_query_engine_algebra_execute_init): Make triples source,
turn the graph pattern tree into algebra and make a rowsource to
execute it.
(rasqal_query_engine_algebra_get_all_rows,
rasqal_query_engine_algebra_get_row): Call rowsource to execute
query.
(rasqal_query_engine_algebra_execute_finish): Free triples source
and rowsource.
* src/rasqal_internal.h: Added rasqal_new_triples_rowsource prototype
* src/Makefile.am, src/rasqal_rowsource_triples.c: Added
rasqal_rowsource_triples.c providing a triple pattern
rowsource. (rasqal_new_triples_rowsource): Added - the
constructor for this rowsource.
* src/rasqal_engine_algebra.c:
(rasqal_query_engine_algebra_execute_get_all_rows,
rasqal_query_engine_algebra_execute_get_row): Finish immediately
2008-10-11 Dave Beckett <dave@dajobe.org>
* docs/tmpl/section-data.sgml, docs/tmpl/section-expression.sgml,
docs/tmpl/section-general.sgml, docs/tmpl/section-prefix.sgml: api
docs tmpls
* src/Makefile.am, src/rasqal_engine.c, src/rasqal_internal.h,
src/rasqal_triples_source.c: Separate triples source from engine V1
Export rasqal_new_triples_source, rasqal_reset_triple_meta,
rasqal_free_triples_source, rasqal_triples_source_triple_present,
rasqal_new_triples_match, rasqal_triples_match_bind_match,
rasqal_triples_match_next_match and rasqal_triples_match_is_end
(rasqal_new_triples_source): Change calling convention to take a
query.
(rasqal_new_triples_match): Change calling convention to take a query
and triples_source as made by rasqal_new_triples_source().
* src/rasqal_engine.c: rasqal_new_triples_source switch back to
use query direct
* src/rasqal_graph_pattern.c: style