@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return isset($results[$lang]) ? $results[$lang] : null; |
53 | 53 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
54 | 54 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
55 | - error_log('Caught exception: ' . $e->getMessage()); |
|
55 | + error_log('Caught exception: '.$e->getMessage()); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | return isset($results) ? $results : null; |
75 | 75 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
76 | 76 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
77 | - error_log('Caught exception: ' . $e->getMessage()); |
|
77 | + error_log('Caught exception: '.$e->getMessage()); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | return $lname; |
103 | 103 | } |
104 | 104 | // already a full URI |
105 | - return $this->getUriSpace() . $lname; |
|
105 | + return $this->getUriSpace().$lname; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $result = $sparql->queryConceptScheme($defaultcs); |
165 | 165 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
166 | 166 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
167 | - error_log('Caught exception: ' . $e->getMessage()); |
|
167 | + error_log('Caught exception: '.$e->getMessage()); |
|
168 | 168 | } |
169 | 169 | return null; |
170 | 170 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | foreach ($conceptscheme->allLiterals($prop, null) as $val) { |
198 | 198 | $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop; |
199 | 199 | if ($val->getValue() instanceof DateTime) { |
200 | - $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang); |
|
200 | + $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang).' '.Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang); |
|
201 | 201 | } |
202 | 202 | $ret[$prop][] = $val; |
203 | 203 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang); |
255 | 255 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
256 | 256 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
257 | - error_log('Caught exception: ' . $e->getMessage()); |
|
257 | + error_log('Caught exception: '.$e->getMessage()); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | return $conceptSchemes; |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | } |
326 | 326 | // don't know how to parse |
327 | 327 | $rev = $parts[2]; |
328 | - $datestr = $parts[3] . ' ' . $parts[4]; |
|
328 | + $datestr = $parts[3].' '.$parts[4]; |
|
329 | 329 | |
330 | 330 | return "$datestr (r$rev)"; |
331 | 331 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | * @param string $array the uri of the concept array class, eg. isothes:ThesaurusArray |
337 | 337 | * @param string $group the uri of the concept group class, eg. isothes:ConceptGroup |
338 | 338 | */ |
339 | - public function getStatistics($lang = '', $array=null, $group=null) |
|
339 | + public function getStatistics($lang = '', $array = null, $group = null) |
|
340 | 340 | { |
341 | 341 | $sparql = $this->getSparql(); |
342 | 342 | // find the number of concepts |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $conceptInfo = $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang); |
455 | 455 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
456 | 456 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
457 | - error_log('Caught exception: ' . $e->getMessage()); |
|
457 | + error_log('Caught exception: '.$e->getMessage()); |
|
458 | 458 | } |
459 | 459 | } |
460 | 460 | return $conceptInfo; |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | return $this->getSparql()->queryChangeList($prop, $clang, $offset, $limit, $showDeprecated); |
666 | 666 | } |
667 | 667 | |
668 | - public function getTitle($lang=null) { |
|
668 | + public function getTitle($lang = null) { |
|
669 | 669 | return $this->config->getTitle($lang); |
670 | 670 | } |
671 | 671 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | "skos:related", "skos:historyNote", "skosmos:memberOf", |
30 | 30 | "skosmos:memberOfArray"); |
31 | 31 | |
32 | - public function __construct($resource, $globalPlugins=array()) |
|
32 | + public function __construct($resource, $globalPlugins = array()) |
|
33 | 33 | { |
34 | 34 | $this->resource = $resource; |
35 | 35 | $this->globalPlugins = $globalPlugins; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $paramValue = $paramLiteral->getValue(); |
119 | 119 | $paramLang = $paramLiteral->getLang(); |
120 | 120 | if ($paramLang) { |
121 | - $paramName .= '_' . $paramLang; |
|
121 | + $paramName .= '_'.$paramLang; |
|
122 | 122 | } |
123 | 123 | $this->pluginParameters[$pluginName][$paramName] = $paramValue; |
124 | 124 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $labelProperty = $override->getResource('skosmos:property'); |
151 | 151 | $labelPropUri = $labelProperty->shorten(); |
152 | 152 | if (empty($this->labelOverrides[$labelPropUri])) { |
153 | - $this->labelOverrides[$labelPropUri] = array(); |
|
153 | + $this->labelOverrides[$labelPropUri] = array(); |
|
154 | 154 | } |
155 | 155 | $newOverrides = array(); |
156 | 156 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $langs = $this->getLanguages(); |
225 | 225 | $deflang = reset($langs); // picking the first one from the list with reset since the keys are not numeric |
226 | 226 | if (sizeof($langs) > 1) { |
227 | - trigger_error("Default language for vocabulary '" . $this->getShortName() . "' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
227 | + trigger_error("Default language for vocabulary '".$this->getShortName()."' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return $deflang; |
@@ -71,11 +71,11 @@ |
||
71 | 71 | if ((!isset($term) || strlen(trim($term)) === 0) && $this->rest) |
72 | 72 | $term = $this->request->getQueryParamRaw('label'); |
73 | 73 | $term = trim($term); // surrounding whitespace is not considered significant |
74 | - $term = Normalizer::normalize( $term, Normalizer::FORM_C ); //Normalize decomposed unicode characters #1184 |
|
74 | + $term = Normalizer::normalize($term, Normalizer::FORM_C); //Normalize decomposed unicode characters #1184 |
|
75 | 75 | if ($this->rest) { |
76 | 76 | return $term; |
77 | 77 | } |
78 | - return strpos($term, "*") === false ? $term . "*" : $term; // default to prefix search |
|
78 | + return strpos($term, "*") === false ? $term."*" : $term; // default to prefix search |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function getContentLang() |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | class PluginRegister { |
4 | 4 | private $requestedPlugins; |
5 | 5 | |
6 | - public function __construct($requestedPlugins=array()) { |
|
6 | + public function __construct($requestedPlugins = array()) { |
|
7 | 7 | $this->requestedPlugins = $requestedPlugins; |
8 | 8 | $this->pluginOrder = array(); |
9 | 9 | foreach ($this->requestedPlugins as $index => $value) { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param boolean $raw interpret $type values as raw text instead of files |
46 | 46 | * @return array |
47 | 47 | */ |
48 | - private function filterPlugins($type, $raw=false) { |
|
48 | + private function filterPlugins($type, $raw = false) { |
|
49 | 49 | $plugins = $this->getPlugins(); |
50 | 50 | $plugins = $this->sortPlugins($plugins); |
51 | 51 | $ret = array(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | else { |
60 | 60 | foreach ($files[$type] as $file) { |
61 | - array_push($ret[$name], 'plugins/' . $name . '/' . $file); |
|
61 | + array_push($ret[$name], 'plugins/'.$name.'/'.$file); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param array $names the plugin name strings (foldernames) in an array |
90 | 90 | * @return array |
91 | 91 | */ |
92 | - public function getPluginsJS($names=null) { |
|
92 | + public function getPluginsJS($names = null) { |
|
93 | 93 | if ($names) { |
94 | 94 | $names = array_merge($this->requestedPlugins, $names); |
95 | 95 | return $this->filterPluginsByName('js', $names); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @param array $names the plugin name strings (foldernames) in an array |
103 | 103 | * @return array |
104 | 104 | */ |
105 | - public function getPluginsCSS($names=null) { |
|
105 | + public function getPluginsCSS($names = null) { |
|
106 | 106 | if ($names) { |
107 | 107 | $names = array_merge($this->requestedPlugins, $names); |
108 | 108 | return $this->filterPluginsByName('css', $names); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param array $names the plugin name strings (foldernames) in an array |
116 | 116 | * @return array |
117 | 117 | */ |
118 | - public function getPluginsTemplates($names=null) { |
|
118 | + public function getPluginsTemplates($names = null) { |
|
119 | 119 | if ($names) { |
120 | 120 | $names = array_merge($this->requestedPlugins, $names); |
121 | 121 | return $this->filterPluginsByName('templates', $names); |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | * @param array $names the plugin name strings (foldernames) in an array |
129 | 129 | * @return array |
130 | 130 | */ |
131 | - public function getTemplates($names=null) { |
|
131 | + public function getTemplates($names = null) { |
|
132 | 132 | $templateStrings = array(); |
133 | 133 | $plugins = $this->getPluginsTemplates($names); |
134 | 134 | foreach ($plugins as $folder => $templates) { |
135 | 135 | foreach ($templates as $path) { |
136 | 136 | if (file_exists($path)) { |
137 | 137 | $filename = explode('/', $path); |
138 | - $filename = $filename[sizeof($filename)-1]; |
|
139 | - $id = $folder . '-' . substr($filename, 0 , (strrpos($filename, "."))); |
|
138 | + $filename = $filename[sizeof($filename) - 1]; |
|
139 | + $id = $folder.'-'.substr($filename, 0, (strrpos($filename, "."))); |
|
140 | 140 | $templateStrings[$id] = file_get_contents($path); |
141 | 141 | } |
142 | 142 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param array $names the plugin name strings (foldernames) in an array |
150 | 150 | * @return array |
151 | 151 | */ |
152 | - public function getPluginCallbacks($names=null) { |
|
152 | + public function getPluginCallbacks($names = null) { |
|
153 | 153 | if ($names) { |
154 | 154 | $names = array_merge($this->requestedPlugins, $names); |
155 | 155 | return $this->filterPluginsByName('callback', $names); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | public function getRequestUri() |
171 | 171 | { |
172 | - return $this->getServerConstant('HTTP_HOST') . $this->getServerConstant('REQUEST_URI'); |
|
172 | + return $this->getServerConstant('HTTP_HOST').$this->getServerConstant('REQUEST_URI'); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | * @param string $newlang new UI language to set |
178 | 178 | * @return string the relative url of the page |
179 | 179 | */ |
180 | - public function getLangUrl($newlang=null) |
|
180 | + public function getLangUrl($newlang = null) |
|
181 | 181 | { |
182 | 182 | $script_name = str_replace('/index.php', '', $this->getServerConstant('SCRIPT_NAME')); |
183 | 183 | $langurl = substr(str_replace($script_name, '', $this->getServerConstant('REQUEST_URI')), 1); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | return Punic\Calendar::formatDate($val, 'short'); |
70 | 70 | } catch (Exception $e) { |
71 | 71 | trigger_error($e->getMessage(), E_USER_WARNING); |
72 | - return (string) $this->literal; |
|
72 | + return (string)$this->literal; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | return $this->literal->getValue(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | $graph = $this->resource->getGraph(); |
98 | 98 | $labelResources = $graph->resourcesMatching('skosxl:literalForm', $this->literal); |
99 | - foreach($labelResources as $labres) { |
|
99 | + foreach ($labelResources as $labres) { |
|
100 | 100 | return new LabelSkosXL($this->model, $labres); |
101 | 101 | } |
102 | 102 | return null; |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | protected function query($query) { |
89 | 89 | $queryId = sprintf("%05d", rand(0, 99999)); |
90 | 90 | $logger = $this->model->getLogger(); |
91 | - $logger->info("[qid $queryId] SPARQL query:\n" . $this->generateQueryPrefixes($query) . "\n$query\n"); |
|
91 | + $logger->info("[qid $queryId] SPARQL query:\n".$this->generateQueryPrefixes($query)."\n$query\n"); |
|
92 | 92 | $starttime = microtime(true); |
93 | 93 | $result = $this->client->query($query); |
94 | 94 | $elapsed = intval(round((microtime(true) - $starttime) * 1000)); |
95 | - if(method_exists($result, 'numRows')) { |
|
95 | + if (method_exists($result, 'numRows')) { |
|
96 | 96 | $numRows = $result->numRows(); |
97 | 97 | $logger->info("[qid $queryId] result: $numRows rows returned in $elapsed ms"); |
98 | 98 | } else { // graph result |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @param Vocabulary[]|null $vocabs |
109 | 109 | * @return string |
110 | 110 | */ |
111 | - protected function generateFromClause($vocabs=null) { |
|
111 | + protected function generateFromClause($vocabs = null) { |
|
112 | 112 | if (!$vocabs) { |
113 | 113 | return $this->graph !== '?graph' && $this->graph !== NULL ? "FROM <$this->graph>" : ''; |
114 | 114 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | $quote_string = function($val) { return "'$val'"; }; |
252 | 252 | $quoted_values = array_map($quote_string, $langs); |
253 | - $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))"; |
|
253 | + $langFilter = "FILTER(?lang IN (".implode(',', $quoted_values)."))"; |
|
254 | 254 | |
255 | 255 | $values = $this->formatValues('?type', $classes, 'uri'); |
256 | 256 | $valuesProp = $this->formatValues('?prop', $props, null); |
@@ -697,9 +697,9 @@ discard block |
||
697 | 697 | $conceptscheme['title'] = $row->title->getValue(); |
698 | 698 | } |
699 | 699 | // add dct:subject and their labels in the result |
700 | - if(isset($row->domain) && isset($row->domainLabel)){ |
|
701 | - $conceptscheme['subject']['uri']=$row->domain->getURI(); |
|
702 | - $conceptscheme['subject']['prefLabel']=$row->domainLabel->getValue(); |
|
700 | + if (isset($row->domain) && isset($row->domainLabel)) { |
|
701 | + $conceptscheme['subject']['uri'] = $row->domain->getURI(); |
|
702 | + $conceptscheme['subject']['prefLabel'] = $row->domainLabel->getValue(); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | $ret[$row->cs->getURI()] = $conceptscheme; |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | $values[] = "<$graph>"; |
767 | 767 | } |
768 | 768 | if (count($values)) { |
769 | - return "FILTER (?graph IN (" . implode(',', $values) . "))"; |
|
769 | + return "FILTER (?graph IN (".implode(',', $values)."))"; |
|
770 | 770 | } |
771 | 771 | } |
772 | 772 | |
@@ -777,16 +777,16 @@ discard block |
||
777 | 777 | * @return string sparql query clauses |
778 | 778 | */ |
779 | 779 | protected function formatLimitAndOffset($limit, $offset) { |
780 | - $limit = ($limit) ? 'LIMIT ' . $limit : ''; |
|
781 | - $offset = ($offset) ? 'OFFSET ' . $offset : ''; |
|
780 | + $limit = ($limit) ? 'LIMIT '.$limit : ''; |
|
781 | + $offset = ($offset) ? 'OFFSET '.$offset : ''; |
|
782 | 782 | // eliminating whitespace and line changes when the conditions aren't needed. |
783 | 783 | $limitandoffset = ''; |
784 | 784 | if ($limit && $offset) { |
785 | - $limitandoffset = "\n" . $limit . "\n" . $offset; |
|
785 | + $limitandoffset = "\n".$limit."\n".$offset; |
|
786 | 786 | } elseif ($limit) { |
787 | - $limitandoffset = "\n" . $limit; |
|
787 | + $limitandoffset = "\n".$limit; |
|
788 | 788 | } elseif ($offset) { |
789 | - $limitandoffset = "\n" . $offset; |
|
789 | + $limitandoffset = "\n".$offset; |
|
790 | 790 | } |
791 | 791 | |
792 | 792 | return $limitandoffset; |
@@ -938,14 +938,14 @@ discard block |
||
938 | 938 | // if search language and UI/display language differ, must also consider case where there is no prefLabel in |
939 | 939 | // the display language; in that case, should use the label with the same language as the matched label |
940 | 940 | $labelcondFallback = ($searchLang != $lang) ? |
941 | - "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" . |
|
941 | + "OPTIONAL { # in case previous OPTIONAL block gives no labels\n". |
|
942 | 942 | "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : ""; |
943 | 943 | |
944 | 944 | // Including the labels if there is no query term given. |
945 | 945 | if ($rawterm === '') { |
946 | 946 | $labelClause = "?s skos:prefLabel ?label ."; |
947 | - $labelClause = ($lang) ? $labelClause . " FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause . ""; |
|
948 | - return $labelClause . " BIND(?label AS ?match)"; |
|
947 | + $labelClause = ($lang) ? $labelClause." FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause.""; |
|
948 | + return $labelClause." BIND(?label AS ?match)"; |
|
949 | 949 | } |
950 | 950 | |
951 | 951 | /* |
@@ -1016,20 +1016,20 @@ discard block |
||
1016 | 1016 | $schemecond = ''; |
1017 | 1017 | if (!empty($schemes)) { |
1018 | 1018 | $conditions = array(); |
1019 | - foreach($schemes as $scheme) { |
|
1019 | + foreach ($schemes as $scheme) { |
|
1020 | 1020 | $conditions[] = "{?s skos:inScheme <$scheme>}"; |
1021 | 1021 | } |
1022 | - $schemecond = '{'.implode(" UNION ",$conditions).'}'; |
|
1022 | + $schemecond = '{'.implode(" UNION ", $conditions).'}'; |
|
1023 | 1023 | } |
1024 | - $filterDeprecated=""; |
|
1024 | + $filterDeprecated = ""; |
|
1025 | 1025 | //show or hide deprecated concepts |
1026 | - if(!$showDeprecated){ |
|
1027 | - $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
1026 | + if (!$showDeprecated) { |
|
1027 | + $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
1028 | 1028 | } |
1029 | 1029 | // extra conditions for parent and group, if specified |
1030 | - $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : ""; |
|
1031 | - $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : ""; |
|
1032 | - $pgcond = $parentcond . $groupcond; |
|
1030 | + $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : ""; |
|
1031 | + $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : ""; |
|
1032 | + $pgcond = $parentcond.$groupcond; |
|
1033 | 1033 | |
1034 | 1034 | $orderextra = $this->isDefaultEndpoint() ? $this->graph : ''; |
1035 | 1035 | |
@@ -1115,9 +1115,9 @@ discard block |
||
1115 | 1115 | $hit['type'][] = $this->shortenUri($typeuri); |
1116 | 1116 | } |
1117 | 1117 | |
1118 | - if(!empty($fields)) { |
|
1118 | + if (!empty($fields)) { |
|
1119 | 1119 | foreach ($fields as $prop) { |
1120 | - $propname = $prop . 's'; |
|
1120 | + $propname = $prop.'s'; |
|
1121 | 1121 | if (isset($row->$propname)) { |
1122 | 1122 | foreach (explode("\n", $row->$propname->getValue()) as $line) { |
1123 | 1123 | $rdata = str_getcsv($line, ',', '"', '"'); |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | $propvals = $rdata[2]; |
1133 | 1133 | } |
1134 | 1134 | |
1135 | - $hit['skos:' . $prop][] = $propvals; |
|
1135 | + $hit['skos:'.$prop][] = $propvals; |
|
1136 | 1136 | } |
1137 | 1137 | } |
1138 | 1138 | } |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | * @return array query result object |
1209 | 1209 | */ |
1210 | 1210 | public function queryConcepts($vocabs, $fields, $unique, $params, $showDeprecated = false) { |
1211 | - $query = $this->generateConceptSearchQuery($fields, $unique, $params,$showDeprecated); |
|
1211 | + $query = $this->generateConceptSearchQuery($fields, $unique, $params, $showDeprecated); |
|
1212 | 1212 | $results = $this->query($query); |
1213 | 1213 | return $this->transformConceptSearchResults($results, $vocabs, $fields); |
1214 | 1214 | } |
@@ -1263,10 +1263,10 @@ discard block |
||
1263 | 1263 | $conditions = $this->formatFilterConditions($letter, $lang); |
1264 | 1264 | $filtercondLabel = $conditions['filterpref']; |
1265 | 1265 | $filtercondALabel = $conditions['filteralt']; |
1266 | - $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : ""; |
|
1267 | - $filterDeprecated=""; |
|
1268 | - if(!$showDeprecated){ |
|
1269 | - $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
1266 | + $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : ""; |
|
1267 | + $filterDeprecated = ""; |
|
1268 | + if (!$showDeprecated) { |
|
1269 | + $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
1270 | 1270 | } |
1271 | 1271 | $query = <<<EOQ |
1272 | 1272 | SELECT DISTINCT ?s ?label ?alabel ?qualifier |
@@ -1743,7 +1743,7 @@ discard block |
||
1743 | 1743 | if (!isset($row->label) || $row->label->getLang() === $lang) { |
1744 | 1744 | $ret[$row->object->getUri()] = $val; |
1745 | 1745 | } elseif ($row->label->getLang() === $fallbacklang) { |
1746 | - $val['label'] .= ' (' . $row->label->getLang() . ')'; |
|
1746 | + $val['label'] .= ' ('.$row->label->getLang().')'; |
|
1747 | 1747 | $ret[$row->object->getUri()] = $val; |
1748 | 1748 | } |
1749 | 1749 | } |
@@ -1839,10 +1839,10 @@ discard block |
||
1839 | 1839 | |
1840 | 1840 | $label = null; |
1841 | 1841 | if (isset($row->label)) { |
1842 | - if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) { |
|
1842 | + if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) { |
|
1843 | 1843 | $label = $row->label->getValue(); |
1844 | 1844 | } else { |
1845 | - $label = $row->label->getValue() . " (" . $row->label->getLang() . ")"; |
|
1845 | + $label = $row->label->getValue()." (".$row->label->getLang().")"; |
|
1846 | 1846 | } |
1847 | 1847 | |
1848 | 1848 | } |
@@ -1918,8 +1918,8 @@ discard block |
||
1918 | 1918 | foreach ($result as $row) { |
1919 | 1919 | if (isset($row->top) && isset($row->label)) { |
1920 | 1920 | $label = $row->label->getValue(); |
1921 | - if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) { |
|
1922 | - $label .= ' (' . $row->label->getLang() . ')'; |
|
1921 | + if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) { |
|
1922 | + $label .= ' ('.$row->label->getLang().')'; |
|
1923 | 1923 | } |
1924 | 1924 | $top = array('uri' => $row->top->getUri(), 'topConceptOf' => $row->topuri->getUri(), 'label' => $label, 'hasChildren' => filter_var($row->children->getValue(), FILTER_VALIDATE_BOOLEAN)); |
1925 | 1925 | if (isset($row->notation)) { |
@@ -2012,7 +2012,7 @@ discard block |
||
2012 | 2012 | $ret[$uri]['exact'] = $row->exact->getUri(); |
2013 | 2013 | } |
2014 | 2014 | if (isset($row->tops)) { |
2015 | - $topConceptsList=explode(" ", $row->tops->getValue()); |
|
2015 | + $topConceptsList = explode(" ", $row->tops->getValue()); |
|
2016 | 2016 | // sort to guarantee an alphabetical ordering of the URI |
2017 | 2017 | sort($topConceptsList); |
2018 | 2018 | $ret[$uri]['tops'] = $topConceptsList; |
@@ -2025,8 +2025,8 @@ discard block |
||
2025 | 2025 | $label = null; |
2026 | 2026 | if (isset($row->childlabel)) { |
2027 | 2027 | $label = $row->childlabel->getValue(); |
2028 | - if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang . "-") !== 0) { |
|
2029 | - $label .= " (" . $row->childlabel->getLang() . ")"; |
|
2028 | + if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang."-") !== 0) { |
|
2029 | + $label .= " (".$row->childlabel->getLang().")"; |
|
2030 | 2030 | } |
2031 | 2031 | |
2032 | 2032 | } |
@@ -2047,8 +2047,8 @@ discard block |
||
2047 | 2047 | } |
2048 | 2048 | if (isset($row->label)) { |
2049 | 2049 | $preflabel = $row->label->getValue(); |
2050 | - if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) { |
|
2051 | - $preflabel .= ' (' . $row->label->getLang() . ')'; |
|
2050 | + if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) { |
|
2051 | + $preflabel .= ' ('.$row->label->getLang().')'; |
|
2052 | 2052 | } |
2053 | 2053 | |
2054 | 2054 | $ret[$uri]['prefLabel'] = $preflabel; |
@@ -2169,9 +2169,9 @@ discard block |
||
2169 | 2169 | */ |
2170 | 2170 | private function generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated = false) { |
2171 | 2171 | $fcl = $this->generateFromClause(); |
2172 | - $filterDeprecated=""; |
|
2173 | - if(!$showDeprecated){ |
|
2174 | - $filterDeprecated=" FILTER NOT EXISTS { ?conc owl:deprecated true }"; |
|
2172 | + $filterDeprecated = ""; |
|
2173 | + if (!$showDeprecated) { |
|
2174 | + $filterDeprecated = " FILTER NOT EXISTS { ?conc owl:deprecated true }"; |
|
2175 | 2175 | } |
2176 | 2176 | $query = <<<EOQ |
2177 | 2177 | SELECT ?conc ?super ?label ?members ?type ?notation $fcl |
@@ -2210,10 +2210,10 @@ discard block |
||
2210 | 2210 | 'type' => array($row->type->shorten()), |
2211 | 2211 | ); |
2212 | 2212 | if (isset($row->label)) { |
2213 | - if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) { |
|
2213 | + if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) { |
|
2214 | 2214 | $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue(); |
2215 | 2215 | } else { |
2216 | - $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")"; |
|
2216 | + $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")"; |
|
2217 | 2217 | } |
2218 | 2218 | |
2219 | 2219 | } |
@@ -2241,8 +2241,8 @@ discard block |
||
2241 | 2241 | * @param boolean $showDeprecated whether to include deprecated concepts in search results |
2242 | 2242 | * @return array Result array with concept URI as key and concept label as value |
2243 | 2243 | */ |
2244 | - public function listConceptGroupContents($groupClass, $group, $lang,$showDeprecated = false) { |
|
2245 | - $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang,$showDeprecated); |
|
2244 | + public function listConceptGroupContents($groupClass, $group, $lang, $showDeprecated = false) { |
|
2245 | + $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated); |
|
2246 | 2246 | $result = $this->query($query); |
2247 | 2247 | return $this->transformConceptGroupContentsResults($result, $lang); |
2248 | 2248 | } |
@@ -2256,9 +2256,9 @@ discard block |
||
2256 | 2256 | * @param boolean $showDeprecated whether to include deprecated concepts in the change list |
2257 | 2257 | * @return string sparql query |
2258 | 2258 | */ |
2259 | - private function generateChangeListQuery($prop, $lang, $offset, $limit=200, $showDeprecated=false) { |
|
2259 | + private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false) { |
|
2260 | 2260 | $fcl = $this->generateFromClause(); |
2261 | - $offset = ($offset) ? 'OFFSET ' . $offset : ''; |
|
2261 | + $offset = ($offset) ? 'OFFSET '.$offset : ''; |
|
2262 | 2262 | |
2263 | 2263 | //Additional clauses when deprecated concepts need to be included in the results |
2264 | 2264 | $deprecatedOptions = ''; |
@@ -2336,7 +2336,7 @@ discard block |
||
2336 | 2336 | * @param boolean $showDeprecated whether to include deprecated concepts in the change list |
2337 | 2337 | * @return array Result array |
2338 | 2338 | */ |
2339 | - public function queryChangeList($prop, $lang, $offset, $limit, $showDeprecated=false) { |
|
2339 | + public function queryChangeList($prop, $lang, $offset, $limit, $showDeprecated = false) { |
|
2340 | 2340 | $query = $this->generateChangeListQuery($prop, $lang, $offset, $limit, $showDeprecated); |
2341 | 2341 | |
2342 | 2342 | $result = $this->query($query); |