blob: 1ebdfb23e7056e7c3a30928bbdd28ed5f212941f (
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
|
<?php
namespace SMW\SPARQLStore\QueryEngine;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\ClassDescriptionInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\ConceptDescriptionInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\ConjunctionInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\DisjunctionInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\DispatchingDescriptionInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\NamespaceDescriptionInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\SomePropertyInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\ThingDescriptionInterpreter;
use SMW\SPARQLStore\QueryEngine\DescriptionInterpreters\ValueDescriptionInterpreter;
/**
* @license GNU GPL v2+
* @since 2.5
*
* @author mwjames
*/
class DescriptionInterpreterFactory {
/**
* @since 2.5
*
* @param ConditionBuilder $conditionBuilder
*
* @return DispatchingDescriptionInterpreter
*/
public function newDispatchingDescriptionInterpreter( ConditionBuilder $conditionBuilder ) {
$dispatchingDescriptionInterpreter = new DispatchingDescriptionInterpreter();
$dispatchingDescriptionInterpreter->addDefaultInterpreter(
new ThingDescriptionInterpreter( $conditionBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new SomePropertyInterpreter( $conditionBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new ConjunctionInterpreter( $conditionBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new DisjunctionInterpreter( $conditionBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new NamespaceDescriptionInterpreter( $conditionBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new ClassDescriptionInterpreter( $conditionBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new ValueDescriptionInterpreter( $conditionBuilder )
);
$dispatchingDescriptionInterpreter->addInterpreter(
new ConceptDescriptionInterpreter( $conditionBuilder )
);
return $dispatchingDescriptionInterpreter;
}
}
|