r86849 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86848‎ | r86849 | r86850 >
Date:12:17, 25 April 2011
Author:mkroetzsch
Status:deferred (Comments)
Tags:
Comment:
support ASK
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase.php
@@ -228,6 +228,21 @@
229229 }
230230
231231 /**
 232+ * ASK wrapper.
 233+ * The function declares the standard namespaces wiki, swivt, rdf, owl,
 234+ * rdfs, property, xsd, so these do not have to be included in
 235+ * $extraNamespaces.
 236+ *
 237+ * @param $where string WHERE part of the query, without surrounding { }
 238+ * @param $extraNamespaces array (associative) of namespaceId => namespaceUri
 239+ * @return SMWSparqlResultWrapper
 240+ */
 241+ public function ask( $where, $extraNamespaces = array() ) {
 242+ $sparql = self::getPrefixString( $extraNamespaces ) . "ASK {\n" . $where . "\n}";
 243+ return $this->doQuery( $sparql );
 244+ }
 245+
 246+ /**
232247 * DELETE wrapper.
233248 * The function declares the standard namespaces wiki, swivt, rdf, owl,
234249 * rdfs, property, xsd, so these do not have to be included in
@@ -309,6 +324,7 @@
310325 * @return SMWSparqlResultWrapper
311326 */
312327 public function doQuery( $sparql ) {
 328+ debug_zval_dump( $sparql );
313329 curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_queryEndpoint );
314330 curl_setopt( $this->m_curlhandle, CURLOPT_POST, true );
315331 $parameterString = "query=" . urlencode( $sparql );

Comments

#Comment by Nikerabbit (talk | contribs)   12:31, 25 April 2011

? + debug_zval_dump( $sparql );

Status & tagging log