Index: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SCQ_QueryResult.php |
— | — | @@ -0,0 +1,35 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +if ( !defined( 'MEDIAWIKI' ) ) die(); |
| 5 | + |
| 6 | +/** |
| 7 | + * Subclass of SMWQueryResult - this class was mostly created in order to |
| 8 | + * get around an inconvenient print-request-compatibility check in |
| 9 | + * SMWQueryResult::addRow() |
| 10 | + * |
| 11 | + * @ingroup SemanticCompoundQueries |
| 12 | + * @author Yaron Koren |
| 13 | + */ |
| 14 | +class SCQQueryResult extends SMWQueryResult { |
| 15 | + |
| 16 | + function addResult( $new_result ) { |
| 17 | + // create an array of the pages already in this query result, |
| 18 | + // so that we can check against it to make sure that pages |
| 19 | + // aren't included twice |
| 20 | + $existing_page_names = array(); |
| 21 | + while ( $row = $this->getNext() ) { |
| 22 | + if ( $row[0] instanceof SMWResultArray ) { |
| 23 | + $content = $row[0]->getContent(); |
| 24 | + $existing_page_names[] = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
| 25 | + } |
| 26 | + } |
| 27 | + while ( ( $row = $new_result->getNext() ) !== false ) { |
| 28 | + $row[0]->display_options = $new_result->display_options; |
| 29 | + $content = $row[0]->getContent(); |
| 30 | + $page_name = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
| 31 | + if ( ! in_array( $page_name, $existing_page_names ) ) |
| 32 | + $this->m_content[] = $row; |
| 33 | + } |
| 34 | + reset( $this->m_content ); |
| 35 | + } |
| 36 | +} |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SCQ_QueryResult.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 37 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SCQ_QueryProcessor.php |
— | — | @@ -0,0 +1,171 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +if ( !defined( 'MEDIAWIKI' ) ) die(); |
| 5 | + |
| 6 | +/** |
| 7 | + * Class that holds static functions for handling compound queries. |
| 8 | + * This class is heavily based on Semantic MediaWiki's SMWQueryProcessor, |
| 9 | + * and calls that class's functions when possible. |
| 10 | + * |
| 11 | + * @ingroup SemanticCompoundQueries |
| 12 | + * @author Yaron Koren |
| 13 | + */ |
| 14 | +class SCQQueryProcessor { |
| 15 | + |
| 16 | + /** |
| 17 | + * An alternative to explode() - that function won't work here, |
| 18 | + * because we don't want to split the string on all semicolons, just |
| 19 | + * the ones that aren't contained within square brackets |
| 20 | + */ |
| 21 | + public static function getSubParams( $param ) { |
| 22 | + $sub_params = array(); |
| 23 | + $sub_param = ""; |
| 24 | + $uncompleted_square_brackets = 0; |
| 25 | + for ( $i = 0; $i < strlen( $param ); $i++ ) { |
| 26 | + $c = $param[$i]; |
| 27 | + if ( ( $c == ';' ) && ( $uncompleted_square_brackets <= 0 ) ) { |
| 28 | + $sub_params[] = $sub_param; |
| 29 | + $sub_param = ""; |
| 30 | + } else { |
| 31 | + $sub_param .= $c; |
| 32 | + if ( $c == '[' ) |
| 33 | + $uncompleted_square_brackets++; |
| 34 | + elseif ( $c == ']' ) |
| 35 | + $uncompleted_square_brackets--; |
| 36 | + } |
| 37 | + } |
| 38 | + $sub_params[] = $sub_param; |
| 39 | + return $sub_params; |
| 40 | + } |
| 41 | + |
| 42 | + /** |
| 43 | + */ |
| 44 | + public static function doCompoundQuery( &$parser ) { |
| 45 | + global $smwgQEnabled, $smwgIQRunningNumber; |
| 46 | + if ( $smwgQEnabled ) { |
| 47 | + $smwgIQRunningNumber++; |
| 48 | + $params = func_get_args(); |
| 49 | + array_shift( $params ); // we already know the $parser ... |
| 50 | + $other_params = array(); |
| 51 | + $query_result = null; |
| 52 | + $results = array(); |
| 53 | + foreach ( $params as $param ) { |
| 54 | + // very primitive heuristic - if the parameter |
| 55 | + // includes a square bracket, then it's a |
| 56 | + // sub-query; otherwise it's a regular parameter |
| 57 | + if ( strpos( $param, '[' ) !== false ) { |
| 58 | + $sub_params = SCQQueryProcessor::getSubParams( $param ); |
| 59 | + $next_result = SCQQueryProcessor::getQueryResultFromFunctionParams( $sub_params, SMW_OUTPUT_WIKI ); |
| 60 | + if (method_exists($next_result, 'getResults')) { // SMW 1.5+ |
| 61 | + $results = array_merge($results, $next_result->getResults()); |
| 62 | + } else { |
| 63 | + if ( $query_result == null ) |
| 64 | + $query_result = new SCQQueryResult( $next_result->getPrintRequests(), new SMWQuery() ); |
| 65 | + $query_result->addResult( $next_result ); |
| 66 | + } |
| 67 | + } else { |
| 68 | + $parts = explode( '=', $param, 2 ); |
| 69 | + if ( count( $parts ) >= 2 ) { |
| 70 | + $other_params[strtolower( trim( $parts[0] ) )] = $parts[1]; // don't trim here, some params care for " " |
| 71 | + } |
| 72 | + } |
| 73 | + } |
| 74 | + if ( is_null($query_result) ) // SMW 1.5+ |
| 75 | + $query_result = new SCQQueryResult( $next_result->getPrintRequests(), new SMWQuery(), $results, smwfGetStore() ); |
| 76 | + $result = SCQQueryProcessor::getResultFromQueryResult( $query_result, $other_params, null, SMW_OUTPUT_WIKI ); |
| 77 | + } else { |
| 78 | + wfLoadExtensionMessages( 'SemanticMediaWiki' ); |
| 79 | + $result = smwfEncodeMessages( array( wfMsgForContent( 'smw_iq_disabled' ) ) ); |
| 80 | + } |
| 81 | + return $result; |
| 82 | + } |
| 83 | + |
| 84 | + static function getQueryResultFromFunctionParams( $rawparams, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $showmode = false ) { |
| 85 | + SMWQueryProcessor::processFunctionParams( $rawparams, $querystring, $params, $printouts, $showmode ); |
| 86 | + return SCQQueryProcessor::getQueryResultFromQueryString( $querystring, $params, $printouts, SMW_OUTPUT_WIKI, $context ); |
| 87 | + } |
| 88 | + |
| 89 | + /** |
| 90 | + * Combine the values from two SMWQueryResult objects into one |
| 91 | + */ |
| 92 | + static function mergeSMWQueryResults( $result1, $result2 ) { |
| 93 | + if ( $result1 == null ) { |
| 94 | + $result1 = new SMWQueryResult( $result2->getPrintRequests(), new SMWQuery() ); |
| 95 | + } |
| 96 | + $existing_page_names = array(); |
| 97 | + while ( $row = $result1->getNext() ) { |
| 98 | + if ( $row[0] instanceof SMWResultArray ) { |
| 99 | + $content = $row[0]->getContent(); |
| 100 | + $existing_page_names[] = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
| 101 | + } |
| 102 | + } |
| 103 | + while ( ( $row = $result2->getNext() ) !== false ) { |
| 104 | + $row[0]->display_options = $result2->display_options; |
| 105 | + $content = $row[0]->getContent(); |
| 106 | + $page_name = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
| 107 | + if ( ! in_array( $page_name, $existing_page_names ) ) |
| 108 | + $result1->addRow( $row ); |
| 109 | + } |
| 110 | + return $result1; |
| 111 | + } |
| 112 | + |
| 113 | + // this method is an exact copy of SMWQueryProcessor's function, |
| 114 | + // but it needs to be duplicated because there it's protected |
| 115 | + static function getResultFormat( $params ) { |
| 116 | + $format = 'auto'; |
| 117 | + if ( array_key_exists( 'format', $params ) ) { |
| 118 | + $format = strtolower( trim( $params['format'] ) ); |
| 119 | + global $smwgResultFormats; |
| 120 | + if ( !array_key_exists( $format, $smwgResultFormats ) ) { |
| 121 | + $format = 'auto'; // If it is an unknown format, defaults to list/table again |
| 122 | + } |
| 123 | + } |
| 124 | + return $format; |
| 125 | + } |
| 126 | + |
| 127 | + static function getQueryResultFromQueryString( $querystring, $params, $extraprintouts, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY ) { |
| 128 | + wfProfileIn( 'SCQQueryProcessor::getQueryResultFromQueryString' ); |
| 129 | + $query = SMWQueryProcessor::createQuery( $querystring, $params, $context, null, $extraprintouts ); |
| 130 | + $query_result = smwfGetStore()->getQueryResult( $query ); |
| 131 | + $display_options = array(); |
| 132 | + foreach ( $params as $key => $value ) { |
| 133 | + // special handling for 'icon' field, since it requires |
| 134 | + // conversion of a name to a URL |
| 135 | + if ( $key == 'icon' ) { |
| 136 | + $icon_title = Title::newFromText( $value ); |
| 137 | + $icon_image_page = new ImagePage( $icon_title ); |
| 138 | + // method was only added in MW 1.13 |
| 139 | + if ( method_exists( 'ImagePage', 'getDisplayedFile' ) ) { |
| 140 | + $icon_url = $icon_image_page->getDisplayedFile()->getURL(); |
| 141 | + $display_options['icon'] = $icon_url; |
| 142 | + } |
| 143 | + } else { |
| 144 | + $display_options[$key] = $value; |
| 145 | + } |
| 146 | + if ( method_exists($query_result, 'getResults') ) { // SMW 1.5+ |
| 147 | + foreach ($query_result->getResults() as $wiki_page) { |
| 148 | + $wiki_page->display_options = $display_options; |
| 149 | + } |
| 150 | + } else { |
| 151 | + $query_result->display_options = $display_options; |
| 152 | + } |
| 153 | + } |
| 154 | + |
| 155 | + wfProfileOut( 'SCQQueryProcessor::getQueryResultFromQueryString' ); |
| 156 | + return $query_result; |
| 157 | + } |
| 158 | + |
| 159 | + /* |
| 160 | + * Matches getResultFromQueryResult() from SMWQueryProcessor, |
| 161 | + * except that formats of type 'debug' and 'count' aren't handled |
| 162 | + */ |
| 163 | + static function getResultFromQueryResult( $res, $params, $extraprintouts, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $format = '' ) { |
| 164 | + wfProfileIn( 'SCQQueryProcessor::getResultFromQueryResult' ); |
| 165 | + $format = SCQQueryProcessor::getResultFormat( $params ); |
| 166 | + $printer = SMWQueryProcessor::getResultPrinter( $format, $context, $res ); |
| 167 | + $result = $printer->getResult( $res, $params, $outputmode ); |
| 168 | + wfProfileOut( 'SCQQueryProcessor::getResultFromQueryResult' ); |
| 169 | + return $result; |
| 170 | + } |
| 171 | +} |
| 172 | + |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SCQ_QueryProcessor.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 173 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SemanticCompoundQueries.i18n.magic.php |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +$magicWords = array(); |
| 5 | + |
| 6 | +$magicWords['en'] = array( |
| 7 | + 'compound_query' => array( 0, 'compound_query' ), |
| 8 | +); |
| 9 | + |
| 10 | +$magicWords['ar'] = array( |
| 11 | + 'compound_query' => array( '0', 'استعلام_مركب', 'compound_query' ), |
| 12 | +); |
| 13 | + |
| 14 | +$magicWords['arz'] = array( |
| 15 | + 'compound_query' => array( '0', 'استعلام_مركب', 'compound_query' ), |
| 16 | +); |
| 17 | + |
| 18 | +$magicWords['nds-nl'] = array( |
| 19 | + 'compound_query' => array( '0', 'samen-estelde_zeukopdrach', 'samengestelde_zoekopdracht', 'compound_query' ), |
| 20 | +); |
| 21 | + |
| 22 | +$magicWords['nl'] = array( |
| 23 | + 'compound_query' => array( '0', 'samengestelde_zoekopdracht', 'compound_query' ), |
| 24 | +); |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SemanticCompoundQueries.i18n.magic.php |
___________________________________________________________________ |
Name: svn:keywords |
1 | 25 | + Id |
Name: svn:eol-style |
2 | 26 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SemanticCompoundQueries.i18n.php |
— | — | @@ -0,0 +1,281 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation file for SemanticCompoundQueries extension. |
| 5 | + * |
| 6 | + * @addtogroup Extensions |
| 7 | + */ |
| 8 | + |
| 9 | +// FIXME: Can be enabled when new style magic words are used (introduced in r52503) |
| 10 | +// require_once( dirname( __FILE__ ) . '/SemanticCompoundQueries.i18n.magic.php' ); |
| 11 | + |
| 12 | +$messages = array(); |
| 13 | + |
| 14 | +/** English |
| 15 | + * @author Yaron Koren |
| 16 | + */ |
| 17 | +$messages['en'] = array( |
| 18 | + 'semanticcompoundqueries-desc' => 'A parser function that displays multiple semantic queries at the same time', |
| 19 | +); |
| 20 | + |
| 21 | +/** Message documentation (Message documentation) |
| 22 | + * @author Fryed-peach |
| 23 | + * @author Purodha |
| 24 | + */ |
| 25 | +$messages['qqq'] = array( |
| 26 | + 'semanticcompoundqueries-desc' => '{{desc}}', |
| 27 | +); |
| 28 | + |
| 29 | +/** Arabic (العربية) |
| 30 | + * @author Meno25 |
| 31 | + */ |
| 32 | +$messages['ar'] = array( |
| 33 | + 'semanticcompoundqueries-desc' => 'دالة محلل تعرض استعلامات دلالية متعددة في نفس الوقت', |
| 34 | +); |
| 35 | + |
| 36 | +/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
| 37 | + * @author EugeneZelenko |
| 38 | + * @author Jim-by |
| 39 | + */ |
| 40 | +$messages['be-tarask'] = array( |
| 41 | + 'semanticcompoundqueries-desc' => 'Функцыя парсэра, якая паказвае шматлікія сэмантычныя запыты ў адзін час', |
| 42 | +); |
| 43 | + |
| 44 | +/** Breton (Brezhoneg) |
| 45 | + * @author Fulup |
| 46 | + */ |
| 47 | +$messages['br'] = array( |
| 48 | + 'semanticcompoundqueries-desc' => "Un arc'hwel eus ar parser a ziskwel meur a reked ereadurel war un dro", |
| 49 | +); |
| 50 | + |
| 51 | +/** Bosnian (Bosanski) |
| 52 | + * @author CERminator |
| 53 | + */ |
| 54 | +$messages['bs'] = array( |
| 55 | + 'semanticcompoundqueries-desc' => 'Parserska funkcija koja prikazuje više semantičkih upita u isto vrijeme', |
| 56 | +); |
| 57 | + |
| 58 | +/** German (Deutsch) |
| 59 | + * @author Purodha |
| 60 | + */ |
| 61 | +$messages['de'] = array( |
| 62 | + 'semanticcompoundqueries-desc' => 'Eine Parserfunktion, die mehrere semantische Abfragen zugleich anzuzeigen erlaubt', |
| 63 | +); |
| 64 | + |
| 65 | +/** Lower Sorbian (Dolnoserbski) |
| 66 | + * @author Michawiki |
| 67 | + */ |
| 68 | +$messages['dsb'] = array( |
| 69 | + 'semanticcompoundqueries-desc' => 'Parserowa funkcija, kótaraž rownocasnje zwobraznjujo někotare semantiske wótpšašanja', |
| 70 | +); |
| 71 | + |
| 72 | +/** Greek (Ελληνικά) |
| 73 | + * @author Omnipaedista |
| 74 | + */ |
| 75 | +$messages['el'] = array( |
| 76 | + 'semanticcompoundqueries-desc' => 'Μια λεξιαναλυτική συνάρτηση που προβάλλει πολλαπλά σημασιολογικά αιτήματα ταυτόχρονα', |
| 77 | +); |
| 78 | + |
| 79 | +/** Spanish (Español) |
| 80 | + * @author Crazymadlover |
| 81 | + */ |
| 82 | +$messages['es'] = array( |
| 83 | + 'semanticcompoundqueries-desc' => 'Una función analizadora que muestra múltiples consultas semánticas al mismo tiempo', |
| 84 | +); |
| 85 | + |
| 86 | +/** French (Français) |
| 87 | + * @author IAlex |
| 88 | + */ |
| 89 | +$messages['fr'] = array( |
| 90 | + 'semanticcompoundqueries-desc' => 'Une fonction du parseur qui affiche plusieurs requêtes sémantiques en même temps', |
| 91 | +); |
| 92 | + |
| 93 | +/** Galician (Galego) |
| 94 | + * @author Toliño |
| 95 | + */ |
| 96 | +$messages['gl'] = array( |
| 97 | + 'semanticcompoundqueries-desc' => 'Unha función analítica que mostra varias pescudas semánticas ao mesmo tempo', |
| 98 | +); |
| 99 | + |
| 100 | +/** Swiss German (Alemannisch) |
| 101 | + * @author Als-Holder |
| 102 | + */ |
| 103 | +$messages['gsw'] = array( |
| 104 | + 'semanticcompoundqueries-desc' => 'E Parserfunktion, wu erlaubt, mehreri semantischi Abfroge uf eimol aazzeige', |
| 105 | +); |
| 106 | + |
| 107 | +/** Hebrew (עברית) |
| 108 | + * @author Rotemliss |
| 109 | + */ |
| 110 | +$messages['he'] = array( |
| 111 | + 'semanticcompoundqueries-desc' => 'הוראת מפענח המציגה מספר שאילתות סמנטיות בעת ובעונה אחת', |
| 112 | +); |
| 113 | + |
| 114 | +/** Hiligaynon (Ilonggo) |
| 115 | + * @author Tagimata |
| 116 | + */ |
| 117 | +$messages['hil'] = array( |
| 118 | + 'semanticcompoundqueries-desc' => 'Ang parser panksiyon nga nagapakita sang multiple semantik pamangkotanon sa parehas nga tiyempo', |
| 119 | +); |
| 120 | + |
| 121 | +/** Upper Sorbian (Hornjoserbsce) |
| 122 | + * @author Michawiki |
| 123 | + */ |
| 124 | +$messages['hsb'] = array( |
| 125 | + 'semanticcompoundqueries-desc' => 'Parserowa funkcija, kotraž wjacore semantiske wotprašowanja nadobo zwobrazuje', |
| 126 | +); |
| 127 | + |
| 128 | +/** Hungarian (Magyar) |
| 129 | + * @author Glanthor Reviol |
| 130 | + */ |
| 131 | +$messages['hu'] = array( |
| 132 | + 'semanticcompoundqueries-desc' => 'Egyszerre több szemantikus lekérdezést megjelenítő elemzőfüggvény', |
| 133 | +); |
| 134 | + |
| 135 | +/** Interlingua (Interlingua) |
| 136 | + * @author McDutchie |
| 137 | + */ |
| 138 | +$messages['ia'] = array( |
| 139 | + 'semanticcompoundqueries-desc' => 'Un function syntactic que presenta plure consultas semantic al mesme tempore', |
| 140 | +); |
| 141 | + |
| 142 | +/** Indonesian (Bahasa Indonesia) |
| 143 | + * @author Bennylin |
| 144 | + */ |
| 145 | +$messages['id'] = array( |
| 146 | + 'semanticcompoundqueries-desc' => 'Fungsi parser untuk menampilkan beberapa kueri semantik secara bersamaan', |
| 147 | +); |
| 148 | + |
| 149 | +/** Italian (Italiano) |
| 150 | + * @author Gianfranco |
| 151 | + */ |
| 152 | +$messages['it'] = array( |
| 153 | + 'semanticcompoundqueries-desc' => 'Una funzione di parsing che mostra più query semantiche contemporaneamente', |
| 154 | +); |
| 155 | + |
| 156 | +/** Japanese (日本語) |
| 157 | + * @author Fryed-peach |
| 158 | + */ |
| 159 | +$messages['ja'] = array( |
| 160 | + 'semanticcompoundqueries-desc' => '複数の意味的クエリーを一度に表示するパーサー関数', |
| 161 | +); |
| 162 | + |
| 163 | +/** Ripoarisch (Ripoarisch) |
| 164 | + * @author Purodha |
| 165 | + */ |
| 166 | +$messages['ksh'] = array( |
| 167 | + 'semanticcompoundqueries-desc' => 'En Paaser_Funkßuhn öm ettlijje semantesche Froore op eijmohl aanzezeije.', |
| 168 | +); |
| 169 | + |
| 170 | +/** Luxembourgish (Lëtzebuergesch) |
| 171 | + * @author Robby |
| 172 | + */ |
| 173 | +$messages['lb'] = array( |
| 174 | + 'semanticcompoundqueries-desc' => 'Eng Parserfonctioun déi et erlaabt méi semantesch Ufroe mateneen ze weisen', |
| 175 | +); |
| 176 | + |
| 177 | +/** Macedonian (Македонски) |
| 178 | + * @author Bjankuloski06 |
| 179 | + */ |
| 180 | +$messages['mk'] = array( |
| 181 | + 'semanticcompoundqueries-desc' => 'Парсерска функција која прикажува повеќе семантички барања истовремено', |
| 182 | +); |
| 183 | + |
| 184 | +/** Dutch (Nederlands) |
| 185 | + * @author Siebrand |
| 186 | + */ |
| 187 | +$messages['nl'] = array( |
| 188 | + 'semanticcompoundqueries-desc' => 'Een parserfunctie die meerdere semantische zoekopdrachten op hetzelfde moment kan weergeven', |
| 189 | +); |
| 190 | + |
| 191 | +/** Norwegian (bokmål) (Norsk (bokmål)) |
| 192 | + * @author Nghtwlkr |
| 193 | + */ |
| 194 | +$messages['no'] = array( |
| 195 | + 'semanticcompoundqueries-desc' => 'En tolkefunksjon som viser flere semantiske spørringer samtidig', |
| 196 | +); |
| 197 | + |
| 198 | +/** Occitan (Occitan) |
| 199 | + * @author Cedric31 |
| 200 | + */ |
| 201 | +$messages['oc'] = array( |
| 202 | + 'semanticcompoundqueries-desc' => "Una foncion del parser qu'aficha mai d'una requèsta semanticas a l'encòp", |
| 203 | +); |
| 204 | + |
| 205 | +/** Polish (Polski) |
| 206 | + * @author Sp5uhe |
| 207 | + */ |
| 208 | +$messages['pl'] = array( |
| 209 | + 'semanticcompoundqueries-desc' => 'Funkcja parsera wyświetlająca różnorodne znaczeniowo zapytania w tym samym czasie', |
| 210 | +); |
| 211 | + |
| 212 | +/** Piedmontese (Piemontèis) |
| 213 | + * @author Dragonòt |
| 214 | + */ |
| 215 | +$messages['pms'] = array( |
| 216 | + 'semanticcompoundqueries-desc' => 'Na fonsion dël parser che a visualisa vàire antërogassion semàntiche al midem temp', |
| 217 | +); |
| 218 | + |
| 219 | +/** Portuguese (Português) |
| 220 | + * @author Hamilton Abreu |
| 221 | + * @author Waldir |
| 222 | + */ |
| 223 | +$messages['pt'] = array( |
| 224 | + 'semanticcompoundqueries-desc' => 'Uma função de análise gramatical que mostra várias consultas semânticas em simultâneo', |
| 225 | +); |
| 226 | + |
| 227 | +/** Brazilian Portuguese (Português do Brasil) |
| 228 | + * @author Eduardo.mps |
| 229 | + */ |
| 230 | +$messages['pt-br'] = array( |
| 231 | + 'semanticcompoundqueries-desc' => 'Uma função analisadora que exibe múltiplas consultas semânticas ao mesmo tempo', |
| 232 | +); |
| 233 | + |
| 234 | +/** Tarandíne (Tarandíne) |
| 235 | + * @author Joetaras |
| 236 | + */ |
| 237 | +$messages['roa-tara'] = array( |
| 238 | + 'semanticcompoundqueries-desc' => "'Na funziona de analisi ca visualizze le inderrogazziune semandiche multiple jndr'à 'u stesse mumende", |
| 239 | +); |
| 240 | + |
| 241 | +/** Russian (Русский) |
| 242 | + * @author Александр Сигачёв |
| 243 | + */ |
| 244 | +$messages['ru'] = array( |
| 245 | + 'semanticcompoundqueries-desc' => 'Функция парсера, показывающая несколько семантических запросов за один раз', |
| 246 | +); |
| 247 | + |
| 248 | +/** Slovak (Slovenčina) |
| 249 | + * @author Helix84 |
| 250 | + */ |
| 251 | +$messages['sk'] = array( |
| 252 | + 'semanticcompoundqueries-desc' => 'Funkcia syntaktického analyzátora, ktorá zobrazuje viaceré sémantické požiadavky naraz', |
| 253 | +); |
| 254 | + |
| 255 | +/** Serbian Cyrillic ekavian (Српски (ћирилица)) |
| 256 | + * @author Михајло Анђелковић |
| 257 | + */ |
| 258 | +$messages['sr-ec'] = array( |
| 259 | + 'semanticcompoundqueries-desc' => 'Парсер-функција која приказује више семантичких захтева истовремено', |
| 260 | +); |
| 261 | + |
| 262 | +/** Serbian Latin ekavian (Srpski (latinica)) |
| 263 | + * @author Liangent |
| 264 | + */ |
| 265 | +$messages['sr-el'] = array( |
| 266 | + 'semanticcompoundqueries-desc' => 'Parser-funkcija koja prikazuje više semantičkih zahteva istovremeno', |
| 267 | +); |
| 268 | + |
| 269 | +/** Turkish (Türkçe) |
| 270 | + * @author Vito Genovese |
| 271 | + */ |
| 272 | +$messages['tr'] = array( |
| 273 | + 'semanticcompoundqueries-desc' => 'Birden fazla anlamsal sorguyu aynı anda görüntüleyen bir ayrıştırıcı fonksiyon', |
| 274 | +); |
| 275 | + |
| 276 | +/** Vietnamese (Tiếng Việt) |
| 277 | + * @author Minh Nguyen |
| 278 | + */ |
| 279 | +$messages['vi'] = array( |
| 280 | + 'semanticcompoundqueries-desc' => 'Hàm cú pháp hiển thị nhiều truy vấn ngữ nghĩa cùng lúc', |
| 281 | +); |
| 282 | + |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SemanticCompoundQueries.i18n.php |
___________________________________________________________________ |
Name: svn:keywords |
1 | 283 | + Id |
Name: svn:eol-style |
2 | 284 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SemanticCompoundQueries.php |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Initialization file for SemanticCompoundQueries |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup SemanticCompoundQueries |
| 8 | + * @author Yaron Koren |
| 9 | + */ |
| 10 | + |
| 11 | +if ( !defined( 'MEDIAWIKI' ) ) die(); |
| 12 | + |
| 13 | +define( 'SCQ_VERSION', '0.2.3' ); |
| 14 | + |
| 15 | +$wgExtensionCredits['parserhook'][] = array( |
| 16 | + 'path' => __FILE__, |
| 17 | + 'name' => 'Semantic Compound Queries', |
| 18 | + 'version' => SCQ_VERSION, |
| 19 | + 'author' => 'Yaron Koren', |
| 20 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries', |
| 21 | + 'description' => 'A parser function that displays multiple semantic queries at the same time', |
| 22 | + 'descriptionmsg' => 'semanticcompoundqueries-desc', |
| 23 | +); |
| 24 | + |
| 25 | +$wgExtensionMessagesFiles['SemanticCompoundQueries'] = dirname( __FILE__ ) . '/SemanticCompoundQueries.i18n.php'; |
| 26 | + |
| 27 | + |
| 28 | +$wgHooks['ParserFirstCallInit'][] = 'scqgRegisterParser'; |
| 29 | +// FIXME: Can be removed when new style magic words are used (introduced in r52503) |
| 30 | +$wgHooks['LanguageGetMagic'][] = 'scqgLanguageGetMagic'; |
| 31 | + |
| 32 | +$scqIP = $IP . '/extensions/SemanticCompoundQueries'; |
| 33 | +$wgAutoloadClasses['SCQQueryProcessor'] = $scqIP . '/SCQ_QueryProcessor.php'; |
| 34 | +$wgAutoloadClasses['SCQQueryResult'] = $scqIP . '/SCQ_QueryResult.php'; |
| 35 | + |
| 36 | +function scqgRegisterParser( &$parser ) { |
| 37 | + $parser->setFunctionHook( 'compound_query', array( 'SCQQueryProcessor', 'doCompoundQuery' ) ); |
| 38 | + return true; // always return true, in order not to stop MW's hook processing! |
| 39 | +} |
| 40 | + |
| 41 | +// FIXME: Can be removed when new style magic words are used (introduced in r52503) |
| 42 | +function scqgLanguageGetMagic( &$magicWords, $langCode = "en" ) { |
| 43 | + switch ( $langCode ) { |
| 44 | + default: |
| 45 | + $magicWords['compound_query'] = array ( 0, 'compound_query' ); |
| 46 | + } |
| 47 | + return true; |
| 48 | +} |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_3/SemanticCompoundQueries.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 49 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_3/README |
— | — | @@ -0,0 +1,48 @@ |
| 2 | +Semantic Compound Queries Extension |
| 3 | + |
| 4 | + Version 0.2.2 |
| 5 | + Yaron Koren |
| 6 | + |
| 7 | +This is free software licensed under the GNU General Public License. Please |
| 8 | +see http://www.gnu.org/copyleft/gpl.html for further details, including the |
| 9 | +full text and terms of the license. |
| 10 | + |
| 11 | +== Overview == |
| 12 | + |
| 13 | +Semantic Compound Queries is an extension to MediaWiki that defines a |
| 14 | +parser function, '#compound_query', that displays the results of the |
| 15 | +equivalent of multiple Semantic MediaWiki #ask queries at the same time. |
| 16 | +The syntax of #compound_query resembles that of #ask, but with more than |
| 17 | +one query, and with the elements of each sub-query delimited by semicolons |
| 18 | +instead of pipes. Elements that are common across all sub-queries, like |
| 19 | +'format=' and 'width=' (for maps) should be placed after all sub-queries. |
| 20 | + |
| 21 | +A sample call to #compound query, which retrieves both biographies, along |
| 22 | +with their subject; and fiction books, along with their author; is: |
| 23 | + |
| 24 | +{{#compound_query:[[Category:Books]][[Has gentre::Biography]];?Covers subject=Subject |
| 25 | + |[[Category:Books]][[Has genre::Fiction]];?Has author=Author |
| 26 | + |format=list}} |
| 27 | + |
| 28 | + |
| 29 | +For more information, see the extension homepage at: |
| 30 | +http://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries |
| 31 | + |
| 32 | +== Requirements == |
| 33 | + |
| 34 | +This version of the Semantic Compound Queries extension requires MediaWiki 1.8 |
| 35 | +or higher and Semantic MediaWiki 1.2 or higher. |
| 36 | + |
| 37 | +== Installation == |
| 38 | + |
| 39 | +To install the extension, place the entire 'SemanticCompoundQueries' directory |
| 40 | +within your MediaWiki 'extensions' directory, then add the following |
| 41 | +line to your 'LocalSettings.php' file: |
| 42 | + |
| 43 | + require_once( "$IP/extensions/SemanticCompoundQueries/SCQ_Settings.php" ); |
| 44 | + |
| 45 | +== Contact == |
| 46 | + |
| 47 | +Comments, questions, suggestions and bug reports are welcome, and can |
| 48 | +be placed on the Talk page for the extension, or sent to Yaron at |
| 49 | +yaron57@gmail.com. |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_3/README |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 50 | + native |