Experiment on Big Heterogeneous Datasources
This experiments are made following this details.
Methods Comparison
Total time
It is the total query answering time.
The materialization (MATREF) takes 14h46min (53 199 182 ms) to compute and contains 108 506 391 triples. The saturated materialization (MATSAT) takes 16h14min (58 485 693 ms) to compute and contains 184 859 306 triples.
Main Statistics on Queries
index | Q01 | Q01a | Q01b | Q02 | Q02a | Q02b | Q02c | Q03 | Q04 | Q07 | Q07a | Q09 | Q10 | Q13 | Q13a | Q13b | Q14 | Q16 | Q19 | Q19a | Q20 | Q20a | Q20b | Q20c | Q21 | Q22 | Q22a | Q23 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NTRI | 5 | 5 | 5 | 6 | 6 | 6 | 6 | 5 | 2 | 3 | 3 | 1 | 3 | 4 | 4 | 4 | 3 | 4 | 9 | 9 | 11 | 11 | 11 | 11 | 3 | 4 | 4 | 7 |
NREF | 21 | 175 | 1407 | 63 | 147 | 525 | 1225 | 4375 | 1 | 5 | 19 | 7 | 9350 | 84 | 5628 | 5628 | 1 | 201 | 525 | 1225 | 63 | 525 | 1225 | 4221 | 9350 | 40 | 520 | 192 |
NANS | 15514 | 111793 | 863729 | 124 | 598 | 1058 | 1570 | 5 | 4487 | 2 | 3 | 299902 | 10 | 167760 | 4416946 | 10049829 | 2998948 | 249004 | 39826 | 60834 | 904 | 7818 | 10486 | 51988 | 37176 | 1528 | 18588 | 1329887 |
Rewritings Processing Time
Rewritings processing is the part of query answering that concerns only rewriting building and rewriting optimization. It doesn't includes the query plan optimization and evaluation.
import sys sys.path.append('../../') from exp import print_group files = { 'REW-C': rewor, 'REW-CA': ref } return print_group(files, group[0], title, True)
Query Plan Processing Time
Query plan processing time are the sum of query plan optimization and query plan evaluation. Since the two method returns minimal equivalent rewriting set, we expect that there is no time different between the two method at this step.
Reformulation Based Method (REW-CA
)
Raw Statistics
INPUT | NANS | NTRI | NREF | NREW | NCLASH | NCOVER | TREF | TREW | TCLASH | TCOVER | TCORE | TOP | TQEV | TTOTAL |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Q01 | 15514.0 | 5.0 | 21.0 | 16.0 | 12.0 | 4.0 | 0.2 | 1231.2 | 0.0 | 0.8 | 27.0 | 2.2 | 380.0 | 1641.4 |
Q01a | 111793.0 | 5.0 | 175.0 | 128.0 | 96.0 | 32.0 | 3.2 | 10204.8 | 1.0 | 10.2 | 191.0 | 13.2 | 2671.4 | 13094.8 |
Q01b | 863729.0 | 5.0 | 1407.0 | 1024.0 | 768.0 | 256.0 | 20.8 | 80808.8 | 10.0 | 157.0 | 1453.8 | 126.0 | 21081.4 | 103657.8 |
Q02 | 124.0 | 6.0 | 63.0 | 32.0 | 24.0 | 8.0 | 1.0 | 17456.0 | 0.4 | 1.4 | 43.2 | 4.6 | 709.6 | 18216.2 |
Q02a | 598.0 | 6.0 | 147.0 | 64.0 | 48.0 | 16.0 | 3.4 | 40490.4 | 0.8 | 5.0 | 83.2 | 7.4 | 1411.4 | 42001.6 |
Q04 | 4487.0 | 2.0 | 1.0 | 8.0 | 6.0 | 2.0 | 0.0 | 31.0 | 0.0 | 0.0 | 1.2 | 0.6 | 37.0 | 69.8 |
Q05 | 3000000.0 | 4.0 | 1.0 | 8.0 | 7.0 | 1.0 | 0.0 | 28.0 | 0.0 | 0.0 | 3.0 | 0.6 | 50978.6 | 51010.2 |
Q05a | 1793489.0 | 4.0 | 3.0 | 2.0 | nan | 2.0 | 0.8 | 387.0 | 0.0 | 0.0 | 1.6 | 1.4 | 300175.0 | 300565.8 |
Q05b | 2454945.0 | 4.0 | 7.0 | 4.0 | nan | 4.0 | 0.8 | 890.0 | 0.0 | 0.0 | 3.0 | 2.0 | 454889.8 | 455785.6 |
Q06 | 2790902.0 | 3.0 | 5.0 | 2.0 | nan | 2.0 | 0.4 | 354.6 | 0.0 | 0.2 | 4.6 | 1.8 | 13338.6 | 13700.2 |
Q07 | 2.0 | 3.0 | 5.0 | 2562.0 | nan | 2562.0 | 0.0 | 586.2 | 3.8 | 2864.4 | 219.4 | 3197.6 | 81920.2 | 88791.6 |
Q07a | 3.0 | 3.0 | 19.0 | 10248.0 | nan | 5124.0 | 0.2 | 2481.2 | 14.8 | 22738.8 | 451.8 | 11975.2 | 165041.4 | 202703.4 |
Q08 | 3000000.0 | 3.0 | 1.0 | 1.0 | nan | 1.0 | 0.2 | 28.6 | 0.0 | 0.0 | 4.8 | 0.2 | 32135.6 | 32169.4 |
Q09 | 299902.0 | 1.0 | 7.0 | 2.0 | nan | 2.0 | 0.0 | 210.4 | 0.0 | 0.4 | 3.6 | 0.8 | 798.4 | 1013.6 |
Q12 | 14571.0 | 5.0 | 2.0 | 8.0 | 7.0 | 1.0 | 0.0 | 322.6 | 0.0 | 0.0 | 2.0 | 1.0 | 1891.0 | 2216.6 |
Q12a | 31322.0 | 5.0 | 6.0 | 16.0 | 14.0 | 2.0 | 0.6 | 951.2 | 0.0 | 0.0 | 3.6 | 1.4 | 5902.2 | 6859.0 |
Q12b | 117426.0 | 5.0 | 14.0 | 32.0 | 28.0 | 4.0 | 0.2 | 2209.2 | 0.2 | 0.0 | 7.4 | 2.0 | 16781.4 | 19000.4 |
Q13 | 167760.0 | 4.0 | 84.0 | 50.0 | nan | 42.0 | 1.2 | 6384.4 | 1.2 | 37.0 | 91.6 | 28.8 | 4563.2 | 11107.4 |
Q13a | 4416946.0 | 4.0 | 5628.0 | 3200.0 | nan | 2688.0 | 51.6 | 404721.0 | 33.0 | 7990.6 | 5587.6 | 5458.0 | 155930.0 | 579771.8 |
Q14 | 2998948.4 | 3.0 | 1.0 | 1.0 | nan | 1.0 | 0.0 | 146.4 | 0.4 | 0.0 | 4.2 | 0.6 | 61008.0 | 61159.6 |
Q15 | 1500000.0 | 5.0 | 1.0 | 4.0 | 3.0 | 1.0 | 0.4 | 107.4 | 0.0 | 0.0 | 4.0 | 1.6 | 13251.6 | 13365.0 |
Q16 | 249004.0 | 4.0 | 201.0 | 128.0 | nan | 128.0 | 2.0 | 16433.6 | 1.2 | 22.2 | 424.8 | 48.4 | 7483.2 | 24415.4 |
Q17 | 2790902.0 | 2.0 | 5.0 | 2.0 | nan | 2.0 | 0.4 | 284.2 | 0.0 | 0.2 | 3.2 | 1.0 | 10033.8 | 10322.8 |
Q18 | 3000000.0 | 4.0 | 1.0 | 4.0 | 3.0 | 1.0 | 0.2 | 96.0 | 0.0 | 0.0 | 6.6 | 0.6 | 64370.6 | 64474.0 |
Q19 | 39826.0 | 9.0 | 525.0 | 448.0 | nan | 128.0 | 15.4 | 287570.8 | 5.8 | 907.8 | 913.0 | 78.4 | 14308.2 | 303799.4 |
Q20 | 904.0 | 11.0 | 63.0 | 8.0 | nan | 8.0 | 2.0 | 48600.2 | 1.2 | 98.4 | 78.2 | 8.8 | 1066.2 | 49855.0 |
Q20a | 7818.0 | 11.0 | 525.0 | 64.0 | nan | 64.0 | 18.2 | 386304.6 | 3.2 | 787.2 | 632.4 | 59.6 | 7922.6 | 395727.8 |
Q21 | 37176.0 | 3.0 | 9350.0 | 14180.0 | 6486.0 | 6401.0 | 98.8 | 117456.6 | 67.4 | 32073.4 | 952.6 | 18903.2 | 321322.8 | 490874.8 |
Q22 | 1528.0 | 4.0 | 40.0 | 32.0 | nan | 32.0 | 1.2 | 565.2 | 0.2 | 1.6 | 7.0 | 4.6 | 2213.8 | 2793.6 |
Q22a | 18588.0 | 4.0 | 520.0 | 384.0 | nan | 384.0 | 6.4 | 6712.0 | 3.2 | 141.6 | 51.8 | 120.6 | 26463.6 | 33499.2 |
Q23 | 1329887.0 | 7.0 | 192.0 | 80.0 | 56.0 | 24.0 | 3.8 | 32940.4 | 1.6 | 9.6 | 35.8 | 16.0 | 60639.0 | 93646.2 |
Q23a | 2008985.0 | 7.0 | 448.0 | 160.0 | 112.0 | 48.0 | 5.8 | 76443.4 | 2.6 | 25.4 | 75.0 | 27.2 | 110847.4 | 187426.8 |
Rewriting Numbers
Rewriting Processing Times
Query Plan Processing Times
Rewriting Based Method (REW-C
)
Raw Statistics
INPUT | NANS | NTRI | NREF | NREW | NCLASH | NCOVER | TREF | TREW | TCLASH | TCOVER | TCORE | TOP | TQEV | TTOTAL |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Q01 | 15514.0 | 5.0 | 1.0 | 16.0 | 12.0 | 4.0 | 0.2 | 523.0 | 0.0 | 0.6 | 26.0 | 2.6 | 353.0 | 905.4 |
Q01a | 111793.0 | 5.0 | 1.0 | 128.0 | 96.0 | 32.0 | 0.4 | 479.4 | 0.2 | 5.8 | 204.0 | 12.8 | 2675.8 | 3378.4 |
Q01b | 863729.0 | 5.0 | 1.0 | 1024.0 | 768.0 | 256.0 | 0.0 | 527.8 | 1.2 | 74.6 | 1773.0 | 134.4 | 21793.0 | 24304.0 |
Q02 | 124.0 | 6.0 | 1.0 | 32.0 | 24.0 | 8.0 | 0.0 | 652.8 | 0.2 | 1.2 | 49.2 | 4.0 | 704.4 | 1411.8 |
Q02a | 598.0 | 6.0 | 1.0 | 64.0 | 48.0 | 16.0 | 0.0 | 696.0 | 0.4 | 2.6 | 108.6 | 7.6 | 1477.2 | 2292.4 |
Q02b | 1058.0 | 6.0 | 1.0 | 256.0 | 192.0 | 64.0 | 0.0 | 711.6 | 0.4 | 12.8 | 410.0 | 29.4 | 5484.6 | 6648.8 |
Q02c | 1570.0 | 6.0 | 1.0 | 512.0 | 384.0 | 128.0 | 0.0 | 869.0 | 1.0 | 34.4 | 1165.2 | 77.4 | 10998.4 | 13145.4 |
Q03 | 5.0 | 5.0 | 1.0 | 1024.0 | nan | 512.0 | 0.2 | 539.6 | 2.4 | 387.8 | 9701.8 | 823.8 | 6648.4 | 18104.0 |
Q04 | 4487.0 | 2.0 | 1.0 | 8.0 | 6.0 | 2.0 | 0.6 | 135.6 | 0.0 | 0.0 | 1.6 | 0.2 | 33.2 | 171.2 |
Q05 | 3000000.0 | 4.0 | 1.0 | 8.0 | 7.0 | 1.0 | 0.4 | 118.6 | 0.0 | 0.0 | 3.0 | 0.6 | 54116.2 | 54238.8 |
Q05a | 1793489.0 | 4.0 | 1.0 | 2.0 | nan | 2.0 | 0.8 | 391.2 | 0.0 | 0.0 | 1.6 | 1.6 | 296631.6 | 297026.8 |
Q05b | 2454945.0 | 4.0 | 1.0 | 4.0 | nan | 4.0 | 0.4 | 397.8 | 0.0 | 0.0 | 3.6 | 2.2 | 450208.6 | 450612.6 |
Q06 | 2790902.0 | 3.0 | 1.0 | 2.0 | nan | 2.0 | 0.4 | 222.6 | 0.0 | 0.4 | 4.0 | 2.0 | 14106.2 | 14335.6 |
Q07 | 2.0 | 3.0 | 1.0 | 2562.0 | nan | 2562.0 | 0.2 | 450.4 | 3.0 | 2727.0 | 215.0 | 3109.6 | 87307.6 | 93812.8 |
Q07a | 3.0 | 3.0 | 1.0 | 5124.0 | nan | 5124.0 | 0.0 | 486.4 | 6.6 | 11311.0 | 449.4 | 11790.6 | 176115.0 | 200159.0 |
Q08 | 3000000.0 | 3.0 | 1.0 | 1.0 | nan | 1.0 | 0.0 | 121.4 | 0.0 | 0.0 | 5.4 | 0.2 | 34601.0 | 34728.0 |
Q09 | 299902.0 | 1.0 | 1.0 | 2.0 | nan | 2.0 | 0.0 | 247.0 | 0.0 | 0.0 | 4.0 | 0.8 | 933.8 | 1185.6 |
Q10 | 10.0 | 3.0 | 1.0 | 7690.0 | nan | 7690.0 | 0.4 | 1154.4 | 11.8 | 26121.2 | 831.4 | 29326.2 | 269706.4 | 327151.8 |
Q12 | 14571.0 | 5.0 | 2.0 | 8.0 | 7.0 | 1.0 | 371.8 | 729.0 | 0.0 | 0.0 | 1.8 | 0.8 | 1906.6 | 3010.0 |
Q12a | 31322.0 | 5.0 | 2.0 | 16.0 | 14.0 | 2.0 | 362.0 | 710.6 | 0.2 | 0.0 | 3.6 | 1.0 | 5876.2 | 6953.6 |
Q12b | 117426.0 | 5.0 | 2.0 | 32.0 | 28.0 | 4.0 | 375.2 | 744.4 | 0.2 | 0.0 | 7.2 | 2.2 | 16959.0 | 18088.2 |
Q13 | 167760.0 | 4.0 | 16.0 | 50.0 | nan | 42.0 | 5.4 | 3358.0 | 0.4 | 27.8 | 91.2 | 34.6 | 4506.4 | 8023.8 |
Q13a | 4416946.0 | 4.0 | 16.0 | 3200.0 | nan | 2688.0 | 3.2 | 3736.4 | 4.2 | 5509.2 | 6140.8 | 5534.0 | 164572.2 | 185500.0 |
Q13b | 10049829.0 | 4.0 | 16.0 | 3200.0 | nan | 2688.0 | 4.0 | 3587.6 | 2.8 | 5708.8 | 5722.6 | 6440.8 | 300195.2 | 321661.8 |
Q14 | 2998948.4 | 3.0 | 1.0 | 1.0 | nan | 1.0 | 0.2 | 389.4 | 0.0 | 0.0 | 4.2 | 0.6 | 64212.4 | 64606.8 |
Q15 | 1500000.0 | 5.0 | 1.0 | 4.0 | 3.0 | 1.0 | 0.0 | 290.8 | 0.0 | 0.0 | 4.4 | 1.4 | 13704.2 | 14000.8 |
Q16 | 249004.0 | 4.0 | 1.0 | 128.0 | nan | 128.0 | 0.0 | 307.4 | 0.2 | 10.2 | 504.4 | 52.4 | 7736.2 | 8610.8 |
Q17 | 2790902.0 | 2.0 | 1.0 | 2.0 | nan | 2.0 | 0.4 | 198.0 | 0.0 | 0.0 | 3.4 | 1.0 | 12407.4 | 12610.2 |
Q18 | 3000000.0 | 4.0 | 1.0 | 4.0 | 3.0 | 1.0 | 0.6 | 276.2 | 0.0 | 0.0 | 6.6 | 0.6 | 63354.0 | 63638.0 |
Q19 | 39826.0 | 9.0 | 1.0 | 448.0 | nan | 128.0 | 0.0 | 1130.0 | 1.0 | 1157.6 | 920.4 | 76.2 | 14583.6 | 17868.8 |
Q19a | 60834.0 | 9.0 | 1.0 | 896.0 | nan | 256.0 | 0.4 | 1483.4 | 2.6 | 2428.6 | 2287.8 | 192.6 | 28122.8 | 34518.2 |
Q20 | 904.0 | 11.0 | 1.0 | 8.0 | nan | 8.0 | 0.0 | 1775.4 | 0.0 | 96.0 | 128.0 | 12.4 | 1037.6 | 3049.4 |
Q20a | 7818.0 | 11.0 | 1.0 | 64.0 | nan | 64.0 | 0.2 | 1694.6 | 0.4 | 739.0 | 878.2 | 74.6 | 8070.4 | 11457.4 |
Q20b | 10486.0 | 11.0 | 1.0 | 128.0 | nan | 128.0 | 0.2 | 1737.8 | 1.0 | 1515.6 | 1520.2 | 136.2 | 15929.6 | 20840.6 |
Q20c | 51988.0 | 11.0 | 1.0 | 512.0 | nan | 512.0 | 0.2 | 1852.0 | 2.8 | 5983.2 | 6462.2 | 793.2 | 63439.0 | 78532.6 |
Q20d | 201747.0 | 11.0 | 1.0 | 1024.0 | nan | 1024.0 | 0.0 | 1580.0 | 6.0 | 13355.0 | 11889.4 | 1773.2 | 131285.4 | 159889.0 |
Q21 | 37176.0 | 3.0 | 1.0 | 12865.0 | 6459.0 | 6401.0 | 0.0 | 805.8 | 16.6 | 17698.4 | 800.0 | 18429.2 | 318242.4 | 355992.4 |
Q22 | 1528.0 | 4.0 | 24.0 | 32.0 | nan | 32.0 | 0.4 | 1765.0 | 0.2 | 1.4 | 4.2 | 4.0 | 2230.4 | 4005.6 |
Q22a | 18588.0 | 4.0 | 200.0 | 384.0 | nan | 384.0 | 2.4 | 14818.6 | 3.8 | 102.0 | 48.4 | 109.2 | 26677.0 | 41761.4 |
Q23 | 1329887.0 | 7.0 | 64.0 | 80.0 | 56.0 | 24.0 | 701.8 | 23739.4 | 1.0 | 9.4 | 37.8 | 13.0 | 70163.4 | 94665.8 |
Q23a | 2008985.0 | 7.0 | 64.0 | 160.0 | 112.0 | 48.0 | 801.6 | 24911.8 | 1.6 | 19.8 | 77.4 | 24.6 | 128757.6 | 154594.4 |
Rewriting Numbers
Rewriting Processing Times
Query Plan Processing Times
Queries
Queries are build by groups of Q, Qa, Qb … where Qb is always more general than Qa according to the ontology.
Q01<$label, $featureLabel, $value> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType255>), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, $featureLabel), triple($product, <bsbm:productPropertyNumeric>, $value); Q01a<$label, $featureLabel, $value> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType32>), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, $featureLabel), triple($product, <bsbm:productPropertyNumeric>, $value); Q01b<$label, $featureLabel, $value> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType4>), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, $featureLabel), triple($product, <bsbm:productPropertyNumeric>, $value); Q02<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType255>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q02<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType255>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q02old<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType255>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q02a<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType255>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType1>); Q02b<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType32>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType21>); Q02c<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType32>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType2>); Q02d<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType4>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q02e<$label, $value, $country> :- triple($product, <rdfs:label>, $label), triple($product, <rdf:type>, <bsbm-int:ProductType4>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType1>); Q03<$product1, $product2> :- triple($product1, <rdf:type>, <bsbm-int:ProductType32>), triple($product1, <bsbm:productPropertyNumeric>, "1265"), triple($product1, <bsbm:producer>, $producer), triple($product2, <rdf:type>, <bsbm-int:ProductType26>), triple($product2, <bsbm:producer>, $producer); Q04<$vendor, $vendorLabel, $vendorHomepage> :- triple($vendor, <rdfs:label>, $vendorLabel), triple($vendor, <foaf:homepage>, $vendorHomepage); Q05<$offer, $offerURL, $vendor, $vendorLabel, $vendorHomepage> :- triple($offer, <bsbm:vendor>, $vendor), triple($offer, <bsbm:offerWebpage>, $offerURL), triple($vendor, <rdfs:label>, $vendorLabel), triple($vendor, <foaf:homepage>, $vendorHomepage); Q05a<$offer, $offerURL> :- triple($offer, <bsbm:vendor>, $vendor), triple($offer, <bsbm:offerWebpage>, $offerURL), triple($vendor, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType11>); Q05b<$offer, $offerURL> :- triple($offer, <bsbm:vendor>, $vendor), triple($offer, <bsbm:offerWebpage>, $offerURL), triple($vendor, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType1>); # add condition on reviewer country and/or on product type and/or producer country Q06<$review, $product, $rating> :- triple($review, <bsbm:reviewFor>, $product), triple($review, <http://purl.org/stuff/rev#reviewer>, $reviewer), triple($review, <bsbm:rating>, $rating); Q06a<$review, $product, $rating> :- triple($review, <bsbm:reviewFor>, $product), triple($review, <http://purl.org/stuff/rev#reviewer>, $reviewer), triple($review, <bsbm:rating>, $rating), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType11>); Q06b<$review, $product, $rating> :- triple($review, <bsbm:reviewFor>, $product), triple($review, <http://purl.org/stuff/rev#reviewer>, $reviewer), triple($review, <bsbm:rating>, $rating), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType2>); Q07<$country> :- triple($org, <rdf:type>, <foaf:Organization>), triple($org, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType222>); Q07a<$country> :- triple($org, <rdf:type>, <foaf:Organization>), triple($org, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType22>); Q08<$offer, $offerURL, $price, $deliveryDays> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays); Q09<$product, $value> :- triple($product, <bsbm:productPropertyNumeric>, $value); Q10<$country, $agentType> :- triple($agent, <rdf:type>, $agentType), triple($agent, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType222>); Q10a<$country, $agentType> :- triple($agent, <rdf:type>, $agentType), triple($agent, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType22>); Q10b<$country, $agentType> :- triple($agent, <rdf:type>, $agentType), triple($agent, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType2>); Q11<$label, $p, $country> :- triple($x, <rdfs:label>, $label), triple($x, $p, $org), triple($org, <rdf:type>, <foaf:Organization>), triple($org, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType222>); Q12<$label, $p, $country> :- triple($x, <rdfs:label>, $label), triple($x, $p, $org), triple($p, <rdfs:range>, <foaf:Organization>), triple($org, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType222>); Q12a<$label, $p, $country> :- triple($x, <rdfs:label>, $label), triple($x, $p, $org), triple($p, <rdfs:range>, <foaf:Organization>), triple($org, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType21>); Q12b<$label, $p, $country> :- triple($x, <rdfs:label>, $label), triple($x, $p, $org), triple($p, <rdfs:range>, <foaf:Organization>), triple($org, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType1>); Q13<$offer, $prop, $value> :- triple($offer, <bsbm:product>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType110>), triple($product, $prop, $value), triple($prop, <rdfs:domain>, <bsbm:Product>); Q13a<$offer, $prop, $value> :- triple($offer, <bsbm:product>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType8>), triple($product, $prop, $value), triple($prop, <rdfs:domain>, <bsbm:Product>); Q13b<$offer, $prop, $value> :- triple($offer, <bsbm:product>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType2>), triple($product, $prop, $value), triple($prop, <rdfs:domain>, <bsbm:Product>); Q14<$product, $p, $offer, $vendor> :- triple($product, <bsbm:producer>, $p), triple($offer, <bsbm:product>, $product), triple($offer, <bsbm:vendor>, $vendor); Q15<$review, $product, $label, $personName, $title> :- triple($product, <rdfs:label>, $label), triple($review, <bsbm:reviewFor>, $product), triple($review, <http://purl.org/stuff/rev#reviewer>, $person), triple($person, <foaf:name>, $personName), triple($review, <http://purl.org/dc/elements/1.1/title>, $title); Q16<$review, $product, $title, $text> :- triple($review, <bsbm:reviewFor>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType2>), triple($review, <http://purl.org/dc/elements/1.1/title>, $title), triple($review, <http://purl.org/stuff/rev#text>, $text); Q17<$review, $product, $rating> :- triple($review, <bsbm:reviewFor>, $product), triple($review, <bsbm:rating>, $rating); Q18<$offer, $product, $label, $vendor, $price> :- triple($offer, <bsbm:product>, $product), triple($product, <rdfs:label>, $label), triple($offer, <bsbm:vendor>, $vendor), triple($offer, <bsbm:price>, $price); Q19<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType32>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q19a<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType32>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType2>); Q19b<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType3>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q19c<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <rdf:type>, <bsbm-int:ProductType2>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType2>); Q20<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, <bsbm-int:ProductType122>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q20a<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, <bsbm-int:ProductType15>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q20b<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, <bsbm-int:ProductType15>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType2>); Q20c<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, <bsbm-int:ProductType2>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q20d<$offer, $offerURL, $price, $deliveryDays, $value> :- triple($offer, <bsbm:offerWebpage>, $offerURL), triple($offer, <bsbm:price>, $price), triple($offer, <bsbm:deliveryDays>, $deliveryDays), triple($offer, <bsbm:product>, $product), triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, <bsbm-int:ProductType2>), triple($product, <bsbm:productPropertyNumeric>, $value), triple($product, <bsbm:producer>, $producer), triple($producer,<bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType1>); Q21<$product, $type> :- triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, $type); Q22<$product, $type> :- triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, $type), triple($type, <rdfs:subClassOf>, <bsbm-int:ProductType12>); Q22a<$product, $type> :- triple($product, <bsbm:productFeature>, $productFeature), triple($productFeature, <rdfs:label>, "babka"), triple($product, <rdf:type>, $type), triple($type, <rdfs:subClassOf>, <bsbm-int:ProductType2>); Q23<$x, $class, $superProp, $value> :- triple($x, $prop, $value), triple($prop, <rdfs:subPropertyOf>, $superProp), triple($x, $p, $agent), triple($p, <rdfs:range>, <foaf:Agent>), triple($p, <rdfs:domain>, $class), triple($agent, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType12>); Q23a<$x, $class, $superProp, $value> :- triple($x, $prop, $value), triple($prop, <rdfs:subPropertyOf>, $superProp), triple($x, $p, $agent), triple($p, <rdfs:range>, <foaf:Agent>), triple($p, <rdfs:domain>, $class), triple($agent, <bsbm:country>, $country), triple($country, <rdf:type>, <bsbm:CountryType2>);