@@ -47,12 +47,16 @@ discard block |
||
| 47 | 47 | $this->client = new EasyRdf\Sparql\Client($endpoint); |
| 48 | 48 | |
| 49 | 49 | // set graphClause so that it can be used by all queries |
| 50 | - if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable) |
|
| 50 | + if ($this->isDefaultEndpoint()) { |
|
| 51 | + // default endpoint; query any graph (and catch it in a variable) |
|
| 51 | 52 | { |
| 52 | 53 | $this->graphClause = "GRAPH $graph"; |
| 53 | - } elseif ($graph !== null) // query a specific graph |
|
| 54 | + } |
|
| 55 | + } elseif ($graph !== null) { |
|
| 56 | + // query a specific graph |
|
| 54 | 57 | { |
| 55 | 58 | $this->graphClause = "GRAPH <$graph>"; |
| 59 | + } |
|
| 56 | 60 | } else // query the default graph |
| 57 | 61 | { |
| 58 | 62 | $this->graphClause = ""; |
@@ -1274,8 +1278,7 @@ discard block |
||
| 1274 | 1278 | if (isset($row->qualifier)) { |
| 1275 | 1279 | if ($row->qualifier instanceof EasyRdf\Literal) { |
| 1276 | 1280 | $hit['qualifier'] = $row->qualifier->getValue(); |
| 1277 | - } |
|
| 1278 | - else { |
|
| 1281 | + } else { |
|
| 1279 | 1282 | $hit['qualifier'] = $row->qualifier->localName(); |
| 1280 | 1283 | } |
| 1281 | 1284 | } |
@@ -1955,8 +1958,7 @@ discard block |
||
| 1955 | 1958 | if (sizeof($ret) > 0) { |
| 1956 | 1959 | // existing concept, with children |
| 1957 | 1960 | return $ret; |
| 1958 | - } |
|
| 1959 | - else { |
|
| 1961 | + } else { |
|
| 1960 | 1962 | // nonexistent concept |
| 1961 | 1963 | return null; |
| 1962 | 1964 | } |
@@ -354,10 +354,12 @@ |
||
| 354 | 354 | // register vocabulary ids as RDF namespace prefixes |
| 355 | 355 | $prefix = preg_replace('/\W+/', '', $voc->getId()); // strip non-word characters |
| 356 | 356 | try { |
| 357 | - if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) // if not already defined |
|
| 357 | + if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) { |
|
| 358 | + // if not already defined |
|
| 358 | 359 | { |
| 359 | 360 | EasyRdf\RdfNamespace::set($prefix, $voc->getUriSpace()); |
| 360 | 361 | } |
| 362 | + } |
|
| 361 | 363 | |
| 362 | 364 | } catch (Exception $e) { |
| 363 | 365 | // not valid as namespace identifier, ignore |
@@ -266,11 +266,17 @@ |
||
| 266 | 266 | $envelopeSender = $this->model->getConfig()->getFeedbackEnvelopeSender(); |
| 267 | 267 | // determine the sender address of the message |
| 268 | 268 | $sender = $this->model->getConfig()->getFeedbackSender(); |
| 269 | - if (empty($sender)) $sender = $envelopeSender; |
|
| 270 | - if (empty($sender)) $sender = $this->model->getConfig()->getFeedbackAddress(); |
|
| 269 | + if (empty($sender)) { |
|
| 270 | + $sender = $envelopeSender; |
|
| 271 | + } |
|
| 272 | + if (empty($sender)) { |
|
| 273 | + $sender = $this->model->getConfig()->getFeedbackAddress(); |
|
| 274 | + } |
|
| 271 | 275 | |
| 272 | 276 | // determine sender name - default to "anonymous user" if not given by user |
| 273 | - if (empty($fromName)) $fromName = "anonymous user"; |
|
| 277 | + if (empty($fromName)) { |
|
| 278 | + $fromName = "anonymous user"; |
|
| 279 | + } |
|
| 274 | 280 | $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender); |
| 275 | 281 | $params = empty($envelopeSender) ? '' : "-f $envelopeSender"; |
| 276 | 282 | // adding some information about the user for debugging purposes. |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | foreach ($vocabularyPlugins as $plugin) { |
| 54 | 54 | if ($plugin instanceof EasyRdf\Literal) { |
| 55 | 55 | $pluginArray[] = $plugin->getValue(); |
| 56 | - } |
|
| 57 | - else if ($plugin instanceof EasyRdf\Resource) { |
|
| 56 | + } else if ($plugin instanceof EasyRdf\Resource) { |
|
| 58 | 57 | $pluginArray[] = $plugin->getLiteral('skosmos:usePlugin')->getValue(); |
| 59 | 58 | } |
| 60 | 59 | } |
@@ -203,8 +202,9 @@ discard block |
||
| 203 | 202 | public function getShortName() |
| 204 | 203 | { |
| 205 | 204 | $shortname = $this->getLiteral('skosmos:shortName'); |
| 206 | - if ($shortname) |
|
| 207 | - return $shortname; |
|
| 205 | + if ($shortname) { |
|
| 206 | + return $shortname; |
|
| 207 | + } |
|
| 208 | 208 | |
| 209 | 209 | // if no shortname exists fall back to the id |
| 210 | 210 | return $this->getId(); |
@@ -354,10 +354,12 @@ discard block |
||
| 354 | 354 | $ret = array(); |
| 355 | 355 | foreach ($resources as $res) { |
| 356 | 356 | $prop = $res->getURI(); |
| 357 | - if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible |
|
| 357 | + if (EasyRdf\RdfNamespace::shorten($prop) !== null) { |
|
| 358 | + // shortening property labels if possible |
|
| 358 | 359 | { |
| 359 | 360 | $prop = EasyRdf\RdfNamespace::shorten($prop); |
| 360 | 361 | } |
| 362 | + } |
|
| 361 | 363 | |
| 362 | 364 | $ret[] = $prop; |
| 363 | 365 | } |
@@ -374,10 +376,12 @@ discard block |
||
| 374 | 376 | $resources = $this->resource->allResources("skosmos:hasMultiLingualProperty"); |
| 375 | 377 | foreach ($resources as $res) { |
| 376 | 378 | $prop = $res->getURI(); |
| 377 | - if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible |
|
| 379 | + if (EasyRdf\RdfNamespace::shorten($prop) !== null) { |
|
| 380 | + // shortening property labels if possible |
|
| 378 | 381 | { |
| 379 | 382 | $prop = EasyRdf\RdfNamespace::shorten($prop); |
| 380 | 383 | } |
| 384 | + } |
|
| 381 | 385 | |
| 382 | 386 | if ($prop === $property) { |
| 383 | 387 | return true; |
@@ -515,11 +519,12 @@ discard block |
||
| 515 | 519 | public function getId() |
| 516 | 520 | { |
| 517 | 521 | $uriparts = explode("#", $this->resource->getURI()); |
| 518 | - if (count($uriparts) != 1) |
|
| 519 | - // hash namespace |
|
| 522 | + if (count($uriparts) != 1) { |
|
| 523 | + // hash namespace |
|
| 520 | 524 | { |
| 521 | 525 | return $uriparts[1]; |
| 522 | 526 | } |
| 527 | + } |
|
| 523 | 528 | |
| 524 | 529 | // slash namespace |
| 525 | 530 | $uriparts = explode("/", $this->resource->getURI()); |
@@ -547,10 +552,12 @@ discard block |
||
| 547 | 552 | $ret = array(); |
| 548 | 553 | foreach ($resources as $res) { |
| 549 | 554 | $prop = $res->getURI(); |
| 550 | - if (EasyRdf\RdfNamespace::shorten($prop) !== null) // prefixing if possible |
|
| 555 | + if (EasyRdf\RdfNamespace::shorten($prop) !== null) { |
|
| 556 | + // prefixing if possible |
|
| 551 | 557 | { |
| 552 | 558 | $prop = EasyRdf\RdfNamespace::shorten($prop); |
| 553 | 559 | } |
| 560 | + } |
|
| 554 | 561 | |
| 555 | 562 | $ret[] = $prop; |
| 556 | 563 | } |