1 | <?php |
||
18 | class JsonLdSnakFormatter extends ValueFormatterBase { |
||
19 | |||
20 | /** |
||
21 | * Array of allowed vocabularies to map snaks to. |
||
22 | * Example: array('http://schema.org/') |
||
23 | */ |
||
24 | const OPT_ALLOWED_VOCABULARIES = 'allowed-vocabularies'; |
||
25 | |||
26 | /** |
||
27 | * @var PropertyLookup |
||
28 | */ |
||
29 | private $propertyLookup; |
||
30 | |||
31 | /** |
||
32 | * @var EntityOntology |
||
33 | */ |
||
34 | private $entityOntology; |
||
35 | |||
36 | /** |
||
37 | * @var JsonLdDataValueFormatter |
||
38 | */ |
||
39 | private $dataValueFormatter; |
||
40 | |||
41 | /** |
||
42 | * @param PropertyLookup $propertyLookup |
||
43 | * @param EntityOntology $entityOntology |
||
44 | * @param JsonLdDataValueFormatter $dataValueFormatter |
||
45 | * @param FormatterOptions $options |
||
46 | */ |
||
47 | public function __construct( |
||
61 | |||
62 | /** |
||
63 | * @see ValueFormatter::format |
||
64 | */ |
||
65 | 3 | public function format($value) { |
|
72 | |||
73 | 3 | private function toJsonLdProperties(Snak $snak) { |
|
83 | |||
84 | 2 | private function getPropertyIris(PropertyId $propertyId) { |
|
92 | |||
93 | 1 | private function filterIris(array $iris) { |
|
102 | |||
103 | 1 | private function buildIriFilterRegex() { |
|
113 | |||
114 | 2 | private function normalizePropertyIris($iris) { |
|
122 | } |
||
123 |