Index: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SCQ_QueryResult.php |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Subclass of SMWQueryResult - this class was mostly created in order to |
| 6 | + * get around an inconvenient print-request-compatibility check in |
| 7 | + * SMWQueryResult::addRow() |
| 8 | + * |
| 9 | + * @ingroup SemanticCompoundQueries |
| 10 | + * |
| 11 | + * @author Yaron Koren |
| 12 | + */ |
| 13 | +class SCQQueryResult extends SMWQueryResult { |
| 14 | + |
| 15 | + /** |
| 16 | + * Adds in the pages from a new query result to the existing set of |
| 17 | + * pages - only pages that weren't in the set already get added. |
| 18 | + * |
| 19 | + * @param SMWQueryResult $new_result |
| 20 | + */ |
| 21 | + public function addResult( SMWQueryResult $newResult ) { |
| 22 | + $existingPageNames = array(); |
| 23 | + |
| 24 | + while ( $row = $this->getNext() ) { |
| 25 | + if ( $row[0] instanceof SMWResultArray ) { |
| 26 | + $content = $row[0]->getContent(); |
| 27 | + $existingPageNames[] = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
| 28 | + } |
| 29 | + } |
| 30 | + |
| 31 | + while ( ( $row = $newResult->getNext() ) !== false ) { |
| 32 | + if ( property_exists( $newResult, 'display_options' ) ) { |
| 33 | + $row[0]->display_options = $newResult->display_options; |
| 34 | + } |
| 35 | + $content = $row[0]->getContent(); |
| 36 | + $pageName = $content[0]->getLongText( SMW_OUTPUT_WIKI ); |
| 37 | + |
| 38 | + if ( !in_array( $pageName, $existingPageNames ) ) { |
| 39 | + $this->m_content[] = $row; |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + reset( $this->m_content ); |
| 44 | + } |
| 45 | + |
| 46 | +} |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SCQ_QueryResult.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 47 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SCQ_QueryProcessor.php |
— | — | @@ -0,0 +1,210 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Class that holds static functions for handling compound queries. |
| 6 | + * This class inherits from Semantic MediaWiki's SMWQueryProcessor. |
| 7 | + * |
| 8 | + * @ingroup SemanticCompoundQueries |
| 9 | + * |
| 10 | + * @author Yaron Koren |
| 11 | + */ |
| 12 | +class SCQQueryProcessor extends SMWQueryProcessor { |
| 13 | + |
| 14 | + /** |
| 15 | + * Handler for the #compound_query parser function. |
| 16 | + * |
| 17 | + * @param Parser $parser |
| 18 | + * |
| 19 | + * @return string |
| 20 | + */ |
| 21 | + public static function doCompoundQuery( Parser &$parser ) { |
| 22 | + global $smwgQEnabled, $smwgIQRunningNumber; |
| 23 | + |
| 24 | + if ( !$smwgQEnabled ) { |
| 25 | + return smwfEncodeMessages( array( wfMsgForContent( 'smw_iq_disabled' ) ) ); |
| 26 | + } |
| 27 | + |
| 28 | + $smwgIQRunningNumber++; |
| 29 | + |
| 30 | + $params = func_get_args(); |
| 31 | + array_shift( $params ); // We already know the $parser. |
| 32 | + |
| 33 | + $other_params = array(); |
| 34 | + $results = array(); |
| 35 | + |
| 36 | + foreach ( $params as $param ) { |
| 37 | + // Very primitive heuristic - if the parameter |
| 38 | + // includes a square bracket, then it's a |
| 39 | + // sub-query; otherwise it's a regular parameter. |
| 40 | + if ( strpos( $param, '[' ) !== false ) { |
| 41 | + $sub_params = self::getSubParams( $param ); |
| 42 | + $next_result = self::getQueryResultFromFunctionParams( $sub_params, SMW_OUTPUT_WIKI ); |
| 43 | + |
| 44 | + $results = self::mergeSMWQueryResults( $results, $next_result->getResults() ); |
| 45 | + } else { |
| 46 | + $parts = explode( '=', $param, 2 ); |
| 47 | + |
| 48 | + if ( count( $parts ) >= 2 ) { |
| 49 | + $other_params[strtolower( trim( $parts[0] ) )] = $parts[1]; // don't trim here, some params care for " " |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + $query_result = new SCQQueryResult( $next_result->getPrintRequests(), new SMWQuery(), $results, smwfGetStore() ); |
| 55 | + return self::getResultFromQueryResult( $query_result, $other_params, SMW_OUTPUT_WIKI ); |
| 56 | + } |
| 57 | + |
| 58 | + /** |
| 59 | + * An alternative to explode() - that function won't work here, |
| 60 | + * because we don't want to split the string on all semicolons, just |
| 61 | + * the ones that aren't contained within square brackets |
| 62 | + * |
| 63 | + * @param string $param |
| 64 | + * |
| 65 | + * @return array |
| 66 | + */ |
| 67 | + protected static function getSubParams( $param ) { |
| 68 | + $sub_params = array(); |
| 69 | + $sub_param = ''; |
| 70 | + $uncompleted_square_brackets = 0; |
| 71 | + |
| 72 | + for ( $i = 0; $i < strlen( $param ); $i++ ) { |
| 73 | + $c = $param[$i]; |
| 74 | + |
| 75 | + if ( ( $c == ';' ) && ( $uncompleted_square_brackets <= 0 ) ) { |
| 76 | + $sub_params[] = trim( $sub_param ); |
| 77 | + $sub_param = ''; |
| 78 | + } else { |
| 79 | + $sub_param .= $c; |
| 80 | + |
| 81 | + if ( $c == '[' ) { |
| 82 | + $uncompleted_square_brackets++; |
| 83 | + } |
| 84 | + |
| 85 | + elseif ( $c == ']' ) { |
| 86 | + $uncompleted_square_brackets--; |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + |
| 91 | + $sub_params[] = trim( $sub_param ); |
| 92 | + |
| 93 | + return $sub_params; |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * @param $rawparams |
| 98 | + * @param $outputmode |
| 99 | + * @param $context |
| 100 | + * @param $showmode |
| 101 | + * |
| 102 | + * @return SMWQueryResult |
| 103 | + */ |
| 104 | + protected static function getQueryResultFromFunctionParams( $rawparams, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $showmode = false ) { |
| 105 | + self::processFunctionParams( $rawparams, $querystring, $params, $printouts, $showmode ); |
| 106 | + return self::getQueryResultFromQueryString( $querystring, $params, $printouts, SMW_OUTPUT_WIKI, $context ); |
| 107 | + } |
| 108 | + |
| 109 | + /** |
| 110 | + * Combine two arrays of SMWWikiPageValue objects into one |
| 111 | + * |
| 112 | + * @param array $result1 |
| 113 | + * @param array $result2 |
| 114 | + * |
| 115 | + * @return array |
| 116 | + */ |
| 117 | + protected static function mergeSMWQueryResults( $result1, $result2 ) { |
| 118 | + if ( $result1 == null ) { |
| 119 | + return $result2; |
| 120 | + } |
| 121 | + |
| 122 | + $existing_page_names = array(); |
| 123 | + |
| 124 | + foreach ( $result1 as $r1 ) { |
| 125 | + // SMW 1.6+ |
| 126 | + if ( $r1 instanceof SMWDIWikiPage ) { |
| 127 | + $existing_page_names[] = $r1->getDBkey(); |
| 128 | + } else { |
| 129 | + $existing_page_names[] = $r1->getWikiValue(); |
| 130 | + } |
| 131 | + } |
| 132 | + |
| 133 | + foreach ( $result2 as $r2 ) { |
| 134 | + if ( $r1 instanceof SMWDIWikiPage ) { |
| 135 | + $page_name = $r2->getDBkey(); |
| 136 | + } else { |
| 137 | + $page_name = $r2->getWikiValue(); |
| 138 | + } |
| 139 | + |
| 140 | + if ( ! in_array( $page_name, $existing_page_names ) ) { |
| 141 | + $result1[] = $r2; |
| 142 | + } |
| 143 | + } |
| 144 | + |
| 145 | + return $result1; |
| 146 | + } |
| 147 | + |
| 148 | + /** |
| 149 | + * @param $querystring |
| 150 | + * @param array $params |
| 151 | + * @param $extraprintouts |
| 152 | + * @param $outputmode |
| 153 | + * @param $context |
| 154 | + * |
| 155 | + * @return SMWQueryResult |
| 156 | + */ |
| 157 | + protected static function getQueryResultFromQueryString( $querystring, array $params, $extraprintouts, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY ) { |
| 158 | + wfProfileIn( 'SCQQueryProcessor::getQueryResultFromQueryString' ); |
| 159 | + |
| 160 | + $query = self::createQuery( $querystring, $params, $context, null, $extraprintouts ); |
| 161 | + $query_result = smwfGetStore()->getQueryResult( $query ); |
| 162 | + $display_options = array(); |
| 163 | + |
| 164 | + foreach ( $params as $key => $value ) { |
| 165 | + // Special handling for 'icon' field, since it requires conversion of a name to a URL. |
| 166 | + if ( $key == 'icon' ) { |
| 167 | + $title = Title::newFromText( $value, NS_FILE ); |
| 168 | + |
| 169 | + if ( !is_null( $title ) && $title->getNamespace() == NS_FILE && $title->exists() ) { |
| 170 | + $icon_image_page = new ImagePage( $title ); |
| 171 | + $display_options['icon'] = $icon_image_page->getDisplayedFile()->getURL(); |
| 172 | + } |
| 173 | + } else { |
| 174 | + $display_options[$key] = $value; |
| 175 | + } |
| 176 | + |
| 177 | + foreach ( $query_result->getResults() as $wiki_page ) { |
| 178 | + $wiki_page->display_options = $display_options; |
| 179 | + } |
| 180 | + } |
| 181 | + |
| 182 | + wfProfileOut( 'SCQQueryProcessor::getQueryResultFromQueryString' ); |
| 183 | + |
| 184 | + return $query_result; |
| 185 | + } |
| 186 | + |
| 187 | + /** |
| 188 | + * Matches getResultFromQueryResult() from SMWQueryProcessor, |
| 189 | + * except that formats of type 'debug' and 'count' aren't handled. |
| 190 | + * |
| 191 | + * @param SCQQueryResult $res |
| 192 | + * @param array $params |
| 193 | + * @param $outputmode |
| 194 | + * @param $context |
| 195 | + * @param string $format |
| 196 | + * |
| 197 | + * @return string |
| 198 | + */ |
| 199 | + protected static function getResultFromQueryResult( SCQQueryResult $res, array $params, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, $format = '' ) { |
| 200 | + wfProfileIn( 'SCQQueryProcessor::getResultFromQueryResult' ); |
| 201 | + |
| 202 | + $format = self::getResultFormat( $params ); |
| 203 | + $printer = self::getResultPrinter( $format, $context, $res ); |
| 204 | + $result = $printer->getResult( $res, $params, $outputmode ); |
| 205 | + |
| 206 | + wfProfileOut( 'SCQQueryProcessor::getResultFromQueryResult' ); |
| 207 | + |
| 208 | + return $result; |
| 209 | + } |
| 210 | + |
| 211 | +} |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SCQ_QueryProcessor.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 212 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SemanticCompoundQueries.i18n.magic.php |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * |
| 5 | + */ |
| 6 | + |
| 7 | +$magicWords = array(); |
| 8 | + |
| 9 | +/** English (English) */ |
| 10 | +$magicWords['en'] = array( |
| 11 | + 'compound_query' => array( 0, 'compound_query' ), |
| 12 | +); |
| 13 | + |
| 14 | +/** Arabic (العربية) */ |
| 15 | +$magicWords['ar'] = array( |
| 16 | + 'compound_query' => array( 0, 'استعلام_مركب' ), |
| 17 | +); |
| 18 | + |
| 19 | +/** Egyptian Spoken Arabic (مصرى) */ |
| 20 | +$magicWords['arz'] = array( |
| 21 | + 'compound_query' => array( 0, 'استعلام_مركب', 'compound_query' ), |
| 22 | +); |
| 23 | + |
| 24 | +/** Japanese (日本語) */ |
| 25 | +$magicWords['ja'] = array( |
| 26 | + 'compound_query' => array( 0, '複合クエリー' ), |
| 27 | +); |
| 28 | + |
| 29 | +/** Macedonian (Македонски) */ |
| 30 | +$magicWords['mk'] = array( |
| 31 | + 'compound_query' => array( 0, 'мешовито_барање' ), |
| 32 | +); |
| 33 | + |
| 34 | +/** Nedersaksisch (Nedersaksisch) */ |
| 35 | +$magicWords['nds-nl'] = array( |
| 36 | + 'compound_query' => array( 0, 'samen-estelde_zeukopdrach', 'samengestelde_zoekopdracht', 'compound_query' ), |
| 37 | +); |
| 38 | + |
| 39 | +/** Dutch (Nederlands) */ |
| 40 | +$magicWords['nl'] = array( |
| 41 | + 'compound_query' => array( 0, 'samengestelde_zoekopdracht' ), |
| 42 | +); |
\ No newline at end of file |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SemanticCompoundQueries.i18n.magic.php |
___________________________________________________________________ |
Added: svn:keywords |
1 | 43 | + Id |
Added: svn:eol-style |
2 | 44 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SemanticCompoundQueries.i18n.php |
— | — | @@ -0,0 +1,347 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalization file for SemanticCompoundQueries extension. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + */ |
| 9 | + |
| 10 | +// FIXME: Can be enabled when new-style magic words are used (introduced in r52503) |
| 11 | +// require_once( dirname( __FILE__ ) . '/SemanticCompoundQueries.i18n.magic.php' ); |
| 12 | + |
| 13 | +$messages = array(); |
| 14 | + |
| 15 | +/** English |
| 16 | + * @author Yaron Koren |
| 17 | + */ |
| 18 | +$messages['en'] = array( |
| 19 | + 'semanticcompoundqueries-desc' => 'A parser function that displays multiple semantic queries at the same time', |
| 20 | +); |
| 21 | + |
| 22 | +/** Message documentation (Message documentation) |
| 23 | + * @author Fryed-peach |
| 24 | + * @author Purodha |
| 25 | + */ |
| 26 | +$messages['qqq'] = array( |
| 27 | + 'semanticcompoundqueries-desc' => '{{desc}}', |
| 28 | +); |
| 29 | + |
| 30 | +/** Arabic (العربية) |
| 31 | + * @author Meno25 |
| 32 | + */ |
| 33 | +$messages['ar'] = array( |
| 34 | + 'semanticcompoundqueries-desc' => 'دالة محلل تعرض استعلامات دلالية متعددة في نفس الوقت', |
| 35 | +); |
| 36 | + |
| 37 | +/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
| 38 | + * @author EugeneZelenko |
| 39 | + * @author Jim-by |
| 40 | + */ |
| 41 | +$messages['be-tarask'] = array( |
| 42 | + 'semanticcompoundqueries-desc' => 'Функцыя парсэра, якая паказвае шматлікія сэмантычныя запыты ў адзін час', |
| 43 | +); |
| 44 | + |
| 45 | +/** Breton (Brezhoneg) |
| 46 | + * @author Fulup |
| 47 | + */ |
| 48 | +$messages['br'] = array( |
| 49 | + 'semanticcompoundqueries-desc' => "Un arc'hwel eus ar parser a ziskwel meur a reked ereadurel war un dro", |
| 50 | +); |
| 51 | + |
| 52 | +/** Bosnian (Bosanski) |
| 53 | + * @author CERminator |
| 54 | + */ |
| 55 | +$messages['bs'] = array( |
| 56 | + 'semanticcompoundqueries-desc' => 'Parserska funkcija koja prikazuje više semantičkih upita u isto vrijeme', |
| 57 | +); |
| 58 | + |
| 59 | +/** Catalan (Català) |
| 60 | + * @author Toniher |
| 61 | + */ |
| 62 | +$messages['ca'] = array( |
| 63 | + 'semanticcompoundqueries-desc' => "Una funció d'anàlisi que mostra múltiples consultes semàntiques alhora.", |
| 64 | +); |
| 65 | + |
| 66 | +/** Czech (Česky) |
| 67 | + * @author Juan de Vojníkov |
| 68 | + */ |
| 69 | +$messages['cs'] = array( |
| 70 | + 'semanticcompoundqueries-desc' => 'Parser, který zobrazuje více sémantických dotazů najednou', |
| 71 | +); |
| 72 | + |
| 73 | +/** Danish (Dansk) |
| 74 | + * @author Froztbyte |
| 75 | + */ |
| 76 | +$messages['da'] = array( |
| 77 | + 'semanticcompoundqueries-desc' => 'En parserfunktion, som viser flere semantiske søgninger på samme tid', |
| 78 | +); |
| 79 | + |
| 80 | +/** German (Deutsch) |
| 81 | + * @author Kghbln |
| 82 | + * @author Purodha |
| 83 | + */ |
| 84 | +$messages['de'] = array( |
| 85 | + 'semanticcompoundqueries-desc' => 'Erweitert den Parser um eine Funktion, die mehrere semantische Abfragen zugleich anzuzeigen erlaubt', |
| 86 | +); |
| 87 | + |
| 88 | +/** Lower Sorbian (Dolnoserbski) |
| 89 | + * @author Michawiki |
| 90 | + */ |
| 91 | +$messages['dsb'] = array( |
| 92 | + 'semanticcompoundqueries-desc' => 'Parserowa funkcija, kótaraž rownocasnje zwobraznjujo někotare semantiske wótpšašanja', |
| 93 | +); |
| 94 | + |
| 95 | +/** Greek (Ελληνικά) |
| 96 | + * @author Omnipaedista |
| 97 | + */ |
| 98 | +$messages['el'] = array( |
| 99 | + 'semanticcompoundqueries-desc' => 'Μια λεξιαναλυτική συνάρτηση που προβάλλει πολλαπλά σημασιολογικά αιτήματα ταυτόχρονα', |
| 100 | +); |
| 101 | + |
| 102 | +/** Spanish (Español) |
| 103 | + * @author Crazymadlover |
| 104 | + */ |
| 105 | +$messages['es'] = array( |
| 106 | + 'semanticcompoundqueries-desc' => 'Una función analizadora que muestra múltiples consultas semánticas al mismo tiempo', |
| 107 | +); |
| 108 | + |
| 109 | +/** Finnish (Suomi) |
| 110 | + * @author Centerlink |
| 111 | + * @author Crt |
| 112 | + */ |
| 113 | +$messages['fi'] = array( |
| 114 | + 'semanticcompoundqueries-desc' => 'Jäsennintoiminto, joka näyttää useita semanttisia kyselyjä samaan aikaan.', |
| 115 | +); |
| 116 | + |
| 117 | +/** French (Français) |
| 118 | + * @author IAlex |
| 119 | + */ |
| 120 | +$messages['fr'] = array( |
| 121 | + 'semanticcompoundqueries-desc' => 'Une fonction du parseur qui affiche plusieurs requêtes sémantiques en même temps', |
| 122 | +); |
| 123 | + |
| 124 | +/** Galician (Galego) |
| 125 | + * @author Toliño |
| 126 | + */ |
| 127 | +$messages['gl'] = array( |
| 128 | + 'semanticcompoundqueries-desc' => 'Unha función analítica que mostra varias pescudas semánticas ao mesmo tempo', |
| 129 | +); |
| 130 | + |
| 131 | +/** Swiss German (Alemannisch) |
| 132 | + * @author Als-Holder |
| 133 | + */ |
| 134 | +$messages['gsw'] = array( |
| 135 | + 'semanticcompoundqueries-desc' => 'E Parserfunktion, wu erlaubt, mehreri semantischi Abfroge uf eimol aazzeige', |
| 136 | +); |
| 137 | + |
| 138 | +/** Hebrew (עברית) |
| 139 | + * @author Rotemliss |
| 140 | + */ |
| 141 | +$messages['he'] = array( |
| 142 | + 'semanticcompoundqueries-desc' => 'הוראת מפענח המציגה מספר שאילתות סמנטיות בעת ובעונה אחת', |
| 143 | +); |
| 144 | + |
| 145 | +/** Hiligaynon (Ilonggo) |
| 146 | + * @author Tagimata |
| 147 | + */ |
| 148 | +$messages['hil'] = array( |
| 149 | + 'semanticcompoundqueries-desc' => 'Ang parser panksiyon nga nagapakita sang multiple semantik pamangkotanon sa parehas nga tiyempo', |
| 150 | +); |
| 151 | + |
| 152 | +/** Upper Sorbian (Hornjoserbsce) |
| 153 | + * @author Michawiki |
| 154 | + */ |
| 155 | +$messages['hsb'] = array( |
| 156 | + 'semanticcompoundqueries-desc' => 'Parserowa funkcija, kotraž wjacore semantiske wotprašowanja nadobo zwobrazuje', |
| 157 | +); |
| 158 | + |
| 159 | +/** Hungarian (Magyar) |
| 160 | + * @author Glanthor Reviol |
| 161 | + */ |
| 162 | +$messages['hu'] = array( |
| 163 | + 'semanticcompoundqueries-desc' => 'Egyszerre több szemantikus lekérdezést megjelenítő elemzőfüggvény', |
| 164 | +); |
| 165 | + |
| 166 | +/** Interlingua (Interlingua) |
| 167 | + * @author McDutchie |
| 168 | + */ |
| 169 | +$messages['ia'] = array( |
| 170 | + 'semanticcompoundqueries-desc' => 'Un function analysator que presenta plure consultas semantic al mesme tempore', |
| 171 | +); |
| 172 | + |
| 173 | +/** Indonesian (Bahasa Indonesia) |
| 174 | + * @author Bennylin |
| 175 | + */ |
| 176 | +$messages['id'] = array( |
| 177 | + 'semanticcompoundqueries-desc' => 'Fungsi parser untuk menampilkan beberapa kueri semantik secara bersamaan', |
| 178 | +); |
| 179 | + |
| 180 | +/** Italian (Italiano) |
| 181 | + * @author Gianfranco |
| 182 | + */ |
| 183 | +$messages['it'] = array( |
| 184 | + 'semanticcompoundqueries-desc' => 'Una funzione di parsing che mostra più query semantiche contemporaneamente', |
| 185 | +); |
| 186 | + |
| 187 | +/** Japanese (日本語) |
| 188 | + * @author Fryed-peach |
| 189 | + */ |
| 190 | +$messages['ja'] = array( |
| 191 | + 'semanticcompoundqueries-desc' => '複数の意味的クエリーを一度に表示するパーサー関数', |
| 192 | +); |
| 193 | + |
| 194 | +/** Colognian (Ripoarisch) |
| 195 | + * @author Purodha |
| 196 | + */ |
| 197 | +$messages['ksh'] = array( |
| 198 | + 'semanticcompoundqueries-desc' => 'En Paaser_Funkßuhn öm ettlijje semantesche Froore op eijmohl aanzezeije.', |
| 199 | +); |
| 200 | + |
| 201 | +/** Luxembourgish (Lëtzebuergesch) |
| 202 | + * @author Robby |
| 203 | + */ |
| 204 | +$messages['lb'] = array( |
| 205 | + 'semanticcompoundqueries-desc' => 'Eng Parserfonctioun déi et erlaabt méi semantesch Ufroe mateneen ze weisen', |
| 206 | +); |
| 207 | + |
| 208 | +/** Macedonian (Македонски) |
| 209 | + * @author Bjankuloski06 |
| 210 | + */ |
| 211 | +$messages['mk'] = array( |
| 212 | + 'semanticcompoundqueries-desc' => 'Парсерска функција која прикажува повеќе семантички барања истовремено', |
| 213 | +); |
| 214 | + |
| 215 | +/** Malay (Bahasa Melayu) |
| 216 | + * @author Anakmalaysia |
| 217 | + */ |
| 218 | +$messages['ms'] = array( |
| 219 | + 'semanticcompoundqueries-desc' => 'Fungsi penghurai yang memaparkan berbilang pertanyaan semantik pada masa yang sama', |
| 220 | +); |
| 221 | + |
| 222 | +/** Dutch (Nederlands) |
| 223 | + * @author Siebrand |
| 224 | + */ |
| 225 | +$messages['nl'] = array( |
| 226 | + 'semanticcompoundqueries-desc' => 'Een parserfunctie die meerdere semantische zoekopdrachten op hetzelfde moment kan weergeven', |
| 227 | +); |
| 228 | + |
| 229 | +/** Norwegian (bokmål) (Norsk (bokmål)) |
| 230 | + * @author Nghtwlkr |
| 231 | + */ |
| 232 | +$messages['no'] = array( |
| 233 | + 'semanticcompoundqueries-desc' => 'En tolkefunksjon som viser flere semantiske spørringer samtidig', |
| 234 | +); |
| 235 | + |
| 236 | +/** Occitan (Occitan) |
| 237 | + * @author Cedric31 |
| 238 | + */ |
| 239 | +$messages['oc'] = array( |
| 240 | + 'semanticcompoundqueries-desc' => "Una foncion del parser qu'aficha mai d'una requèsta semanticas a l'encòp", |
| 241 | +); |
| 242 | + |
| 243 | +/** Polish (Polski) |
| 244 | + * @author Sp5uhe |
| 245 | + */ |
| 246 | +$messages['pl'] = array( |
| 247 | + 'semanticcompoundqueries-desc' => 'Funkcja parsera wyświetlająca różnorodne znaczeniowo zapytania w tym samym czasie', |
| 248 | +); |
| 249 | + |
| 250 | +/** Piedmontese (Piemontèis) |
| 251 | + * @author Dragonòt |
| 252 | + */ |
| 253 | +$messages['pms'] = array( |
| 254 | + 'semanticcompoundqueries-desc' => 'Na fonsion dël parser che a visualisa vàire antërogassion semàntiche al midem temp', |
| 255 | +); |
| 256 | + |
| 257 | +/** Portuguese (Português) |
| 258 | + * @author Hamilton Abreu |
| 259 | + * @author Waldir |
| 260 | + */ |
| 261 | +$messages['pt'] = array( |
| 262 | + 'semanticcompoundqueries-desc' => 'Uma função de análise gramatical que mostra várias consultas semânticas em simultâneo', |
| 263 | +); |
| 264 | + |
| 265 | +/** Brazilian Portuguese (Português do Brasil) |
| 266 | + * @author Eduardo.mps |
| 267 | + */ |
| 268 | +$messages['pt-br'] = array( |
| 269 | + 'semanticcompoundqueries-desc' => 'Uma função analisadora que exibe múltiplas consultas semânticas ao mesmo tempo', |
| 270 | +); |
| 271 | + |
| 272 | +/** Tarandíne (Tarandíne) |
| 273 | + * @author Joetaras |
| 274 | + */ |
| 275 | +$messages['roa-tara'] = array( |
| 276 | + 'semanticcompoundqueries-desc' => "'Na funziona de analisi ca visualizze le inderrogazziune semandiche multiple jndr'à 'u stesse mumende", |
| 277 | +); |
| 278 | + |
| 279 | +/** Russian (Русский) |
| 280 | + * @author Александр Сигачёв |
| 281 | + */ |
| 282 | +$messages['ru'] = array( |
| 283 | + 'semanticcompoundqueries-desc' => 'Функция парсера, показывающая несколько семантических запросов за один раз', |
| 284 | +); |
| 285 | + |
| 286 | +/** Slovak (Slovenčina) |
| 287 | + * @author Helix84 |
| 288 | + */ |
| 289 | +$messages['sk'] = array( |
| 290 | + 'semanticcompoundqueries-desc' => 'Funkcia syntaktického analyzátora, ktorá zobrazuje viaceré sémantické požiadavky naraz', |
| 291 | +); |
| 292 | + |
| 293 | +/** Serbian Cyrillic ekavian (Српски (ћирилица)) |
| 294 | + * @author Михајло Анђелковић |
| 295 | + */ |
| 296 | +$messages['sr-ec'] = array( |
| 297 | + 'semanticcompoundqueries-desc' => 'Парсер-функција која приказује више семантичких захтева истовремено', |
| 298 | +); |
| 299 | + |
| 300 | +/** Serbian Latin ekavian (Srpski (latinica)) |
| 301 | + * @author Liangent |
| 302 | + */ |
| 303 | +$messages['sr-el'] = array( |
| 304 | + 'semanticcompoundqueries-desc' => 'Parser-funkcija koja prikazuje više semantičkih zahteva istovremeno', |
| 305 | +); |
| 306 | + |
| 307 | +/** Swedish (Svenska) |
| 308 | + * @author Boivie |
| 309 | + */ |
| 310 | +$messages['sv'] = array( |
| 311 | + 'semanticcompoundqueries-desc' => 'En parserfunktion som visar flera semantiska frågor på samma gång', |
| 312 | +); |
| 313 | + |
| 314 | +/** Tagalog (Tagalog) |
| 315 | + * @author AnakngAraw |
| 316 | + */ |
| 317 | +$messages['tl'] = array( |
| 318 | + 'semanticcompoundqueries-desc' => 'Isang tungkulin ng parser na kasabayang nagpapakita ng maramihang mga katanungang semantiko', |
| 319 | +); |
| 320 | + |
| 321 | +/** Turkish (Türkçe) |
| 322 | + * @author Vito Genovese |
| 323 | + */ |
| 324 | +$messages['tr'] = array( |
| 325 | + 'semanticcompoundqueries-desc' => 'Birden fazla anlamsal sorguyu aynı anda görüntüleyen bir ayrıştırıcı fonksiyon', |
| 326 | +); |
| 327 | + |
| 328 | +/** Ukrainian (Українська) |
| 329 | + * @author Тест |
| 330 | + */ |
| 331 | +$messages['uk'] = array( |
| 332 | + 'semanticcompoundqueries-desc' => 'Функція парсера, що показує кілька семантичних запитів одночасно', |
| 333 | +); |
| 334 | + |
| 335 | +/** Vietnamese (Tiếng Việt) |
| 336 | + * @author Minh Nguyen |
| 337 | + */ |
| 338 | +$messages['vi'] = array( |
| 339 | + 'semanticcompoundqueries-desc' => 'Hàm cú pháp hiển thị nhiều truy vấn ngữ nghĩa cùng lúc', |
| 340 | +); |
| 341 | + |
| 342 | +/** Simplified Chinese (中文(简体)) |
| 343 | + * @author Hydra |
| 344 | + */ |
| 345 | +$messages['zh-hans'] = array( |
| 346 | + 'semanticcompoundqueries-desc' => '解析器的函数,同时显示多个语义查询', |
| 347 | +); |
| 348 | + |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SemanticCompoundQueries.i18n.php |
___________________________________________________________________ |
Added: svn:keywords |
1 | 349 | + Id |
Added: svn:eol-style |
2 | 350 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SemanticCompoundQueries.php |
— | — | @@ -0,0 +1,52 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Initialization file for the SemanticCompoundQueries extension. |
| 5 | + * |
| 6 | + * @file SemanticCompoundQueries.php |
| 7 | + * @ingroup SemanticCompoundQueries |
| 8 | + * |
| 9 | + * @author Yaron Koren |
| 10 | + */ |
| 11 | + |
| 12 | +/** |
| 13 | + * This documentation group collects source-code files belonging to |
| 14 | + * Semantic Compound Queries. |
| 15 | + * |
| 16 | + * @defgroup SemanticCompoundQueries SemanticCompoundQueries |
| 17 | + */ |
| 18 | + |
| 19 | +if ( !defined( 'MEDIAWIKI' ) ) die(); |
| 20 | + |
| 21 | +define( 'SCQ_VERSION', '0.2.9' ); |
| 22 | + |
| 23 | +$wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'parserhook'][] = array( |
| 24 | + 'path' => __FILE__, |
| 25 | + 'name' => 'Semantic Compound Queries', |
| 26 | + 'version' => SCQ_VERSION, |
| 27 | + 'author' => array( 'Yaron Koren' ), |
| 28 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries', |
| 29 | + 'descriptionmsg' => 'semanticcompoundqueries-desc', |
| 30 | +); |
| 31 | + |
| 32 | +$wgExtensionMessagesFiles['SemanticCompoundQueries'] = dirname( __FILE__ ) . '/SemanticCompoundQueries.i18n.php'; |
| 33 | + |
| 34 | +$wgHooks['ParserFirstCallInit'][] = 'scqgRegisterParser'; |
| 35 | +// FIXME: Can be removed when new-style magic words are used (introduced in r52503) |
| 36 | +$wgHooks['LanguageGetMagic'][] = 'scqgLanguageGetMagic'; |
| 37 | + |
| 38 | +$wgAutoloadClasses['SCQQueryProcessor'] = dirname( __FILE__ ) . '/SCQ_QueryProcessor.php'; |
| 39 | +$wgAutoloadClasses['SCQQueryResult'] = dirname( __FILE__ ) . '/SCQ_QueryResult.php'; |
| 40 | + |
| 41 | +function scqgRegisterParser( Parser &$parser ) { |
| 42 | + $parser->setFunctionHook( 'compound_query', array( 'SCQQueryProcessor', 'doCompoundQuery' ) ); |
| 43 | + return true; // always return true, in order not to stop MW's hook processing! |
| 44 | +} |
| 45 | + |
| 46 | +// FIXME: Can be removed when new-style magic words are used (introduced in r52503) |
| 47 | +function scqgLanguageGetMagic( &$magicWords, $langCode = 'en' ) { |
| 48 | + switch ( $langCode ) { |
| 49 | + default: |
| 50 | + $magicWords['compound_query'] = array ( 0, 'compound_query' ); |
| 51 | + } |
| 52 | + return true; |
| 53 | +} |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_9/SemanticCompoundQueries.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 54 | + native |
Index: tags/extensions/SemanticCompoundQueries/REL_0_2_9/README |
— | — | @@ -0,0 +1,52 @@ |
| 2 | +Semantic Compound Queries Extension |
| 3 | + |
| 4 | + Version 0.2.9 |
| 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 | +For more information, see the extension homepage at: |
| 29 | +http://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries |
| 30 | + |
| 31 | +== Requirements == |
| 32 | + |
| 33 | +This version of the Semantic Compound Queries extension requires MediaWiki 1.8 |
| 34 | +or higher and Semantic MediaWiki 1.2 or higher. |
| 35 | + |
| 36 | +== Installation == |
| 37 | + |
| 38 | +To install the extension, place the entire 'SemanticCompoundQueries' directory |
| 39 | +within your MediaWiki 'extensions' directory, then add the following |
| 40 | +line to your 'LocalSettings.php' file: |
| 41 | + |
| 42 | + require_once( "$IP/extensions/SemanticCompoundQueries/SemanticCompoundQueries.php" ); |
| 43 | + |
| 44 | +== Contact == |
| 45 | + |
| 46 | +Comments, questions, suggestions and bug reports should be sent to |
| 47 | +the Semantic MediaWiki mailing list: |
| 48 | + |
| 49 | + https://lists.sourceforge.net/lists/listinfo/semediawiki-user |
| 50 | + |
| 51 | +If possible, please add "[SCQ]" at the beginning of the subject line, to |
| 52 | +clarify the subject matter. |
| 53 | + |
Property changes on: tags/extensions/SemanticCompoundQueries/REL_0_2_9/README |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 54 | + native |