Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase.php |
— | — | @@ -228,6 +228,21 @@ |
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
| 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 | + /** |
232 | 247 | * DELETE wrapper. |
233 | 248 | * The function declares the standard namespaces wiki, swivt, rdf, owl, |
234 | 249 | * rdfs, property, xsd, so these do not have to be included in |
— | — | @@ -309,6 +324,7 @@ |
310 | 325 | * @return SMWSparqlResultWrapper |
311 | 326 | */ |
312 | 327 | public function doQuery( $sparql ) { |
| 328 | + debug_zval_dump( $sparql ); |
313 | 329 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_queryEndpoint ); |
314 | 330 | curl_setopt( $this->m_curlhandle, CURLOPT_POST, true ); |
315 | 331 | $parameterString = "query=" . urlencode( $sparql ); |