@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | { |
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)); |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | $gcl = $this->graphClause; |
258 | 258 | $classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept'); |
259 | 259 | |
260 | - $quote_string = function ($val) { return "'$val'"; }; |
|
260 | + $quote_string = function($val) { return "'$val'"; }; |
|
261 | 261 | $quoted_values = array_map($quote_string, $langs); |
262 | - $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))"; |
|
262 | + $langFilter = "FILTER(?lang IN (".implode(',', $quoted_values)."))"; |
|
263 | 263 | |
264 | 264 | $values = $this->formatValues('?type', $classes, 'uri'); |
265 | 265 | $valuesProp = $this->formatValues('?prop', $props, null); |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $values[] = "<$graph>"; |
792 | 792 | } |
793 | 793 | if (count($values)) { |
794 | - return "FILTER (?graph IN (" . implode(',', $values) . "))"; |
|
794 | + return "FILTER (?graph IN (".implode(',', $values)."))"; |
|
795 | 795 | } |
796 | 796 | } |
797 | 797 | |
@@ -803,16 +803,16 @@ discard block |
||
803 | 803 | */ |
804 | 804 | protected function formatLimitAndOffset($limit, $offset) |
805 | 805 | { |
806 | - $limit = ($limit) ? 'LIMIT ' . $limit : ''; |
|
807 | - $offset = ($offset) ? 'OFFSET ' . $offset : ''; |
|
806 | + $limit = ($limit) ? 'LIMIT '.$limit : ''; |
|
807 | + $offset = ($offset) ? 'OFFSET '.$offset : ''; |
|
808 | 808 | // eliminating whitespace and line changes when the conditions aren't needed. |
809 | 809 | $limitandoffset = ''; |
810 | 810 | if ($limit && $offset) { |
811 | - $limitandoffset = "\n" . $limit . "\n" . $offset; |
|
811 | + $limitandoffset = "\n".$limit."\n".$offset; |
|
812 | 812 | } elseif ($limit) { |
813 | - $limitandoffset = "\n" . $limit; |
|
813 | + $limitandoffset = "\n".$limit; |
|
814 | 814 | } elseif ($offset) { |
815 | - $limitandoffset = "\n" . $offset; |
|
815 | + $limitandoffset = "\n".$offset; |
|
816 | 816 | } |
817 | 817 | |
818 | 818 | return $limitandoffset; |
@@ -968,14 +968,14 @@ discard block |
||
968 | 968 | // if search language and UI/display language differ, must also consider case where there is no prefLabel in |
969 | 969 | // the display language; in that case, should use the label with the same language as the matched label |
970 | 970 | $labelcondFallback = ($searchLang != $lang) ? |
971 | - "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" . |
|
971 | + "OPTIONAL { # in case previous OPTIONAL block gives no labels\n". |
|
972 | 972 | "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : ""; |
973 | 973 | |
974 | 974 | // Including the labels if there is no query term given. |
975 | 975 | if ($rawterm === '') { |
976 | 976 | $labelClause = "?s skos:prefLabel ?label ."; |
977 | - $labelClause = ($lang) ? $labelClause . " FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause . ""; |
|
978 | - return $labelClause . " BIND(?label AS ?match)"; |
|
977 | + $labelClause = ($lang) ? $labelClause." FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause.""; |
|
978 | + return $labelClause." BIND(?label AS ?match)"; |
|
979 | 979 | } |
980 | 980 | |
981 | 981 | /* |
@@ -1059,9 +1059,9 @@ discard block |
||
1059 | 1059 | $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; |
1060 | 1060 | } |
1061 | 1061 | // extra conditions for parent and group, if specified |
1062 | - $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : ""; |
|
1063 | - $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : ""; |
|
1064 | - $pgcond = $parentcond . $groupcond; |
|
1062 | + $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : ""; |
|
1063 | + $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : ""; |
|
1064 | + $pgcond = $parentcond.$groupcond; |
|
1065 | 1065 | |
1066 | 1066 | $orderextra = $this->isDefaultEndpoint() ? $this->graph : ''; |
1067 | 1067 | |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | |
1150 | 1150 | if (!empty($fields)) { |
1151 | 1151 | foreach ($fields as $prop) { |
1152 | - $propname = $prop . 's'; |
|
1152 | + $propname = $prop.'s'; |
|
1153 | 1153 | if (isset($row->$propname)) { |
1154 | 1154 | foreach (explode("\n", $row->$propname->getValue()) as $line) { |
1155 | 1155 | $rdata = str_getcsv($line, ',', '"', '"'); |
@@ -1164,7 +1164,7 @@ discard block |
||
1164 | 1164 | $propvals = $rdata[2]; |
1165 | 1165 | } |
1166 | 1166 | |
1167 | - $hit['skos:' . $prop][] = $propvals; |
|
1167 | + $hit['skos:'.$prop][] = $propvals; |
|
1168 | 1168 | } |
1169 | 1169 | } |
1170 | 1170 | } |
@@ -1299,7 +1299,7 @@ discard block |
||
1299 | 1299 | $conditions = $this->formatFilterConditions($letter, $lang); |
1300 | 1300 | $filtercondLabel = $conditions['filterpref']; |
1301 | 1301 | $filtercondALabel = $conditions['filteralt']; |
1302 | - $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : ""; |
|
1302 | + $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : ""; |
|
1303 | 1303 | $filterDeprecated = ""; |
1304 | 1304 | if (!$showDeprecated) { |
1305 | 1305 | $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; |
@@ -1796,7 +1796,7 @@ discard block |
||
1796 | 1796 | if (!isset($row->label) || $row->label->getLang() === $lang) { |
1797 | 1797 | $ret[$row->object->getUri()] = $val; |
1798 | 1798 | } elseif ($row->label->getLang() === $fallbacklang) { |
1799 | - $val['label'] .= ' (' . $row->label->getLang() . ')'; |
|
1799 | + $val['label'] .= ' ('.$row->label->getLang().')'; |
|
1800 | 1800 | $ret[$row->object->getUri()] = $val; |
1801 | 1801 | } |
1802 | 1802 | } |
@@ -1895,10 +1895,10 @@ discard block |
||
1895 | 1895 | |
1896 | 1896 | $label = null; |
1897 | 1897 | if (isset($row->label)) { |
1898 | - if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) { |
|
1898 | + if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) { |
|
1899 | 1899 | $label = $row->label->getValue(); |
1900 | 1900 | } else { |
1901 | - $label = $row->label->getValue() . " (" . $row->label->getLang() . ")"; |
|
1901 | + $label = $row->label->getValue()." (".$row->label->getLang().")"; |
|
1902 | 1902 | } |
1903 | 1903 | |
1904 | 1904 | } |
@@ -1976,8 +1976,8 @@ discard block |
||
1976 | 1976 | foreach ($result as $row) { |
1977 | 1977 | if (isset($row->top) && isset($row->label)) { |
1978 | 1978 | $label = $row->label->getValue(); |
1979 | - if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) { |
|
1980 | - $label .= ' (' . $row->label->getLang() . ')'; |
|
1979 | + if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) { |
|
1980 | + $label .= ' ('.$row->label->getLang().')'; |
|
1981 | 1981 | } |
1982 | 1982 | $top = array('uri' => $row->top->getUri(), 'topConceptOf' => $row->topuri->getUri(), 'label' => $label, 'hasChildren' => filter_var($row->children->getValue(), FILTER_VALIDATE_BOOLEAN)); |
1983 | 1983 | if (isset($row->notation)) { |
@@ -2084,8 +2084,8 @@ discard block |
||
2084 | 2084 | $label = null; |
2085 | 2085 | if (isset($row->childlabel)) { |
2086 | 2086 | $label = $row->childlabel->getValue(); |
2087 | - if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang . "-") !== 0) { |
|
2088 | - $label .= " (" . $row->childlabel->getLang() . ")"; |
|
2087 | + if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang."-") !== 0) { |
|
2088 | + $label .= " (".$row->childlabel->getLang().")"; |
|
2089 | 2089 | } |
2090 | 2090 | |
2091 | 2091 | } |
@@ -2106,8 +2106,8 @@ discard block |
||
2106 | 2106 | } |
2107 | 2107 | if (isset($row->label)) { |
2108 | 2108 | $preflabel = $row->label->getValue(); |
2109 | - if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) { |
|
2110 | - $preflabel .= ' (' . $row->label->getLang() . ')'; |
|
2109 | + if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) { |
|
2110 | + $preflabel .= ' ('.$row->label->getLang().')'; |
|
2111 | 2111 | } |
2112 | 2112 | |
2113 | 2113 | $ret[$uri]['prefLabel'] = $preflabel; |
@@ -2274,10 +2274,10 @@ discard block |
||
2274 | 2274 | 'type' => array($row->type->shorten()), |
2275 | 2275 | ); |
2276 | 2276 | if (isset($row->label)) { |
2277 | - if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) { |
|
2277 | + if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) { |
|
2278 | 2278 | $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue(); |
2279 | 2279 | } else { |
2280 | - $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")"; |
|
2280 | + $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")"; |
|
2281 | 2281 | } |
2282 | 2282 | |
2283 | 2283 | } |
@@ -2324,7 +2324,7 @@ discard block |
||
2324 | 2324 | private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false) |
2325 | 2325 | { |
2326 | 2326 | $fcl = $this->generateFromClause(); |
2327 | - $offset = ($offset) ? 'OFFSET ' . $offset : ''; |
|
2327 | + $offset = ($offset) ? 'OFFSET '.$offset : ''; |
|
2328 | 2328 | |
2329 | 2329 | //Additional clauses when deprecated concepts need to be included in the results |
2330 | 2330 | $deprecatedOptions = ''; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @param string $query |
66 | 66 | * @return string |
67 | - */ |
|
67 | + */ |
|
68 | 68 | protected function generateQueryPrefixes($query) |
69 | 69 | { |
70 | 70 | // Check for undefined prefixes |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // configure the HTTP client used by EasyRdf\Sparql\Client |
127 | 127 | $httpclient = EasyRdf\Http::getDefaultHttpClient(); |
128 | 128 | $httpclient->setConfig(array('timeout' => $this->model->getConfig()->getSparqlTimeout(), |
129 | - 'useragent' => 'Skosmos')); |
|
129 | + 'useragent' => 'Skosmos')); |
|
130 | 130 | |
131 | 131 | // if special cache control (typically no-cache) was requested by the |
132 | 132 | // client, set the same type of cache control headers also in subsequent |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | return $query; |
1018 | 1018 | } |
1019 | 1019 | /** |
1020 | - * This function can be overwritten in other SPARQL dialects for the possibility of handling the different language clauses |
|
1020 | + * This function can be overwritten in other SPARQL dialects for the possibility of handling the different language clauses |
|
1021 | 1021 | * @param string $lang |
1022 | 1022 | * @return string formatted language clause |
1023 | 1023 | */ |
@@ -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 | |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | # make text query clause |
129 | 129 | $lcletter = mb_strtolower($letter, 'UTF-8'); // convert to lower case, UTF-8 safe |
130 | 130 | $langClause = $this->generateLangClause($lang); |
131 | - $textcondPref = $this->createTextQueryCondition($letter . '*', 'skos:prefLabel', $langClause); |
|
132 | - $textcondAlt = $this->createTextQueryCondition($letter . '*', 'skos:altLabel', $langClause); |
|
133 | - $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang) . " STR(?s) LCASE(STR(?qualifier))"; |
|
131 | + $textcondPref = $this->createTextQueryCondition($letter.'*', 'skos:prefLabel', $langClause); |
|
132 | + $textcondAlt = $this->createTextQueryCondition($letter.'*', 'skos:altLabel', $langClause); |
|
133 | + $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang)." STR(?s) LCASE(STR(?qualifier))"; |
|
134 | 134 | |
135 | - $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : ""; |
|
135 | + $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : ""; |
|
136 | 136 | |
137 | 137 | $filterDeprecated = ""; |
138 | 138 | if (!$showDeprecated) { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | return $lname; |
105 | 105 | } |
106 | 106 | // already a full URI |
107 | - return $this->getUriSpace() . $lname; |
|
107 | + return $this->getUriSpace().$lname; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $result = $sparql->queryConceptScheme($defaultcs); |
167 | 167 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
168 | 168 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
169 | - error_log('Caught exception: ' . $e->getMessage()); |
|
169 | + error_log('Caught exception: '.$e->getMessage()); |
|
170 | 170 | } |
171 | 171 | return null; |
172 | 172 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | foreach ($conceptscheme->allLiterals($prop, null) as $val) { |
200 | 200 | $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop; |
201 | 201 | if ($val->getValue() instanceof DateTime) { |
202 | - $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang); |
|
202 | + $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang).' '.Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang); |
|
203 | 203 | } |
204 | 204 | $ret[$prop][] = $val; |
205 | 205 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang); |
257 | 257 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
258 | 258 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
259 | - error_log('Caught exception: ' . $e->getMessage()); |
|
259 | + error_log('Caught exception: '.$e->getMessage()); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | return $conceptSchemes; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | } |
328 | 328 | // don't know how to parse |
329 | 329 | $rev = $parts[2]; |
330 | - $datestr = $parts[3] . ' ' . $parts[4]; |
|
330 | + $datestr = $parts[3].' '.$parts[4]; |
|
331 | 331 | |
332 | 332 | return "$datestr (r$rev)"; |
333 | 333 | } |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | $conceptInfo = $sparql->queryConceptInfo([$uri], $this->config->getArrayClassURI(), array($this), $clang); |
458 | 458 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
459 | 459 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
460 | - error_log('Caught exception: ' . $e->getMessage()); |
|
460 | + error_log('Caught exception: '.$e->getMessage()); |
|
461 | 461 | } |
462 | 462 | } |
463 | 463 | return $conceptInfo[0]; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | if ($this->resource->allLiterals('skos:prefLabel')) { |
61 | 61 | foreach ($this->resource->allLiterals('skos:prefLabel') as $label) { |
62 | 62 | // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language |
63 | - if ($label !== null && strpos($label->getLang(), $fallback . '-') === 0) { |
|
63 | + if ($label !== null && strpos($label->getLang(), $fallback.'-') === 0) { |
|
64 | 64 | return EasyRdf\Literal::create($label, $fallback); |
65 | 65 | } |
66 | 66 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $paramValue = $paramLiteral->getValue(); |
124 | 124 | $paramLang = $paramLiteral->getLang(); |
125 | 125 | if ($paramLang) { |
126 | - $paramName .= '_' . $paramLang; |
|
126 | + $paramName .= '_'.$paramLang; |
|
127 | 127 | } |
128 | 128 | $this->pluginParameters[$pluginName][$paramName] = $paramValue; |
129 | 129 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $labelProperty = $override->getResource('skosmos:property'); |
156 | 156 | $labelPropUri = $labelProperty->shorten(); |
157 | 157 | if (empty($this->labelOverrides[$labelPropUri])) { |
158 | - $this->labelOverrides[$labelPropUri] = array(); |
|
158 | + $this->labelOverrides[$labelPropUri] = array(); |
|
159 | 159 | } |
160 | 160 | $newOverrides = array(); |
161 | 161 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $langs = $this->getLanguages(); |
230 | 230 | $deflang = reset($langs); // picking the first one from the list with reset since the keys are not numeric |
231 | 231 | if (sizeof($langs) > 1) { |
232 | - trigger_error("Default language for vocabulary '" . $this->getShortName() . "' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
232 | + trigger_error("Default language for vocabulary '".$this->getShortName()."' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | return $deflang; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | // We need to check all the labels in case one of them matches a subtag of the current language |
147 | 147 | foreach ($this->resource->allLiterals('skos:prefLabel') as $label) { |
148 | 148 | // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language |
149 | - if ($label !== null && strpos($label->getLang(), $fallback . '-') === 0) { |
|
149 | + if ($label !== null && strpos($label->getLang(), $fallback.'-') === 0) { |
|
150 | 150 | return EasyRdf\Literal::create($label, $fallback); |
151 | 151 | } |
152 | 152 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // catch external subjects that have $res as object |
282 | 282 | $extSubjects = $exGraph->resourcesMatching("schema:about", $res); |
283 | 283 | |
284 | - $propList = array_unique(array_merge( |
|
284 | + $propList = array_unique(array_merge( |
|
285 | 285 | $this->DEFAULT_EXT_PROPERTIES, |
286 | 286 | $this->getVocab()->getConfig()->getExtProperties(), |
287 | 287 | $this->getVocab()->getConfig()->getPluginRegister()->getExtProperties() |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | private function addPropertyValues($res, $prop, &$seen) |
337 | 337 | { |
338 | - $resList = $res->allResources('<' . $prop . '>'); |
|
338 | + $resList = $res->allResources('<'.$prop.'>'); |
|
339 | 339 | |
340 | 340 | foreach ($resList as $res2) { |
341 | 341 | if ($res2->isBNode()) { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | $this->addResourceReifications($res, $prop, $res2, $seen); |
346 | 346 | } |
347 | 347 | |
348 | - $litList = $res->allLiterals('<' . $prop . '>'); |
|
348 | + $litList = $res->allLiterals('<'.$prop.'>'); |
|
349 | 349 | |
350 | 350 | foreach ($litList as $lit) { |
351 | 351 | $this->graph->addLiteral($res, $prop, $lit); |
@@ -734,14 +734,14 @@ discard block |
||
734 | 734 | |
735 | 735 | // making a human readable string from the timestamps |
736 | 736 | if ($created != '') { |
737 | - $ret = $this->model->getText('skosmos:created') . ' ' . (Punic\Calendar::formatDate($created, 'short', $this->getLang())); |
|
737 | + $ret = $this->model->getText('skosmos:created').' '.(Punic\Calendar::formatDate($created, 'short', $this->getLang())); |
|
738 | 738 | } |
739 | 739 | |
740 | 740 | if ($modified != '') { |
741 | 741 | if ($created != '') { |
742 | - $ret .= ', ' . $this->model->getText('skosmos:modified') . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getLang())); |
|
742 | + $ret .= ', '.$this->model->getText('skosmos:modified').' '.(Punic\Calendar::formatDate($modified, 'short', $this->getLang())); |
|
743 | 743 | } else { |
744 | - $ret .= ' ' . ucfirst($this->model->getText('skosmos:modified')) . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getLang())); |
|
744 | + $ret .= ' '.ucfirst($this->model->getText('skosmos:modified')).' '.(Punic\Calendar::formatDate($modified, 'short', $this->getLang())); |
|
745 | 745 | } |
746 | 746 | |
747 | 747 | } |
@@ -749,12 +749,12 @@ discard block |
||
749 | 749 | trigger_error($e->getMessage(), E_USER_WARNING); |
750 | 750 | $ret = ''; |
751 | 751 | if ($this->resource->get('dc:modified')) { |
752 | - $modified = (string) $this->resource->get('dc:modified'); |
|
753 | - $ret = $this->model->getText('skosmos:modified') . ' ' . $modified; |
|
752 | + $modified = (string)$this->resource->get('dc:modified'); |
|
753 | + $ret = $this->model->getText('skosmos:modified').' '.$modified; |
|
754 | 754 | } |
755 | 755 | if ($this->resource->get('dc:created')) { |
756 | - $created .= (string) $this->resource->get('dc:created'); |
|
757 | - $ret .= ' ' . $this->model->getText('skosmos:created') . ' ' . $created; |
|
756 | + $created .= (string)$this->resource->get('dc:created'); |
|
757 | + $ret .= ' '.$this->model->getText('skosmos:created').' '.$created; |
|
758 | 758 | } |
759 | 759 | } |
760 | 760 | return $ret; |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | $arrayClassURI = $this->vocab !== null ? $this->vocab->getConfig()->getArrayClassURI() : null; |
811 | 811 | $arrayClass = $arrayClassURI !== null ? EasyRdf\RdfNamespace::shorten($arrayClassURI) : null; |
812 | 812 | $superGroups = $this->resource->all('isothes:superGroup'); |
813 | - $superGroupUris = array_map(function ($obj) { return $obj->getUri(); }, $superGroups); |
|
813 | + $superGroupUris = array_map(function($obj) { return $obj->getUri(); }, $superGroups); |
|
814 | 814 | foreach ($collections as $collection) { |
815 | 815 | if (in_array($arrayClass, $collection->types()) === $includeArrays) { |
816 | 816 | // not adding the memberOf if the reverse resource is already covered by isothes:superGroup see issue #433 |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | foreach ($labels as $lit) { |
877 | 877 | // filtering away subsets of the current language eg. en vs en-GB |
878 | 878 | $langCode = strval($lit->getLang()); |
879 | - if ($langCode != $this->clang && strpos($langCode, $this->getLang() . '-') !== 0) { |
|
879 | + if ($langCode != $this->clang && strpos($langCode, $this->getLang().'-') !== 0) { |
|
880 | 880 | $ret[$langCode][$key][] = new ConceptPropertyValueLiteral($this->model, $this->vocab, $this->resource, $lit, $prop); |
881 | 881 | } |
882 | 882 | } |
@@ -965,10 +965,10 @@ discard block |
||
965 | 965 | $context[$vocabPrefix] = $vocabUriSpace; |
966 | 966 | } elseif ($context[$vocabPrefix] !== $vocabUriSpace) { |
967 | 967 | $i = 2; |
968 | - while (isset($context[$vocabPrefix . $i]) && $context[$vocabPrefix . $i] !== $vocabUriSpace) { |
|
968 | + while (isset($context[$vocabPrefix.$i]) && $context[$vocabPrefix.$i] !== $vocabUriSpace) { |
|
969 | 969 | $i += 1; |
970 | 970 | } |
971 | - $context[$vocabPrefix . $i] = $vocabUriSpace; |
|
971 | + $context[$vocabPrefix.$i] = $vocabUriSpace; |
|
972 | 972 | } |
973 | 973 | } |
974 | 974 | $compactJsonLD = \ML\JsonLD\JsonLD::compact($this->graph->serialise('jsonld'), json_encode($context)); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public function __construct(Model $model, string $config_name = '../../config.ttl') |
34 | 34 | { |
35 | 35 | $this->cache = new Cache(); |
36 | - $this->filePath = realpath(dirname(__FILE__) . "/" . $config_name); |
|
36 | + $this->filePath = realpath(dirname(__FILE__)."/".$config_name); |
|
37 | 37 | if (!file_exists($this->filePath)) { |
38 | 38 | throw new Exception('config.ttl file is missing, please provide one.'); |
39 | 39 | } |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | // use APC user cache to store parsed config.ttl configuration |
70 | 70 | if ($this->cache->isAvailable() && !is_null($this->configModifiedTime)) { |
71 | 71 | // @codeCoverageIgnoreStart |
72 | - $key = realpath($this->filePath) . ", " . $this->configModifiedTime; |
|
73 | - $nskey = "namespaces of " . $key; |
|
72 | + $key = realpath($this->filePath).", ".$this->configModifiedTime; |
|
73 | + $nskey = "namespaces of ".$key; |
|
74 | 74 | $this->graph = $this->cache->fetch($key); |
75 | 75 | $this->namespaces = $this->cache->fetch($nskey); |
76 | 76 | if ($this->graph === false || $this->namespaces === false) { // was not found in cache |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | public function getGlobalPlugins() |
363 | 363 | { |
364 | 364 | $globalPlugins = array(); |
365 | - $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
365 | + $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
366 | 366 | if ($globalPluginsResource) { |
367 | 367 | foreach ($globalPluginsResource as $resource) { |
368 | 368 | $globalPlugins[] = $resource->getValue(); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | return Punic\Calendar::formatDate($val, 'short'); |
45 | 45 | } catch (Exception $e) { |
46 | 46 | trigger_error($e->getMessage(), E_USER_WARNING); |
47 | - return (string) $this->literal; |
|
47 | + return (string)$this->literal; |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | return $this->literal->getValue(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getDescription() |
81 | 81 | { |
82 | - $helpprop = $this->prop . "_help"; |
|
82 | + $helpprop = $this->prop."_help"; |
|
83 | 83 | |
84 | 84 | // see if we have a translation with the help text |
85 | 85 | $help = $this->model->getText($helpprop); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | public function addValue($value) |
112 | 112 | { |
113 | - $this->values[ltrim($value->getNotation() . ' ') . $value->getLabel() . rtrim(' ' . $value->getUri())] = $value; |
|
113 | + $this->values[ltrim($value->getNotation().' ').$value->getLabel().rtrim(' '.$value->getUri())] = $value; |
|
114 | 114 | $this->is_sorted = false; |
115 | 115 | } |
116 | 116 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | # Note that getLabel() returns URIs in case of no label and may return a prefixed value which affects sorting |
121 | 121 | if (!empty($this->values)) { |
122 | 122 | if ($this->sort_by_notation) { |
123 | - uasort($this->values, function ($a, $b) { |
|
123 | + uasort($this->values, function($a, $b) { |
|
124 | 124 | $anot = $a->getNotation(); |
125 | 125 | $bnot = $b->getNotation(); |
126 | 126 | if ($anot == null) { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | }); |
143 | 143 | } else { |
144 | - uasort($this->values, function ($a, $b) { |
|
144 | + uasort($this->values, function($a, $b) { |
|
145 | 145 | // assume that sort keys are unique |
146 | 146 | return strcoll($a->getSortKey(), $b->getSortKey()); |
147 | 147 | }); |