Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUI.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | } |
95 | 95 | |
96 | 96 | // Make sure locally collected output data is pushed to the output: |
97 | | - SMWOutputs::commitToOutputPage( $wgOut ); |
| 97 | + SMWOutputs::commitToOutputPage( $wgOut ); |
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
— | — | @@ -1413,7 +1413,7 @@ |
1414 | 1414 | * @global boolean $smwgQSortingSupport |
1415 | 1415 | * @global WebRequest $wgRequest |
1416 | 1416 | * @return string |
1417 | | - * |
| 1417 | + * |
1418 | 1418 | * @todo This code is not used anywhere in SMW. |
1419 | 1419 | */ |
1420 | 1420 | protected function getSortingFormBox() { |
— | — | @@ -1447,7 +1447,7 @@ |
1448 | 1448 | $this->setUrlArgs( $urlArgs ); |
1449 | 1449 | } |
1450 | 1450 | |
1451 | | - $hidden .= '<div id="sorting_starter" style="display: none">' . wfMsg( 'smw_ask_sortby' ) . ' <input type="text" size="25" />' . "\n"; |
| 1451 | + $hidden = '<div id="sorting_starter" style="display: none">' . wfMsg( 'smw_ask_sortby' ) . ' <input type="text" size="25" />' . "\n"; |
1452 | 1452 | $hidden .= ' <select name="order_num">' . "\n"; |
1453 | 1453 | $hidden .= ' <option value="ASC">' . wfMsg( 'smw_qui_ascorder' ) . "</option>\n"; |
1454 | 1454 | $hidden .= ' <option value="DESC">' . wfMsg( 'smw_qui_descorder' ) . "</option>\n</select>\n"; |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_RDFXML.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | /** |
5 | 5 | * File holding the SMWRDFXMLSerializer class that provides basic functions for |
6 | | - * serialising OWL data in RDF/XML syntax. |
| 6 | + * serialising OWL data in RDF/XML syntax. |
7 | 7 | * |
8 | 8 | * @file SMW_Serializer.php |
9 | 9 | * @ingroup SMW |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Class for serializing exported data (encoded as SMWExpData object) in |
16 | | - * RDF/XML. |
| 16 | + * RDF/XML. |
17 | 17 | * |
18 | 18 | * @ingroup SMW |
19 | 19 | */ |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | /** |
22 | 22 | * True if the $pre_ns_buffer contains the beginning of a namespace |
23 | 23 | * declaration block to which further declarations for the current |
24 | | - * context can be appended. |
| 24 | + * context can be appended. |
25 | 25 | */ |
26 | 26 | protected $namespace_block_started; |
27 | 27 | /** |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | $this->post_ns_buffer .= "\t<!-- Created by Semantic MediaWiki, http://semantic-mediawiki.org/ -->\n"; |
72 | 72 | $this->post_ns_buffer .= '</rdf:RDF>'; |
73 | 73 | } |
74 | | - |
| 74 | + |
75 | 75 | public function serializeDeclaration( $uri, $typename ) { |
76 | 76 | $this->post_ns_buffer .= "\t<$typename rdf:about=\"$uri\" />\n"; |
77 | 77 | } |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | $this->namespace_block_started = false; |
93 | 93 | return $result; |
94 | 94 | } |
95 | | - |
| 95 | + |
96 | 96 | protected function serializeNamespace( $shortname, $uri ) { |
97 | 97 | if ( $this->namespaces_are_global ) { |
98 | 98 | $this->global_namespaces[$shortname] = true; |
— | — | @@ -197,7 +197,7 @@ |
198 | 198 | protected function serializeExpResource( SMWExpNsResource $expResourceProperty, SMWExpResource $expResource, $indent, $isClassTypeProp ) { |
199 | 199 | $this->post_ns_buffer .= $indent . '<' . $expResourceProperty->getQName(); |
200 | 200 | if ( !$expResource->isBlankNode() ) { |
201 | | - if ( ( $expResource instanceof SMWExpNsResource ) && ( $expResource->getNamespaceID() == 'wiki' ) ) { |
| 201 | + if ( ( $expResource instanceof SMWExpNsResource ) && ( $expResource->getNamespaceID() == 'wiki' ) ) { |
202 | 202 | // very common case, reduce bandwidth |
203 | 203 | $this->post_ns_buffer .= ' rdf:resource="&wiki;' . $expResource->getLocalName() . '"'; |
204 | 204 | } else { |
— | — | @@ -229,14 +229,15 @@ |
230 | 230 | $this->serializeExpResource( $expResourceProperty, $expElement, $indent ); |
231 | 231 | } |
232 | 232 | if ( $isClassTypeProp ) { |
| 233 | + // FIXME: $expResource is undefined |
233 | 234 | $this->requireDeclaration( $expResource, SMW_SERIALIZER_DECL_CLASS ); |
234 | 235 | } |
235 | 236 | } |
236 | 237 | $this->post_ns_buffer .= "$indent</" . $expResourceProperty->getQName() . ">\n"; |
237 | 238 | } |
238 | | - |
| 239 | + |
239 | 240 | /** |
240 | | - * Escape a string in the special form that is required for values in |
| 241 | + * Escape a string in the special form that is required for values in |
241 | 242 | * DTD entity declarations in XML. Namely, this require the percent sign |
242 | 243 | * to be replaced. |
243 | 244 | * |
— | — | @@ -250,7 +251,7 @@ |
251 | 252 | /** |
252 | 253 | * Escape a string as required for using it in XML attribute values. |
253 | 254 | * |
254 | | - * @param $string string to be escaped |
| 255 | + * @param $string string to be escaped |
255 | 256 | * @return string |
256 | 257 | */ |
257 | 258 | protected function makeAttributeValueString( $string ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_Turtle.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | /** |
5 | 5 | * File holding the SMWTurtleSerializer class that provides basic functions for |
6 | | - * serialising OWL data in Turtle syntax. |
| 6 | + * serialising OWL data in Turtle syntax. |
7 | 7 | * |
8 | 8 | * @file SMW_Serializer.php |
9 | 9 | * @ingroup SMW |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Class for serializing exported data (encoded as SMWExpData object) in |
16 | | - * Turtle syntax. |
| 16 | + * Turtle syntax. |
17 | 17 | * |
18 | 18 | * @ingroup SMW |
19 | 19 | */ |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | // In this case, one can always use wiki:... followed by "_" and possibly some namespace, since _ is legal as a first character. |
90 | 90 | "@prefix wiki: <" . SMWExporter::expandURI( '&wiki;' ) . "> .\n" . |
91 | 91 | "@prefix property: <" . SMWExporter::expandURI( '&property;' ) . "> .\n" . |
92 | | - "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" . // note that this XSD URI is hardcoded below (its unlikely to change, of course) |
| 92 | + "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" . // note that this XSD URI is hardcoded below (its unlikely to change, of course) |
93 | 93 | "@prefix wikiurl: <" . SMWExporter::expandURI( '&wikiurl;' ) . "> .\n"; |
94 | 94 | } |
95 | 95 | $this->global_namespaces = array( 'rdf' => true, 'rdfs' => true, 'owl' => true, 'swivt' => true, 'wiki' => true, 'property' => true ); |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | $this->post_ns_buffer .= "\n# Created by Semantic MediaWiki, http://semantic-mediawiki.org/\n"; |
102 | 102 | } |
103 | 103 | } |
104 | | - |
| 104 | + |
105 | 105 | public function serializeDeclaration( $uri, $typename ) { |
106 | 106 | $this->post_ns_buffer .= "<" . SMWExporter::expandURI( $uri ) . "> rdf:type $typename .\n"; |
107 | 107 | } |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | } |
114 | 114 | $this->serializeNamespaces(); |
115 | 115 | } |
116 | | - |
| 116 | + |
117 | 117 | protected function serializeNamespace( $shortname, $uri ) { |
118 | 118 | $this->global_namespaces[$shortname] = true; |
119 | 119 | if ( $this->sparqlmode ) { |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | $bnode = true; |
143 | 143 | $this->post_ns_buffer .= "["; |
144 | 144 | } |
145 | | - |
| 145 | + |
146 | 146 | if ( ( $indent != '' ) && ( !$bnode ) ) { // called to generate a nested descripion; but Turtle cannot nest non-bnode descriptions, do this later |
147 | 147 | $this->subexpdata[] = $data; |
148 | 148 | return; |
— | — | @@ -165,7 +165,7 @@ |
166 | 166 | if ( $value instanceof SMWExpLiteral ) { |
167 | 167 | $prop_decl_type = SMW_SERIALIZER_DECL_APROP; |
168 | 168 | $this->serializeExpLiteral( $value ); |
169 | | - } elseif ( $value instanceof SMWExpResource ) { |
| 169 | + } elseif ( $value instanceof SMWExpResource ) { |
170 | 170 | $prop_decl_type = SMW_SERIALIZER_DECL_OPROP; |
171 | 171 | $this->serializeExpResource( $value ); |
172 | 172 | } elseif ( $value instanceof SMWExpData ) { // resource (maybe blank node), could have subdescriptions |
— | — | @@ -182,6 +182,7 @@ |
183 | 183 | $this->post_ns_buffer .= " )"; |
184 | 184 | } else { |
185 | 185 | if ( $class_type_prop ) { |
| 186 | + // FIXME: $object is undefined |
186 | 187 | $this->requireDeclaration( $object, SMW_SERIALIZER_DECL_CLASS ); |
187 | 188 | } |
188 | 189 | if ( count( $value->getProperties() ) > 0 ) { // resource with data: serialise |
— | — | @@ -201,11 +202,11 @@ |
202 | 203 | } |
203 | 204 | $this->post_ns_buffer .= ( $bnode ? " ]" : " ." ) . ( $indent == '' ? "\n\n" : '' ); |
204 | 205 | } |
205 | | - |
| 206 | + |
206 | 207 | protected function serializeExpLiteral( SMWExpLiteral $element ) { |
207 | 208 | $this->post_ns_buffer .= self::getTurtleNameForExpElement( $element ); |
208 | 209 | } |
209 | | - |
| 210 | + |
210 | 211 | protected function serializeExpResource( SMWExpResource $element ) { |
211 | 212 | if ( $element instanceof SMWExpNsResource ) { |
212 | 213 | $this->requireNamespace( $element->getNamespaceID(), $element->getNamespace() ); |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Types.php |
— | — | @@ -81,8 +81,8 @@ |
82 | 82 | * @return boolean |
83 | 83 | */ |
84 | 84 | protected function loadDataItem( SMWDataItem $dataItem ) { |
85 | | - if ( ( $dataItem instanceof SMWDIUri ) && ( $dataItem->getScheme() == 'http' ) && |
86 | | - ( $dataItem->getHierpart() == '//semantic-mediawiki.org/swivt/1.0' ) && |
| 85 | + if ( ( $dataItem instanceof SMWDIUri ) && ( $dataItem->getScheme() == 'http' ) && |
| 86 | + ( $dataItem->getHierpart() == '//semantic-mediawiki.org/swivt/1.0' ) && |
87 | 87 | ( $dataItem->getQuery() == '' ) ) { |
88 | 88 | $this->m_isAlias = false; |
89 | 89 | $this->m_typeId = $dataItem->getFragment(); |
— | — | @@ -106,12 +106,12 @@ |
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | | - public function getShortHTMLText( $linker = null ) { |
| 110 | + public function getShortHTMLText( $linked = null ) { |
111 | 111 | if ( ( $linked === null ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $this->m_caption == '' ) ) { |
112 | 112 | return htmlspecialchars( $this->m_caption ); |
113 | 113 | } else { |
114 | 114 | $title = Title::makeTitle( NS_SPECIAL, $this->getSpecialPageTitleText() ); |
115 | | - return $linker->makeLinkObj( $title, htmlspecialchars( $this->m_caption ) ); |
| 115 | + return $linked->makeLinkObj( $title, htmlspecialchars( $this->m_caption ) ); |
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
— | — | @@ -134,15 +134,15 @@ |
135 | 135 | return $linker->makeLinkObj( $title, htmlspecialchars( $this->m_realLabel ) ); |
136 | 136 | } |
137 | 137 | } |
138 | | - |
| 138 | + |
139 | 139 | /** |
140 | 140 | * Gets the title text for the types special page. |
141 | 141 | * Takes care of compatibility changes in MW 1.17 and 1.18. |
142 | 142 | * 1.17 introduces SpecialPageFactory |
143 | 143 | * 1.18 deprecates SpecialPage::getLocalNameFor |
144 | | - * |
| 144 | + * |
145 | 145 | * @since 1.6 |
146 | | - * |
| 146 | + * |
147 | 147 | * @return string |
148 | 148 | */ |
149 | 149 | protected function getSpecialPageTitleText() { |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | |
163 | 163 | /** |
164 | 164 | * This class uses type ids as DB keys. |
165 | | - * |
| 165 | + * |
166 | 166 | * @return string |
167 | 167 | */ |
168 | 168 | public function getDBkey() { |
— | — | @@ -181,7 +181,7 @@ |
182 | 182 | /** |
183 | 183 | * Is this an alias for another datatype in SMW? This information is used to |
184 | 184 | * explain entries in Special:Types that are found since they have pages. |
185 | | - * |
| 185 | + * |
186 | 186 | * @return boolean |
187 | 187 | */ |
188 | 188 | public function isAlias() { |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryParser.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | protected $m_categoryprefix; // cache label of category namespace . ':' |
24 | 24 | protected $m_conceptprefix; // cache label of concept namespace . ':' |
25 | 25 | protected $m_categoryPrefixCannonical; // cache canonnical label of category namespace . ':' |
26 | | - protected $m_conceptPrefixCannonical; // cache canonnical label of concept namespace . ':' |
| 26 | + protected $m_conceptPrefixCannonical; // cache canonnical label of concept namespace . ':' |
27 | 27 | protected $m_queryfeatures; // query features to be supported, format similar to $smwgQFeatures |
28 | 28 | |
29 | 29 | public function __construct( $queryfeatures = false ) { |
— | — | @@ -31,8 +31,8 @@ |
32 | 32 | $this->m_categoryprefix = $wgContLang->getNsText( NS_CATEGORY ) . ':'; |
33 | 33 | $this->m_conceptprefix = $wgContLang->getNsText( SMW_NS_CONCEPT ) . ':'; |
34 | 34 | $this->m_categoryPrefixCannonical = 'Category:'; |
35 | | - $this->m_conceptPrefixCannonical = 'Concept:'; |
36 | | - |
| 35 | + $this->m_conceptPrefixCannonical = 'Concept:'; |
| 36 | + |
37 | 37 | $this->m_defaultns = null; |
38 | 38 | $this->m_queryfeatures = $queryfeatures === false ? $smwgQFeatures : $queryfeatures; |
39 | 39 | } |
— | — | @@ -305,6 +305,7 @@ |
306 | 306 | |
307 | 307 | foreach ( $propertynames as $name ) { |
308 | 308 | if ( $typeid != '_wpg' ) { // non-final property in chain was no wikipage: not allowed |
| 309 | + // FIXME: $prevname is undefined |
309 | 310 | $this->m_errors[] = wfMsgForContent( 'smw_valuesubquery', $prevname ); |
310 | 311 | return null; ///TODO: read some more chunks and try to finish [[ ]] |
311 | 312 | } |
— | — | @@ -432,7 +433,7 @@ |
433 | 434 | } |
434 | 435 | if ( ( count( $list ) == 2 ) && ( $list[1] == '+' ) ) { // try namespace restriction |
435 | 436 | global $wgContLang; |
436 | | - |
| 437 | + |
437 | 438 | $idx = $wgContLang->getNsIndex( str_replace( ' ', '_', $list[0] ) ); |
438 | 439 | |
439 | 440 | if ( $idx !== false ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase.php |
— | — | @@ -1,17 +1,17 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | * Base classes for SMW's binding to SPARQL stores. |
5 | | - * |
| 5 | + * |
6 | 6 | * @file |
7 | 7 | * @ingroup SMWSparql |
8 | | - * |
| 8 | + * |
9 | 9 | * @author Markus Krötzsch |
10 | 10 | */ |
11 | 11 | |
12 | 12 | /** |
13 | 13 | * This group contains all parts of SMW that relate to communication with |
14 | 14 | * storage backends and clients via SPARQL. |
15 | | - * |
| 15 | + * |
16 | 16 | * @defgroup SMWSparql SWMSparql |
17 | 17 | * @ingroup SMW |
18 | 18 | */ |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | * @var integer |
52 | 52 | */ |
53 | 53 | public $errorCode; |
54 | | - |
| 54 | + |
55 | 55 | /** |
56 | 56 | * Constructor that creates an error message based on the given data. |
57 | 57 | * |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | $message = "A SPARQL query error has occurred\n" . |
85 | 85 | "Query: $queryText\n" . |
86 | 86 | "Error: $errorName\n" . |
87 | | - "Endpoint: $endpoint\n" . |
| 87 | + "Endpoint: $endpoint\n" . |
88 | 88 | "HTTP response code: $httpCode\n"; |
89 | 89 | |
90 | 90 | parent::__construct( $message ); |
— | — | @@ -95,9 +95,9 @@ |
96 | 96 | |
97 | 97 | /** |
98 | 98 | * Basic database connector for exchanging data via SPARQL. |
99 | | - * |
| 99 | + * |
100 | 100 | * @ingroup SMWSparql |
101 | | - * |
| 101 | + * |
102 | 102 | * @author Markus Krötzsch |
103 | 103 | */ |
104 | 104 | class SMWSparqlDatabase { |
— | — | @@ -323,7 +323,7 @@ |
324 | 324 | * in SMW to delete subobjects with all their data. Some RDF stores fail |
325 | 325 | * on complex delete queries, hence a wrapper function is provided to |
326 | 326 | * allow more pedestrian implementations. |
327 | | - * |
| 327 | + * |
328 | 328 | * The function declares the standard namespaces wiki, swivt, rdf, owl, |
329 | 329 | * rdfs, property, xsd, so these do not have to be included in |
330 | 330 | * $extraNamespaces. |
— | — | @@ -430,6 +430,7 @@ |
431 | 431 | */ |
432 | 432 | public function doUpdate( $sparql ) { |
433 | 433 | if ( $this->m_updateEndpoint == '' ) { |
| 434 | + // FIXME: $error is undefined |
434 | 435 | throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, $sparql, 'not specified', $error ); |
435 | 436 | } |
436 | 437 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_updateEndpoint ); |
— | — | @@ -454,7 +455,7 @@ |
455 | 456 | * SMWSparqlDatabase::throwSparqlErrors(). If errors occur and this |
456 | 457 | * method does not throw anything, then an empty result with an error |
457 | 458 | * code is returned. |
458 | | - * |
| 459 | + * |
459 | 460 | * @note This method has not been tesetd sufficiently since 4Store uses |
460 | 461 | * another post encoding. To avoid using it, simply do not provide a |
461 | 462 | * data endpoint URL when configuring the SPARQL database. |
— | — | @@ -464,6 +465,7 @@ |
465 | 466 | */ |
466 | 467 | public function doHttpPost( $payload ) { |
467 | 468 | if ( $this->m_dataEndpoint == '' ) { |
| 469 | + // FIXME: $error is undefined |
468 | 470 | throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, "SPARQL POST with data: $payload", 'not specified', $error ); |
469 | 471 | } |
470 | 472 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_dataEndpoint ); |
— | — | @@ -472,9 +474,9 @@ |
473 | 475 | // POST as file (fails in 4Store) |
474 | 476 | $payloadFile = tmpfile(); |
475 | 477 | fwrite( $payloadFile, $payload ); |
476 | | - fseek( $payloadFile, 0 ); |
| 478 | + fseek( $payloadFile, 0 ); |
477 | 479 | curl_setopt( $this->m_curlhandle, CURLOPT_INFILE, $payloadFile ); |
478 | | - curl_setopt( $this->m_curlhandle, CURLOPT_INFILESIZE, strlen( $payload ) ); |
| 480 | + curl_setopt( $this->m_curlhandle, CURLOPT_INFILESIZE, strlen( $payload ) ); |
479 | 481 | curl_setopt( $this->m_curlhandle, CURLOPT_HTTPHEADER, array( 'Content-Type: application/x-turtle' ) ); |
480 | 482 | |
481 | 483 | curl_exec( $this->m_curlhandle ); |
Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase4Store.php |
— | — | @@ -1,19 +1,19 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | * 4Store specific adjustments for SMWSparqlDatabase |
5 | | - * |
| 5 | + * |
6 | 6 | * @file |
7 | 7 | * @ingroup SMWSparql |
8 | | - * |
| 8 | + * |
9 | 9 | * @author Markus Krötzsch |
10 | 10 | */ |
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Specific modifications of the SPARQL database implementation for 4Store. |
14 | | - * |
| 14 | + * |
15 | 15 | * @since 1.6 |
16 | 16 | * @ingroup SMWSparql |
17 | | - * |
| 17 | + * |
18 | 18 | * @author Markus Krötzsch |
19 | 19 | */ |
20 | 20 | class SMWSparqlDatabase4Store extends SMWSparqlDatabase { |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | * SMWSparqlDatabase::throwSparqlErrors(). If errors occur and this |
90 | 90 | * method does not throw anything, then an empty result with an error |
91 | 91 | * code is returned. |
92 | | - * |
| 92 | + * |
93 | 93 | * This method is specific to 4Store since it uses POST parameters that |
94 | 94 | * are not given in the specification. |
95 | 95 | * |
— | — | @@ -97,6 +97,7 @@ |
98 | 98 | */ |
99 | 99 | public function doHttpPost( $payload ) { |
100 | 100 | if ( $this->m_dataEndpoint == '' ) { |
| 101 | + // FIXME: $error is undefined |
101 | 102 | throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, "SPARQL POST with data: $payload", 'not specified', $error ); |
102 | 103 | } |
103 | 104 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_dataEndpoint ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | | - * Represents a condition that matches everything. Weak conditions (see |
| 102 | + * Represents a condition that matches everything. Weak conditions (see |
103 | 103 | * SMWSparqlCondition::$weakConditions) might be still be included to |
104 | 104 | * enable ordering (selecting sufficient data to order by). |
105 | 105 | * |
— | — | @@ -544,8 +544,8 @@ |
545 | 545 | if ( $matchElement instanceof SMWExpNsResource ) { |
546 | 546 | $namespaces[$matchElement->getNamespaceId()] = $matchElement->getNamespace(); |
547 | 547 | } |
548 | | - |
549 | | - if ( ( $singletonMatchElement !== null ) && |
| 548 | + // FIXME: $singletonMatchElementName is undefined |
| 549 | + if ( ( $singletonMatchElement !== null ) && |
550 | 550 | ( $singletonMatchElementName !== $matchElementName ) ) { |
551 | 551 | return new SMWSparqlFalseCondition(); |
552 | 552 | } |
— | — | @@ -669,7 +669,7 @@ |
670 | 670 | if ( array_key_exists( $diProperty->getKey(), $this->m_sortkeys ) ) { |
671 | 671 | $innerOrderByProperty = $diProperty; |
672 | 672 | } else { |
673 | | - $innerOrderByProperty = null; |
| 673 | + $innerOrderByProperty = null; |
674 | 674 | } |
675 | 675 | |
676 | 676 | //*** Prepare inner condition ***// |
— | — | @@ -799,7 +799,7 @@ |
800 | 800 | case SMW_CMP_LESS: $comparator = '<'; break; |
801 | 801 | case SMW_CMP_GRTR: $comparator = '>'; break; |
802 | 802 | case SMW_CMP_LEQ: $comparator = '<='; break; |
803 | | - case SMW_CMP_GEQ: $comparator = '>='; break; |
| 803 | + case SMW_CMP_GEQ: $comparator = '>='; break; |
804 | 804 | case SMW_CMP_NEQ: $comparator = '!='; break; |
805 | 805 | case SMW_CMP_LIKE: $comparator = 'regex'; break; |
806 | 806 | case SMW_CMP_NLKE: $comparator = '!regex'; break; |
— | — | @@ -822,7 +822,7 @@ |
823 | 823 | $dataItem->getString() ) . '$'; |
824 | 824 | $result = new SMWSparqlFilterCondition( "$comparator( ?$joinVariable, \"$pattern\", \"s\")", array() ); |
825 | 825 | $this->addOrderByDataForProperty( $result, $joinVariable, $orderByProperty, $dataItem->getDIType() ); |
826 | | - } else { |
| 826 | + } else { |
827 | 827 | $result = $this->buildTrueCondition( $joinVariable, $orderByProperty ); |
828 | 828 | } |
829 | 829 | } else { |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php |
— | — | @@ -1,10 +1,10 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | * Basic abstract classes for SMW's storage abstraction layer. |
5 | | - * |
| 5 | + * |
6 | 6 | * @file |
7 | 7 | * @ingroup SMWStore |
8 | | - * |
| 8 | + * |
9 | 9 | * @author Markus Krötzsch |
10 | 10 | */ |
11 | 11 | |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | * This group contains all parts of SMW that relate to storing and retrieving |
14 | 14 | * semantic data. SMW components that relate to semantic querying only have |
15 | 15 | * their own group. |
16 | | - * |
| 16 | + * |
17 | 17 | * @defgroup SMWStore SMWStore |
18 | 18 | * @ingroup SMW |
19 | 19 | */ |
— | — | @@ -21,9 +21,9 @@ |
22 | 22 | * Small data container class for describing filtering conditions on the string |
23 | 23 | * label of some entity. States that a given string should either be prefix, |
24 | 24 | * postfix, or some arbitrary part of labels. |
25 | | - * |
| 25 | + * |
26 | 26 | * @ingroup SMWStore |
27 | | - * |
| 27 | + * |
28 | 28 | * @author Markus Krötzsch |
29 | 29 | */ |
30 | 30 | class SMWStringCondition { |
— | — | @@ -56,9 +56,9 @@ |
57 | 57 | * to their more complex structure. |
58 | 58 | * Options that should not be used or where default values should be used |
59 | 59 | * can be left as initialised. |
60 | | - * |
| 60 | + * |
61 | 61 | * @ingroup SMWStore |
62 | | - * |
| 62 | + * |
63 | 63 | * @author Markus Krötzsch |
64 | 64 | */ |
65 | 65 | class SMWRequestOptions { |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | |
112 | 112 | /** |
113 | 113 | * Set a new string condition applied to labels of results (if available). |
114 | | - * |
| 114 | + * |
115 | 115 | * @param $string string to match |
116 | 116 | * @param $condition integer type of condition, one of STRCOND_PRE, STRCOND_POST, STRCOND_MID |
117 | 117 | */ |
— | — | @@ -133,10 +133,10 @@ |
134 | 134 | * semantic store. Besides the relevant interface, this class provides default |
135 | 135 | * implementations for some optional methods, which inform the caller that |
136 | 136 | * these methods are not implemented. |
137 | | - * |
| 137 | + * |
138 | 138 | * @ingroup SMWStore |
139 | | - * |
140 | | - * @author Markus Krötzsch |
| 139 | + * |
| 140 | + * @author Markus Krötzsch |
141 | 141 | */ |
142 | 142 | abstract class SMWStore { |
143 | 143 | |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | /** |
189 | 189 | * Get an array of all properties for which the given subject has some |
190 | 190 | * value. The result is an array of SMWDIProperty objects. |
191 | | - * |
| 191 | + * |
192 | 192 | * @param $subject SMWDIWikiPage denoting the subject |
193 | 193 | * @param $requestoptions SMWRequestOptions optionally defining further options |
194 | 194 | */ |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | */ |
215 | 215 | public function getWikiPageSortKey( SMWDIWikiPage $wikiPage ) { |
216 | 216 | $sortkeyDataItems = $this->getPropertyValues( $wikiPage, new SMWDIProperty( '_SKEY' ) ); |
217 | | - |
| 217 | + |
218 | 218 | if ( count( $sortkeyDataItems ) > 0 ) { |
219 | 219 | return end( $sortkeyDataItems )->getString(); |
220 | 220 | } else { |
— | — | @@ -241,7 +241,7 @@ |
242 | 242 | throw new InvalidArgumentException( 'SMWStore::getRedirectTarget() expects an object of type SMWDIProperty or SMWDIWikiPage.' ); |
243 | 243 | } |
244 | 244 | |
245 | | - $redirectDataItems = $this->getPropertyValues( $wikiPage, new SMWDIProperty( '_REDI' ) ); |
| 245 | + $redirectDataItems = $this->getPropertyValues( $wikipage, new SMWDIProperty( '_REDI' ) ); |
246 | 246 | if ( count( $redirectDataItems ) > 0 ) { |
247 | 247 | if ( $dataItem->getDIType() == SMWDataItem::TYPE_PROPERTY ) { |
248 | 248 | return new SMWDIProperty( end( $redirectDataItems )->getDBkey() ); |
— | — | @@ -280,7 +280,7 @@ |
281 | 281 | * for one particular subject. |
282 | 282 | * |
283 | 283 | * @param $data SMWSemanticData |
284 | | - */ |
| 284 | + */ |
285 | 285 | public function updateData( SMWSemanticData $data ) { |
286 | 286 | wfRunHooks( 'SMWStore::updateDataBefore', array( $this, $data ) ); |
287 | 287 | |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | |
309 | 309 | /** |
310 | 310 | * Clear all semantic data specified for some page. |
311 | | - * |
| 311 | + * |
312 | 312 | * @param SMWDIWikiPage $di |
313 | 313 | */ |
314 | 314 | public function clearData( SMWDIWikiPage $di ) { |
— | — | @@ -348,9 +348,9 @@ |
349 | 349 | * result is an array of arrays, each containing a property title and a |
350 | 350 | * count. The expected order is alphabetical w.r.t. to property title |
351 | 351 | * texts. |
352 | | - * |
| 352 | + * |
353 | 353 | * @param SMWRequestOptions $requestoptions |
354 | | - * |
| 354 | + * |
355 | 355 | * @return array |
356 | 356 | */ |
357 | 357 | public abstract function getPropertiesSpecial( $requestoptions = null ); |
— | — | @@ -360,9 +360,9 @@ |
361 | 361 | * are not used on any page. Stores might restrict here to those |
362 | 362 | * properties that have been given a type if they have no efficient |
363 | 363 | * means of accessing the set of all pages in the property namespace. |
364 | | - * |
| 364 | + * |
365 | 365 | * @param SMWRequestOptions $requestoptions |
366 | | - * |
| 366 | + * |
367 | 367 | * @return array of SMWDIProperty |
368 | 368 | */ |
369 | 369 | public abstract function getUnusedPropertiesSpecial( $requestoptions = null ); |
— | — | @@ -372,9 +372,9 @@ |
373 | 373 | * have any page describing them. Stores that have no efficient way of |
374 | 374 | * accessing the set of all existing pages can extend this list to all |
375 | 375 | * properties that are used but do not have a type assigned to them. |
376 | | - * |
| 376 | + * |
377 | 377 | * @param SMWRequestOptions $requestoptions |
378 | | - * |
| 378 | + * |
379 | 379 | * @return array of array( SMWDIProperty, int ) |
380 | 380 | */ |
381 | 381 | public abstract function getWantedPropertiesSpecial( $requestoptions = null ); |
— | — | @@ -385,7 +385,7 @@ |
386 | 386 | * - 'PROPUSES': Number of property instances (value assignments) in the datatbase |
387 | 387 | * - 'USEDPROPS': Number of properties that are used with at least one value |
388 | 388 | * - 'DECLPROPS': Number of properties that have been declared (i.e. assigned a type) |
389 | | - * |
| 389 | + * |
390 | 390 | * @return array |
391 | 391 | */ |
392 | 392 | public abstract function getStatistics(); |
— | — | @@ -406,7 +406,7 @@ |
407 | 407 | * timeouts during long operations. All output must be valid in an HTML |
408 | 408 | * context, but should preferrably be plain text, possibly with some |
409 | 409 | * linebreaks and weak markup. |
410 | | - * |
| 410 | + * |
411 | 411 | * @param boolean $verbose |
412 | 412 | */ |
413 | 413 | public abstract function setup( $verbose = true ); |
— | — | @@ -414,7 +414,7 @@ |
415 | 415 | /** |
416 | 416 | * Drop (delete) all storage structures created by setup(). This will |
417 | 417 | * delete all semantic data and possibly leave the wiki uninitialised. |
418 | | - * |
| 418 | + * |
419 | 419 | * @param boolean $verbose |
420 | 420 | */ |
421 | 421 | public abstract function drop( $verbose = true ); |
— | — | @@ -438,12 +438,12 @@ |
439 | 439 | * The optional parameter $usejobs indicates whether updates should be |
440 | 440 | * processed later using MediaWiki jobs, instead of doing all updates |
441 | 441 | * immediately. The default is TRUE. |
442 | | - * |
| 442 | + * |
443 | 443 | * @param $index integer |
444 | 444 | * @param $count integer |
445 | 445 | * @param $namespaces mixed array or false |
446 | 446 | * @param $usejobs boolean |
447 | | - * |
| 447 | + * |
448 | 448 | * @return decimal between 0 and 1 to indicate the overall progress of the refreshing |
449 | 449 | */ |
450 | 450 | public abstract function refreshData( &$index, $count, $namespaces = false, $usejobs = true ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SqlStore2IdCache.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | /** |
15 | 15 | * An in-memory cache for managing object ids in SMWSQLStore2. |
16 | | - * |
| 16 | + * |
17 | 17 | * @since 1.6 |
18 | 18 | * |
19 | 19 | * @ingroup SMWStore |
— | — | @@ -48,6 +48,7 @@ |
49 | 49 | $this->m_data[$hashKey] = $row->smw_id; |
50 | 50 | return $row->smw_id; |
51 | 51 | } else { |
| 52 | + // FIXME: $index is undefined |
52 | 53 | $index->data[$hashKey] = 0; |
53 | 54 | return 0; |
54 | 55 | } |