blob: 391553a8eb23ee88999f11698aa4c92793db918d (
plain)
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
|
<?php
namespace SMW\SQLStore\QueryEngine;
use SMW\ApplicationFactory;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\ClassDescriptionInterpreter;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\ConceptDescriptionInterpreter;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\DisjunctionConjunctionInterpreter;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\DispatchingDescriptionInterpreter;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\NamespaceDescriptionInterpreter;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\SomePropertyInterpreter;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\ThingDescriptionInterpreter;
use SMW\SQLStore\QueryEngine\DescriptionInterpreters\ValueDescriptionInterpreter;
/**
* @license GNU GPL v2+
* @since 2.4
*
* @author mwjames
*/
class DescriptionInterpreterFactory {
/**
* @since 2.4
*
* @param QuerySegmentListBuilder $querySegmentListBuilder
*
* @return DispatchingDescriptionInterpreter
*/
public function newDispatchingDescriptionInterpreter( QuerySegmentListBuilder $querySegmentListBuilder ) {
$pplicationFactory = ApplicationFactory::getInstance();
$dispatchingDescriptionInterpreter = new DispatchingDescriptionInterpreter();
$dispatchingDescriptionInterpreter->addDefaultInterpreter(
new ThingDescriptionInterpreter( $querySegmentListBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new SomePropertyInterpreter( $querySegmentListBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new DisjunctionConjunctionInterpreter( $querySegmentListBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new NamespaceDescriptionInterpreter( $querySegmentListBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new ClassDescriptionInterpreter( $querySegmentListBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new ValueDescriptionInterpreter( $querySegmentListBuilder )
);
$conceptDescriptionInterpreter = new ConceptDescriptionInterpreter(
$querySegmentListBuilder
);
$conceptDescriptionInterpreter->setQueryParser(
$pplicationFactory->getQueryFactory()->newQueryParser(
$pplicationFactory->getSettings()->get( 'smwgQConceptFeatures' )
)
);
$dispatchingDescriptionInterpreter->addInterpreter(
$conceptDescriptionInterpreter
);
return $dispatchingDescriptionInterpreter;
}
}
|