@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $baseurl = $this->getBaseHref(); |
17 | 17 | $vocid = $vocab->getId(); |
18 | 18 | $query = http_build_query(array('uri'=>$uri, 'format'=>$targetFormat)); |
19 | - $url = $baseurl . "rest/v1/$vocid/data?$query"; |
|
19 | + $url = $baseurl."rest/v1/$vocid/data?$query"; |
|
20 | 20 | $this->redirect303($url); |
21 | 21 | } |
22 | 22 | |
@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | $localname = $vocab->getLocalName($uri); |
28 | 28 | |
29 | 29 | if (!$localname) { |
30 | - $url = $baseurl . "$vocid/"; |
|
30 | + $url = $baseurl."$vocid/"; |
|
31 | 31 | } else { |
32 | 32 | |
33 | 33 | if ($localname !== $uri && $localname === urlencode($localname)) { |
34 | 34 | // the URI can be shortened |
35 | - $url = $baseurl . "$vocid/page/$localname"; |
|
35 | + $url = $baseurl."$vocid/page/$localname"; |
|
36 | 36 | } else { |
37 | 37 | // must use full URI |
38 | 38 | $query = http_build_query(array('uri'=>$uri)); |
39 | - $url = $baseurl . "$vocid/page/?" . $query; |
|
39 | + $url = $baseurl."$vocid/page/?".$query; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | $this->redirect303($url); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // guess vocabulary based on URI |
58 | 58 | $vocab = $this->model->guessVocabularyFromURI($request->getUri()); |
59 | 59 | if ($vocab === null) { |
60 | - return $this->returnError('404', 'Not Found', 'Unrecognized URI ' . $request->getUri()); |
|
60 | + return $this->returnError('404', 'Not Found', 'Unrecognized URI '.$request->getUri()); |
|
61 | 61 | } |
62 | 62 | $request->setVocab($vocab->getId()); |
63 | 63 | } |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | */ |
29 | 29 | private $configModifiedTime = null; |
30 | 30 | |
31 | - public function __construct($config_name='/../config.ttl') |
|
31 | + public function __construct($config_name = '/../config.ttl') |
|
32 | 32 | { |
33 | 33 | $this->cache = new Cache(); |
34 | 34 | try { |
35 | - $this->filePath = realpath( dirname(__FILE__) . $config_name ); |
|
35 | + $this->filePath = realpath(dirname(__FILE__).$config_name); |
|
36 | 36 | if (!file_exists($this->filePath)) { |
37 | 37 | throw new Exception('config.ttl file is missing, please provide one.'); |
38 | 38 | } |
39 | 39 | $this->initializeConfig(); |
40 | 40 | } catch (Exception $e) { |
41 | - echo "Error: " . $e->getMessage(); |
|
41 | + echo "Error: ".$e->getMessage(); |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | // use APC user cache to store parsed config.ttl configuration |
73 | 73 | if ($this->cache->isAvailable() && !is_null($this->configModifiedTime)) { |
74 | 74 | // @codeCoverageIgnoreStart |
75 | - $key = realpath($this->filePath) . ", " . $this->configModifiedTime; |
|
76 | - $nskey = "namespaces of " . $key; |
|
75 | + $key = realpath($this->filePath).", ".$this->configModifiedTime; |
|
76 | + $nskey = "namespaces of ".$key; |
|
77 | 77 | $this->graph = $this->cache->fetch($key); |
78 | 78 | $this->namespaces = $this->cache->fetch($nskey); |
79 | 79 | if ($this->graph === false || $this->namespaces === false) { // was not found in cache |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $this->resource = $configResources[0]; |
95 | 95 | $this->initializeNamespaces(); |
96 | 96 | } catch (Exception $e) { |
97 | - echo "Error: " . $e->getMessage(); |
|
97 | + echo "Error: ".$e->getMessage(); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | public function getGlobalPlugins() |
325 | 325 | { |
326 | 326 | $globalPlugins = array(); |
327 | - $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
327 | + $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
328 | 328 | if ($globalPluginsResource) { |
329 | 329 | foreach ($globalPluginsResource as $resource) { |
330 | 330 | $globalPlugins[] = $resource->getValue(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $opts = array('http' => array('method'=>'HEAD', |
14 | 14 | 'user_agent' => 'Skosmos', |
15 | 15 | 'timeout' => $timeout)); |
16 | - $context = stream_context_create($opts); |
|
16 | + $context = stream_context_create($opts); |
|
17 | 17 | $fd = fopen($this->uri, 'rb', false, $context); |
18 | 18 | $headers = stream_get_meta_data($fd)['wrapper_data']; |
19 | 19 | foreach ($headers as $header) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | // 1. Ensure characters with special meaning in Lucene are escaped |
42 | 42 | $lucenemap = array(); |
43 | 43 | foreach (str_split(self::LUCENE_ESCAPE_CHARS) as $char) { |
44 | - $lucenemap[$char] = '\\' . $char; // escape with a backslash |
|
44 | + $lucenemap[$char] = '\\'.$char; // escape with a backslash |
|
45 | 45 | } |
46 | 46 | $term = strtr($term, $lucenemap); |
47 | 47 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @return string sparql order by clause |
93 | 93 | */ |
94 | 94 | private function formatOrderBy($expression, $lang) { |
95 | - if(!$this->model->getConfig()->getCollationEnabled()) { |
|
95 | + if (!$this->model->getConfig()->getCollationEnabled()) { |
|
96 | 96 | return $expression; |
97 | 97 | } |
98 | 98 | $orderby = sprintf('arq:collation(\'%2$s\', %1$s)', $expression, $lang); |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | # make text query clause |
127 | 127 | $lcletter = mb_strtolower($letter, 'UTF-8'); // convert to lower case, UTF-8 safe |
128 | 128 | $langClause = $this->generateLangClause($lang); |
129 | - $textcondPref = $this->createTextQueryCondition($letter . '*', 'skos:prefLabel', $langClause); |
|
130 | - $textcondAlt = $this->createTextQueryCondition($letter . '*', 'skos:altLabel', $langClause); |
|
131 | - $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang) . " STR(?s) LCASE(STR(?qualifier))"; |
|
129 | + $textcondPref = $this->createTextQueryCondition($letter.'*', 'skos:prefLabel', $langClause); |
|
130 | + $textcondAlt = $this->createTextQueryCondition($letter.'*', 'skos:altLabel', $langClause); |
|
131 | + $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang)." STR(?s) LCASE(STR(?qualifier))"; |
|
132 | 132 | |
133 | - $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : ""; |
|
133 | + $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : ""; |
|
134 | 134 | |
135 | - $filterDeprecated=""; |
|
136 | - if(!$showDeprecated){ |
|
137 | - $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
135 | + $filterDeprecated = ""; |
|
136 | + if (!$showDeprecated) { |
|
137 | + $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $query = <<<EOQ |
@@ -156,18 +156,18 @@ discard block |
||
156 | 156 | $localname = $vocab->getLocalName($uri); |
157 | 157 | if ($localname !== $uri && $localname === urlencode($localname)) { |
158 | 158 | // check that the prefix stripping worked, and there are no problematic chars in localname |
159 | - $paramstr = count($params) > 0 ? '?' . http_build_query($params) : ''; |
|
159 | + $paramstr = count($params) > 0 ? '?'.http_build_query($params) : ''; |
|
160 | 160 | if ($type && $type !== '' && $type !== 'vocab' && !($localname === '' && $type === 'page')) { |
161 | - return "$vocid/$lang/$type/$localname" . $paramstr; |
|
161 | + return "$vocid/$lang/$type/$localname".$paramstr; |
|
162 | 162 | } |
163 | 163 | |
164 | - return "$vocid/$lang/$localname" . $paramstr; |
|
164 | + return "$vocid/$lang/$localname".$paramstr; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // case 2: URI outside vocabulary namespace, or has problematic chars |
168 | 168 | // pass the full URI as parameter instead |
169 | 169 | $params['uri'] = $uri; |
170 | - return "$vocid/$lang/$type/?" . http_build_query($params); |
|
170 | + return "$vocid/$lang/$type/?".http_build_query($params); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | if ($modifiedDate) { |
295 | 295 | $ifModifiedSince = $this->getIfModifiedSince(); |
296 | - $this->sendHeader("Last-Modified: " . $modifiedDate->format('D, d M Y H:i:s \G\M\T')); |
|
296 | + $this->sendHeader("Last-Modified: ".$modifiedDate->format('D, d M Y H:i:s \G\M\T')); |
|
297 | 297 | if ($ifModifiedSince !== null && $ifModifiedSince >= $modifiedDate) { |
298 | 298 | $this->sendHeader("HTTP/1.0 304 Not Modified"); |
299 | 299 | return true; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | "skos:related", "skos:historyNote", "skosmos:memberOf", |
29 | 29 | "skosmos:memberOfArray"); |
30 | 30 | |
31 | - public function __construct($resource, $globalPlugins=array()) |
|
31 | + public function __construct($resource, $globalPlugins = array()) |
|
32 | 32 | { |
33 | 33 | $this->resource = $resource; |
34 | 34 | $plugins = $this->resource->allLiterals('skosmos:usePlugin'); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $paramValue = $paramLiteral->getValue(); |
57 | 57 | $paramLang = $paramLiteral->getLang(); |
58 | 58 | if ($paramLang) { |
59 | - $paramName .= '_' . $paramLang; |
|
59 | + $paramName .= '_'.$paramLang; |
|
60 | 60 | } |
61 | 61 | $this->pluginParameters[$pluginName][$paramName] = $paramValue; |
62 | 62 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $langs = $this->getLanguages(); |
84 | 84 | $deflang = reset($langs); // picking the first one from the list with reset since the keys are not numeric |
85 | 85 | if (sizeof($langs) > 1) { |
86 | - trigger_error("Default language for vocabulary '" . $this->getShortName() . "' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
86 | + trigger_error("Default language for vocabulary '".$this->getShortName()."' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | return $deflang; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param string $super URI of superproperty |
28 | 28 | * @param boolean $sort_by_notation whether to sort the property values by their notation code |
29 | 29 | */ |
30 | - public function __construct($prop, $label, $tooltip=null, $super=null, $sort_by_notation=false) |
|
30 | + public function __construct($prop, $label, $tooltip = null, $super = null, $sort_by_notation = false) |
|
31 | 31 | { |
32 | 32 | $this->prop = $prop; |
33 | 33 | $this->label = $label; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getDescription() |
69 | 69 | { |
70 | - $helpprop = $this->prop . "_help"; |
|
70 | + $helpprop = $this->prop."_help"; |
|
71 | 71 | |
72 | 72 | // see if we have a translation with the help text |
73 | 73 | $help = gettext($helpprop); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | public function addValue($value) |
100 | 100 | { |
101 | - $this->values[ltrim($value->getNotation() . ' ') . $value->getLabel() . rtrim(' ' . $value->getUri())] = $value; |
|
101 | + $this->values[ltrim($value->getNotation().' ').$value->getLabel().rtrim(' '.$value->getUri())] = $value; |
|
102 | 102 | $this->is_sorted = false; |
103 | 103 | } |
104 | 104 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $label = $this->getLabel(); |
38 | 38 | $notation = $this->getNotation(); |
39 | - return ltrim($notation . ' ') . $label; |
|
39 | + return ltrim($notation.' ').$label; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getType() |
@@ -180,25 +180,25 @@ discard block |
||
180 | 180 | 'from' => [ |
181 | 181 | 'memberSet' => [ |
182 | 182 | [ |
183 | - 'uri' => (string) $this->source->getUri(), |
|
183 | + 'uri' => (string)$this->source->getUri(), |
|
184 | 184 | ] |
185 | 185 | ] |
186 | 186 | ], |
187 | 187 | 'to' => [ |
188 | 188 | 'memberSet' => [ |
189 | 189 | [ |
190 | - 'uri' => (string) $this->getUri() |
|
190 | + 'uri' => (string)$this->getUri() |
|
191 | 191 | ] |
192 | 192 | ] |
193 | 193 | ], |
194 | 194 | // EXTRA |
195 | 195 | 'hrefLink' => $hrefLink, // link to resource as displayed in the UI |
196 | 196 | 'lang' => $propertyLang, // TBD: could it be part of the prefLabel? |
197 | - 'vocabName' => (string) $this->getVocabName(), // vocabulary as displayed in the UI |
|
197 | + 'vocabName' => (string)$this->getVocabName(), // vocabulary as displayed in the UI |
|
198 | 198 | 'typeLabel' => gettext($this->type), // a text used in the UI instead of, for example, skos:closeMatch |
199 | 199 | ]; |
200 | 200 | |
201 | - $helpprop = $this->type . "_help"; |
|
201 | + $helpprop = $this->type."_help"; |
|
202 | 202 | // see if we have a translation for the property help text |
203 | 203 | $help = gettext($helpprop); |
204 | 204 | if ($help != $helpprop) { |
@@ -208,20 +208,20 @@ discard block |
||
208 | 208 | $fromScheme = $this->vocab->getDefaultConceptScheme(); |
209 | 209 | if (isset($fromScheme)) { |
210 | 210 | $ret['fromScheme'] = [ |
211 | - 'uri' => (string) $fromScheme, |
|
211 | + 'uri' => (string)$fromScheme, |
|
212 | 212 | ]; |
213 | 213 | } |
214 | 214 | |
215 | 215 | $exvocab = $this->getExvocab(); |
216 | 216 | if (isset($exvocab)) { |
217 | 217 | $ret['toScheme'] = [ |
218 | - 'uri' => (string) $exvocab->getDefaultConceptScheme(), |
|
218 | + 'uri' => (string)$exvocab->getDefaultConceptScheme(), |
|
219 | 219 | ]; |
220 | 220 | } |
221 | 221 | |
222 | 222 | $notation = $this->getNotation(); |
223 | 223 | if (isset($notation)) { |
224 | - $ret['to']['memberSet'][0]['notation'] = (string) $notation; |
|
224 | + $ret['to']['memberSet'][0]['notation'] = (string)$notation; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | $label = $this->getLabel($lang, $queryExVocabs); |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | return $this->resource->label($fallback); |
137 | 137 | } |
138 | 138 | // We need to check all the labels in case one of them matches a subtag of the current language |
139 | - foreach($this->resource->allLiterals('skos:prefLabel') as $label) { |
|
139 | + foreach ($this->resource->allLiterals('skos:prefLabel') as $label) { |
|
140 | 140 | // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language |
141 | - if ($label !== null && strpos($label->getLang(), $fallback . '-') === 0) { |
|
141 | + if ($label !== null && strpos($label->getLang(), $fallback.'-') === 0) { |
|
142 | 142 | return EasyRdf\Literal::create($label, $fallback); |
143 | 143 | } |
144 | 144 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | public function hasXlLabel($prop = 'prefLabel') |
161 | 161 | { |
162 | - if ($this->resource->hasProperty('skosxl:' . $prop)) { |
|
162 | + if ($this->resource->hasProperty('skosxl:'.$prop)) { |
|
163 | 163 | return true; |
164 | 164 | } |
165 | 165 | return false; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | public function getXlLabel() |
169 | 169 | { |
170 | 170 | $labels = $this->resource->allResources('skosxl:prefLabel'); |
171 | - foreach($labels as $labres) { |
|
171 | + foreach ($labels as $labres) { |
|
172 | 172 | $label = $labres->getLiteral('skosxl:literalForm'); |
173 | 173 | if ($label !== null && $label->getLang() == $this->clang) { |
174 | 174 | return new LabelSkosXL($this->model, $labres); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | // catch external subjects that have $res as object |
276 | 276 | $extSubjects = $exGraph->resourcesMatching("schema:about", $res); |
277 | 277 | |
278 | - $propList = array_unique(array_merge( |
|
278 | + $propList = array_unique(array_merge( |
|
279 | 279 | $this->DEFAULT_EXT_PROPERTIES, |
280 | 280 | $this->getVocab()->getConfig()->getExtProperties(), |
281 | 281 | $this->getVocab()->getConfig()->getPlugins()->getExtProperties() |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | * @param string[] $seen Processed resources so far |
301 | 301 | * @param string[] $props (optional) limit to these property URIs |
302 | 302 | */ |
303 | - private function addExternalTriplesToGraph($res, &$seen, $props=null) |
|
303 | + private function addExternalTriplesToGraph($res, &$seen, $props = null) |
|
304 | 304 | { |
305 | 305 | if (array_key_exists($res->getUri(), $seen) && $seen[$res->getUri()] === 0) { |
306 | 306 | return; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | */ |
331 | 331 | private function addPropertyValues($res, $prop, &$seen) |
332 | 332 | { |
333 | - $resList = $res->allResources('<' . $prop . '>'); |
|
333 | + $resList = $res->allResources('<'.$prop.'>'); |
|
334 | 334 | |
335 | 335 | foreach ($resList as $res2) { |
336 | 336 | if ($res2->isBNode()) { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $this->addResourceReifications($res, $prop, $res2, $seen); |
341 | 341 | } |
342 | 342 | |
343 | - $litList = $res->allLiterals('<' . $prop . '>'); |
|
343 | + $litList = $res->allLiterals('<'.$prop.'>'); |
|
344 | 344 | |
345 | 345 | foreach ($litList as $lit) { |
346 | 346 | $this->graph->addLiteral($res, $prop, $lit); |
@@ -528,15 +528,15 @@ discard block |
||
528 | 528 | // if not found in current vocabulary, look up in the default graph to be able |
529 | 529 | // to read an ontology loaded in a separate graph |
530 | 530 | // note that this imply that the property has an rdf:type declared for the query to work |
531 | - if(!$is_well_known && !$proplabel) { |
|
531 | + if (!$is_well_known && !$proplabel) { |
|
532 | 532 | $envLangLabels = $this->model->getDefaultSparql()->queryLabel($longUri, $this->getEnvLang()); |
533 | 533 | |
534 | 534 | $defaultPropLabel = $this->model->getDefaultSparql()->queryLabel($longUri, ''); |
535 | 535 | |
536 | - if($envLangLabels) { |
|
536 | + if ($envLangLabels) { |
|
537 | 537 | $proplabel = $envLangLabels[$this->getEnvLang()]; |
538 | 538 | } else { |
539 | - if($defaultPropLabel) { |
|
539 | + if ($defaultPropLabel) { |
|
540 | 540 | $proplabel = $defaultPropLabel['']; |
541 | 541 | } |
542 | 542 | } |
@@ -549,12 +549,12 @@ discard block |
||
549 | 549 | } |
550 | 550 | |
551 | 551 | // also look up superprops in the default graph if not found in current vocabulary |
552 | - if(!$is_well_known && (!$superprops || empty($superprops))) { |
|
552 | + if (!$is_well_known && (!$superprops || empty($superprops))) { |
|
553 | 553 | $superprops = $this->model->getDefaultSparql()->querySuperProperties($longUri); |
554 | 554 | } |
555 | 555 | |
556 | 556 | // we're reading only one super property, even if there are multiple ones |
557 | - $superprop = ($superprops)?$superprops[0]:null; |
|
557 | + $superprop = ($superprops) ? $superprops[0] : null; |
|
558 | 558 | if ($superprop) { |
559 | 559 | $superprop = EasyRdf\RdfNamespace::shorten($superprop) ? EasyRdf\RdfNamespace::shorten($superprop) : $superprop; |
560 | 560 | } |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | } |
568 | 568 | |
569 | 569 | // searching for subproperties of literals too |
570 | - if($superprops) { |
|
570 | + if ($superprops) { |
|
571 | 571 | foreach ($superprops as $subi) { |
572 | 572 | $suburi = EasyRdf\RdfNamespace::shorten($subi) ? EasyRdf\RdfNamespace::shorten($subi) : $subi; |
573 | 573 | $duplicates[$suburi] = $prop; |
@@ -729,14 +729,14 @@ discard block |
||
729 | 729 | |
730 | 730 | // making a human readable string from the timestamps |
731 | 731 | if ($created != '') { |
732 | - $ret = gettext('skosmos:created') . ' ' . (Punic\Calendar::formatDate($created, 'short', $this->getEnvLang())); |
|
732 | + $ret = gettext('skosmos:created').' '.(Punic\Calendar::formatDate($created, 'short', $this->getEnvLang())); |
|
733 | 733 | } |
734 | 734 | |
735 | 735 | if ($modified != '') { |
736 | 736 | if ($created != '') { |
737 | - $ret .= ', ' . gettext('skosmos:modified') . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang())); |
|
737 | + $ret .= ', '.gettext('skosmos:modified').' '.(Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang())); |
|
738 | 738 | } else { |
739 | - $ret .= ' ' . ucfirst(gettext('skosmos:modified')) . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang())); |
|
739 | + $ret .= ' '.ucfirst(gettext('skosmos:modified')).' '.(Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang())); |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | } |
@@ -744,12 +744,12 @@ discard block |
||
744 | 744 | trigger_error($e->getMessage(), E_USER_WARNING); |
745 | 745 | $ret = ''; |
746 | 746 | if ($this->resource->get('dc:modified')) { |
747 | - $modified = (string) $this->resource->get('dc:modified'); |
|
748 | - $ret = gettext('skosmos:modified') . ' ' . $modified; |
|
747 | + $modified = (string)$this->resource->get('dc:modified'); |
|
748 | + $ret = gettext('skosmos:modified').' '.$modified; |
|
749 | 749 | } |
750 | 750 | if ($this->resource->get('dc:created')) { |
751 | - $created .= (string) $this->resource->get('dc:created'); |
|
752 | - $ret .= ' ' . gettext('skosmos:created') . ' ' . $created; |
|
751 | + $created .= (string)$this->resource->get('dc:created'); |
|
752 | + $ret .= ' '.gettext('skosmos:created').' '.$created; |
|
753 | 753 | } |
754 | 754 | } |
755 | 755 | return $ret; |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | $groups[$collLabel] = array($group); |
822 | 822 | |
823 | 823 | $res = $collection; |
824 | - while($super = $this->graph->resourcesMatching('skos:member', $res)) { |
|
824 | + while ($super = $this->graph->resourcesMatching('skos:member', $res)) { |
|
825 | 825 | foreach ($super as $res) { |
826 | 826 | $superprop = new ConceptPropertyValue($this->model, $this->vocab, $res, 'skosmos:memberOfSuper', $this->clang); |
827 | 827 | array_unshift($groups[$collLabel], $superprop); |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | |
867 | 867 | foreach ($labels as $lit) { |
868 | 868 | // filtering away subsets of the current language eg. en vs en-GB |
869 | - if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) { |
|
869 | + if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang().'-') !== 0) { |
|
870 | 870 | $langCode = $lit->getLang() ? $lit->getLang() : ''; |
871 | 871 | $ret[$langCode][$key][] = new ConceptPropertyValueLiteral($this->model, $this->vocab, $this->resource, $lit, $prop); |
872 | 872 | } |
@@ -957,10 +957,10 @@ discard block |
||
957 | 957 | } |
958 | 958 | else if ($context[$vocabPrefix] !== $vocabUriSpace) { |
959 | 959 | $i = 2; |
960 | - while (isset($context[$vocabPrefix . $i]) && $context[$vocabPrefix . $i] !== $vocabUriSpace) { |
|
960 | + while (isset($context[$vocabPrefix.$i]) && $context[$vocabPrefix.$i] !== $vocabUriSpace) { |
|
961 | 961 | $i += 1; |
962 | 962 | } |
963 | - $context[$vocabPrefix . $i] = $vocabUriSpace; |
|
963 | + $context[$vocabPrefix.$i] = $vocabUriSpace; |
|
964 | 964 | } |
965 | 965 | } |
966 | 966 | $compactJsonLD = \ML\JsonLD\JsonLD::compact($this->graph->serialise('jsonld'), json_encode($context)); |