@@ -124,8 +124,8 @@ |
||
| 124 | 124 | */ |
| 125 | 125 | public function getEnvLang() |
| 126 | 126 | { |
| 127 | - // get language from locale, same as used by gettext, set by Controller |
|
| 128 | - return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore |
|
| 127 | + // get language from locale, same as used by gettext, set by Controller |
|
| 128 | + return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -517,13 +517,13 @@ |
||
| 517 | 517 | |
| 518 | 518 | $defaultPropLabel = $this->model->getDefaultSparql()->queryLabel($longUri, ''); |
| 519 | 519 | |
| 520 | - if($envLangLabels) { |
|
| 521 | - $proplabel = $envLangLabels[$this->getEnvLang()]; |
|
| 520 | + if($envLangLabels) { |
|
| 521 | + $proplabel = $envLangLabels[$this->getEnvLang()]; |
|
| 522 | 522 | } else { |
| 523 | - if($defaultPropLabel) { |
|
| 524 | - $proplabel = $defaultPropLabel['']; |
|
| 525 | - } |
|
| 526 | - } |
|
| 523 | + if($defaultPropLabel) { |
|
| 524 | + $proplabel = $defaultPropLabel['']; |
|
| 525 | + } |
|
| 526 | + } |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | // look for superproperties in the current graph |
@@ -30,14 +30,14 @@ |
||
| 30 | 30 | $url = $baseurl . "$vocid/"; |
| 31 | 31 | } else { |
| 32 | 32 | |
| 33 | - if ($localname !== $uri && $localname === urlencode($localname)) { |
|
| 34 | - // the URI can be shortened |
|
| 33 | + if ($localname !== $uri && $localname === urlencode($localname)) { |
|
| 34 | + // the URI can be shortened |
|
| 35 | 35 | $url = $baseurl . "$vocid/page/$localname"; |
| 36 | 36 | } else { |
| 37 | 37 | // must use full URI |
| 38 | - $query = http_build_query(array('uri'=>$uri)); |
|
| 38 | + $query = http_build_query(array('uri'=>$uri)); |
|
| 39 | 39 | $url = $baseurl . "$vocid/page/?" . $query; |
| 40 | - } |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | $this->redirect303($url); |
| 43 | 43 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | return $help; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - // if not, see if there was a comment/definition for the property in the graph |
|
| 75 | + // if not, see if there was a comment/definition for the property in the graph |
|
| 76 | 76 | if ($this->tooltip !== null) { |
| 77 | 77 | return $this->tooltip; |
| 78 | 78 | } |
@@ -33,16 +33,16 @@ |
||
| 33 | 33 | // Encrypt the current time |
| 34 | 34 | $honey_time_encrypted = $this->getEncryptedTime(); |
| 35 | 35 | return '<div id="' . $honey_name . '_wrap" style="display:none;">' . "\r\n" . |
| 36 | - '<input name="' . $honey_name . '" type="text" value="" id="' . $honey_name . '"/>' . "\r\n" . |
|
| 37 | - '<input name="' . $honey_time . '" type="text" value="' . $honey_time_encrypted . '"/>' . "\r\n" . |
|
| 36 | + '<input name="' . $honey_name . '" type="text" value="" id="' . $honey_name . '"/>' . "\r\n" . |
|
| 37 | + '<input name="' . $honey_time . '" type="text" value="' . $honey_time_encrypted . '"/>' . "\r\n" . |
|
| 38 | 38 | '</div>'; |
| 39 | 39 | } |
| 40 | 40 | /** |
| 41 | - * Validate honeypot is empty |
|
| 42 | - * |
|
| 43 | - * @param mixed $value |
|
| 44 | - * @return boolean |
|
| 45 | - */ |
|
| 41 | + * Validate honeypot is empty |
|
| 42 | + * |
|
| 43 | + * @param mixed $value |
|
| 44 | + * @return boolean |
|
| 45 | + */ |
|
| 46 | 46 | public function validateHoneypot($value) : bool |
| 47 | 47 | { |
| 48 | 48 | if ($this->disabled) { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * @param string $query |
| 67 | 67 | * @return string |
| 68 | - */ |
|
| 68 | + */ |
|
| 69 | 69 | protected function generateQueryPrefixes($query) |
| 70 | 70 | { |
| 71 | 71 | // Check for undefined prefixes |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | $gcl = $this->graphClause; |
| 234 | 234 | $classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept'); |
| 235 | 235 | |
| 236 | - $quote_string = function($val) { return "'$val'"; }; |
|
| 237 | - $quoted_values = array_map($quote_string, $langs); |
|
| 238 | - $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))"; |
|
| 236 | + $quote_string = function($val) { return "'$val'"; }; |
|
| 237 | + $quoted_values = array_map($quote_string, $langs); |
|
| 238 | + $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))"; |
|
| 239 | 239 | |
| 240 | 240 | $values = $this->formatValues('?type', $classes, 'uri'); |
| 241 | 241 | $valuesProp = $this->formatValues('?prop', $props, null); |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | return $query; |
| 963 | 963 | } |
| 964 | 964 | /** |
| 965 | - * This function can be overwritten in other SPARQL dialects for the possibility of handling the different language clauses |
|
| 965 | + * This function can be overwritten in other SPARQL dialects for the possibility of handling the different language clauses |
|
| 966 | 966 | * @param string $lang |
| 967 | 967 | * @return string formatted language clause |
| 968 | 968 | */ |
@@ -1911,7 +1911,7 @@ discard block |
||
| 1911 | 1911 | |
| 1912 | 1912 | /** |
| 1913 | 1913 | * Generates a sparql query for finding the hierarchy for a concept. |
| 1914 | - * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal. |
|
| 1914 | + * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal. |
|
| 1915 | 1915 | * @param string $uri concept uri. |
| 1916 | 1916 | * @param string $lang |
| 1917 | 1917 | * @param string $fallback language to use if label is not available in the preferred language |
@@ -1988,10 +1988,10 @@ discard block |
||
| 1988 | 1988 | $ret[$uri]['exact'] = $row->exact->getUri(); |
| 1989 | 1989 | } |
| 1990 | 1990 | if (isset($row->tops)) { |
| 1991 | - $topConceptsList=explode(" ", $row->tops->getValue()); |
|
| 1992 | - // sort to guarantee an alphabetical ordering of the URI |
|
| 1993 | - sort($topConceptsList); |
|
| 1994 | - $ret[$uri]['tops'] = $topConceptsList; |
|
| 1991 | + $topConceptsList=explode(" ", $row->tops->getValue()); |
|
| 1992 | + // sort to guarantee an alphabetical ordering of the URI |
|
| 1993 | + sort($topConceptsList); |
|
| 1994 | + $ret[$uri]['tops'] = $topConceptsList; |
|
| 1995 | 1995 | } |
| 1996 | 1996 | if (isset($row->children)) { |
| 1997 | 1997 | if (!isset($ret[$uri]['narrower'])) { |
@@ -7,12 +7,12 @@ |
||
| 7 | 7 | abstract class BaseConfig extends DataObject |
| 8 | 8 | { |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * Returns a boolean value based on a literal value from the config.ttl configuration. |
|
| 12 | - * @param string $property the property to query |
|
| 13 | - * @param boolean $default the default value if the value is not set in configuration |
|
| 14 | - * @return boolean the boolean value for the given property, or the default value if not found |
|
| 15 | - */ |
|
| 10 | + /** |
|
| 11 | + * Returns a boolean value based on a literal value from the config.ttl configuration. |
|
| 12 | + * @param string $property the property to query |
|
| 13 | + * @param boolean $default the default value if the value is not set in configuration |
|
| 14 | + * @return boolean the boolean value for the given property, or the default value if not found |
|
| 15 | + */ |
|
| 16 | 16 | protected function getBoolean($property, $default = false) |
| 17 | 17 | { |
| 18 | 18 | $val = $this->getResource()->getLiteral($property); |
@@ -575,9 +575,9 @@ discard block |
||
| 575 | 575 | $vocid = $request->getVocab()->getId(); |
| 576 | 576 | return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang"); |
| 577 | 577 | } |
| 578 | - } else { |
|
| 578 | + } else { |
|
| 579 | 579 | header("Location: " . $urls[$format]); |
| 580 | - } |
|
| 580 | + } |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | private function returnDataResults($results, $format) { |
@@ -1120,9 +1120,9 @@ discard block |
||
| 1120 | 1120 | } |
| 1121 | 1121 | return $this->returnJson(array_merge_recursive($this->context, |
| 1122 | 1122 | array('@context' => array( '@language' => $request->getLang(), |
| 1123 | - 'prefLabel' => 'skos:prefLabel', |
|
| 1124 | - 'xsd' => 'http://www.w3.org/2001/XMLSchema#', |
|
| 1125 | - 'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') ) |
|
| 1123 | + 'prefLabel' => 'skos:prefLabel', |
|
| 1124 | + 'xsd' => 'http://www.w3.org/2001/XMLSchema#', |
|
| 1125 | + 'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') ) |
|
| 1126 | 1126 | ), |
| 1127 | 1127 | array('changeList' => $simpleChangeList))); |
| 1128 | 1128 | |
@@ -163,10 +163,10 @@ discard block |
||
| 163 | 163 | $sparql = $this->getSparql(); |
| 164 | 164 | $result = $sparql->queryConceptScheme($defaultcs); |
| 165 | 165 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
| 166 | - if ($this->model->getConfig()->getLogCaughtExceptions()) { |
|
| 167 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 168 | - } |
|
| 169 | - return null; |
|
| 166 | + if ($this->model->getConfig()->getLogCaughtExceptions()) { |
|
| 167 | + error_log('Caught exception: ' . $e->getMessage()); |
|
| 168 | + } |
|
| 169 | + return null; |
|
| 170 | 170 | } |
| 171 | 171 | $conceptscheme = $result->resource($defaultcs); |
| 172 | 172 | $this->order = array( |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | try { |
| 254 | 254 | $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang); |
| 255 | 255 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
| 256 | - if ($this->model->getConfig()->getLogCaughtExceptions()) { |
|
| 257 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 258 | - } |
|
| 256 | + if ($this->model->getConfig()->getLogCaughtExceptions()) { |
|
| 257 | + error_log('Caught exception: ' . $e->getMessage()); |
|
| 258 | + } |
|
| 259 | 259 | } |
| 260 | 260 | return $conceptSchemes; |
| 261 | 261 | } |
@@ -453,9 +453,9 @@ discard block |
||
| 453 | 453 | try { |
| 454 | 454 | $conceptInfo = $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang); |
| 455 | 455 | } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { |
| 456 | - if ($this->model->getConfig()->getLogCaughtExceptions()) { |
|
| 457 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 458 | - } |
|
| 456 | + if ($this->model->getConfig()->getLogCaughtExceptions()) { |
|
| 457 | + error_log('Caught exception: ' . $e->getMessage()); |
|
| 458 | + } |
|
| 459 | 459 | } |
| 460 | 460 | return $conceptInfo; |
| 461 | 461 | } |