Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/SIO_PageSchemas.php |
— | — | @@ -0,0 +1,146 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Functions for handling Semantic Internal Objects data within the Page Schemas |
| 6 | + * extension. |
| 7 | + * |
| 8 | + * @author Yaron Koren |
| 9 | + * @file SIO_PageSchemas.php |
| 10 | + * @ingroup SIO |
| 11 | + */ |
| 12 | + |
| 13 | +class SIOPageSchemas extends PSExtensionHandler { |
| 14 | + public static function registerClass() { |
| 15 | + global $wgPageSchemasHandlerClasses; |
| 16 | + $wgPageSchemasHandlerClasses[] = 'SIOPageSchemas'; |
| 17 | + return true; |
| 18 | + } |
| 19 | + |
| 20 | + public static function getDisplayColor() { |
| 21 | + return '#FF8'; |
| 22 | + } |
| 23 | + |
| 24 | + public static function getTemplateDisplayString() { |
| 25 | + return wfMsg( 'semanticinternalobjects-internalproperty' ); |
| 26 | + } |
| 27 | + |
| 28 | + /** |
| 29 | + * Returns the display info for the property (if any is defined) |
| 30 | + * for a single field in the Page Schemas XML. |
| 31 | + */ |
| 32 | + public static function getTemplateDisplayValues( $templateXML ) { |
| 33 | + foreach ( $templateXML->children() as $tag => $child ) { |
| 34 | + if ( $tag == "semanticinternalobjects_MainProperty" ) { |
| 35 | + $propName = $child->attributes()->name; |
| 36 | + $values = array(); |
| 37 | + return array( $propName, $values ); |
| 38 | + } |
| 39 | + } |
| 40 | + return null; |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * Constructs XML for the SIO property, based on what was submitted |
| 45 | + * in the 'edit schema' form. |
| 46 | + */ |
| 47 | + public static function createTemplateXMLFromForm() { |
| 48 | + global $wgRequest; |
| 49 | + |
| 50 | + $xmlPerTemplate = array(); |
| 51 | + foreach ( $wgRequest->getValues() as $var => $val ) { |
| 52 | + if ( substr( $var, 0, 18 ) == 'sio_property_name_' ) { |
| 53 | + $templateNum = substr( $var, 18 ); |
| 54 | + $xml = '<semanticinternalobjects_MainProperty name="' . $val . '" />'; |
| 55 | + $xmlPerTemplate[$templateNum] = $xml; |
| 56 | + } |
| 57 | + } |
| 58 | + return $xmlPerTemplate; |
| 59 | + } |
| 60 | + |
| 61 | + /** |
| 62 | + * Returns the HTML necessary for getting information about the |
| 63 | + * semantic property within the Page Schemas 'editschema' page. |
| 64 | + */ |
| 65 | + public static function getTemplateEditingHTML( $psTemplate) { |
| 66 | + $prop_array = array(); |
| 67 | + $hasExistingValues = false; |
| 68 | + if ( !is_null( $psTemplate ) ) { |
| 69 | + $prop_array = $psTemplate->getObject( 'semanticinternalobjects_MainProperty' ); |
| 70 | + if ( !is_null( $prop_array ) ) { |
| 71 | + $hasExistingValues = true; |
| 72 | + } |
| 73 | + } |
| 74 | + $text = '<p>' . 'Name of property to connect this template\'s fields to the rest of the page (should only be used if this template can have multiple instances):' . ' '; |
| 75 | + $propName = PageSchemas::getValueFromObject( $prop_array, 'name' ); |
| 76 | + $text .= Html::input( 'sio_property_name_num', $propName, array( 'size' => 15 ) ) . "\n"; |
| 77 | + |
| 78 | + return array( $text, $hasExistingValues ); |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Returns the property based on the XML passed from the Page Schemas |
| 83 | + * extension. |
| 84 | + */ |
| 85 | + public static function createPageSchemasObject( $tagName, $xml ) { |
| 86 | + if ( $tagName == "semanticinternalobjects_MainProperty" ) { |
| 87 | + foreach ( $xml->children() as $tag => $child ) { |
| 88 | + if ( $tag == $tagName ) { |
| 89 | + $sio_array = array(); |
| 90 | + $propName = $child->attributes()->name; |
| 91 | + $sio_array['name'] = (string)$propName; |
| 92 | + foreach ( $child->children() as $prop => $value ) { |
| 93 | + $sio_array[$prop] = (string)$value; |
| 94 | + } |
| 95 | + return $sio_array; |
| 96 | + } |
| 97 | + } |
| 98 | + } |
| 99 | + return null; |
| 100 | + } |
| 101 | + |
| 102 | + static function getInternalObjectPropertyName ( $psTemplate ) { |
| 103 | + // TODO - there should be a more direct way to get |
| 104 | + // this data. |
| 105 | + $sioPropertyArray = $psTemplate->getObject( 'semanticinternalobjects_MainProperty' ); |
| 106 | + return PageSchemas::getValueFromObject( $sioPropertyArray, 'name' ); |
| 107 | + } |
| 108 | + |
| 109 | + public static function getPagesToGenerate( $pageSchemaObj ) { |
| 110 | + $pagesToGenerate = array(); |
| 111 | + $psTemplates = $pageSchemaObj->getTemplates(); |
| 112 | + foreach ( $psTemplates as $psTemplate ) { |
| 113 | + $sioPropertyName = self::getInternalObjectPropertyName( $psTemplate ); |
| 114 | + if ( is_null( $sioPropertyName ) ) { |
| 115 | + continue; |
| 116 | + } |
| 117 | + $pagesToGenerate[] = Title::makeTitleSafe( SMW_NS_PROPERTY, $sioPropertyName ); |
| 118 | + } |
| 119 | + return $pagesToGenerate; |
| 120 | + } |
| 121 | + |
| 122 | + public static function generatePages( $pageSchemaObj, $selectedPages ) { |
| 123 | + global $smwgContLang, $wgUser; |
| 124 | + |
| 125 | + $datatypeLabels = $smwgContLang->getDatatypeLabels(); |
| 126 | + $pageTypeLabel = $datatypeLabels['_wpg']; |
| 127 | + |
| 128 | + $jobs = array(); |
| 129 | + $jobParams = array(); |
| 130 | + $jobParams['user_id'] = $wgUser->getId(); |
| 131 | + |
| 132 | + $psTemplates = $pageSchemaObj->getTemplates(); |
| 133 | + foreach ( $psTemplates as $psTemplate ) { |
| 134 | + $sioPropertyName = self::getInternalObjectPropertyName( $psTemplate ); |
| 135 | + if ( is_null( $sioPropertyName ) ) { |
| 136 | + continue; |
| 137 | + } |
| 138 | + $propTitle = Title::makeTitleSafe( SMW_NS_PROPERTY, $sioPropertyName ); |
| 139 | + if ( !in_array( $propTitle, $selectedPages ) ) { |
| 140 | + continue; |
| 141 | + } |
| 142 | + $jobParams['page_text'] = SMWPageSchemas::createPropertyText( $pageTypeLabel, null ); |
| 143 | + $jobs[] = new PSCreatePageJob( $propTitle, $jobParams ); |
| 144 | + } |
| 145 | + Job::batchInsert( $jobs ); |
| 146 | + } |
| 147 | +} |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/SIO_PageSchemas.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 148 | + native |
Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects.php |
— | — | @@ -0,0 +1,50 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Initialization file for Semantic Internal Objects. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup SemanticInternalObjects |
| 8 | + * @author Yaron Koren |
| 9 | + */ |
| 10 | + |
| 11 | +if ( !defined( 'MEDIAWIKI' ) ) die(); |
| 12 | + |
| 13 | +define( 'SIO_VERSION', '0.6.8' ); |
| 14 | + |
| 15 | +$wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'parserhook'][] = array( |
| 16 | + 'path' => __FILE__, |
| 17 | + 'name' => 'Semantic Internal Objects', |
| 18 | + 'version' => SIO_VERSION, |
| 19 | + 'author' => 'Yaron Koren', |
| 20 | + 'url' => 'https://www.mediawiki.org/wiki/Extension:Semantic_Internal_Objects', |
| 21 | + 'descriptionmsg' => 'semanticinternalobjects-desc', |
| 22 | +); |
| 23 | + |
| 24 | +$wgHooks['ParserFirstCallInit'][] = 'siofRegisterParserFunctions'; |
| 25 | +$wgHooks['ParserClearState'][] = 'SIOHandler::clearState'; |
| 26 | +$wgHooks['SMWSQLStore2::updateDataAfter'][] = 'SIOHandler::updateData'; |
| 27 | +$wgHooks['SMWSQLStore2::deleteSubjectAfter'][] = 'SIOHandler::deleteData'; |
| 28 | +$wgHooks['smwUpdatePropertySubjects'][] = 'SIOHandler::handleUpdatingOfInternalObjects'; |
| 29 | +$wgHooks['TitleMoveComplete'][] = 'SIOHandler::handlePageMove'; |
| 30 | +$wgHooks['smwRefreshDataJobs'][] = 'SIOHandler::handleRefreshingOfInternalObjects'; |
| 31 | +$wgHooks['smwAddToRDFExport'][] = 'SIOSQLStore::createRDF'; |
| 32 | +$wgHooks['PageSchemasRegisterHandlers'][] = 'SIOPageSchemas::registerClass'; |
| 33 | + |
| 34 | +$siogIP = dirname( __FILE__ ); |
| 35 | +$wgExtensionMessagesFiles['SemanticInternalObjects'] = $siogIP . '/SemanticInternalObjects.i18n.php'; |
| 36 | +$wgExtensionMessagesFiles['SemanticInternalObjectsMagic'] = $siogIP . '/SemanticInternalObjects.i18n.magic.php'; |
| 37 | +$wgAutoloadClasses['SIOHandler'] = $siogIP . '/SemanticInternalObjects_body.php'; |
| 38 | +$wgAutoloadClasses['SIOSQLStore'] = $siogIP . '/SemanticInternalObjects_body.php'; |
| 39 | +if ( class_exists( 'SMWDIWikiPage' ) ) { |
| 40 | + // SMW >= 1.6 |
| 41 | + $wgAutoloadClasses['SIOInternalObjectValue'] = $siogIP . '/SIO_RDFClasses2.php'; |
| 42 | +} else { |
| 43 | + $wgAutoloadClasses['SIOInternalObjectValue'] = $siogIP . '/SIO_RDFClasses.php'; |
| 44 | +} |
| 45 | +$wgAutoloadClasses['SIOPageSchemas'] = $siogIP . '/SIO_PageSchemas.php'; |
| 46 | + |
| 47 | +function siofRegisterParserFunctions( &$parser ) { |
| 48 | + $parser->setFunctionHook( 'set_internal', array( 'SIOHandler', 'doSetInternal' ) ); |
| 49 | + $parser->setFunctionHook( 'set_internal_recurring_event', array( 'SIOHandler', 'doSetInternalRecurringEvent' ) ); |
| 50 | + return true; // always return true, in order not to stop MW's hook processing! |
| 51 | +} |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 52 | + native |
Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/SIO_RDFClasses.php |
— | — | @@ -0,0 +1,62 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Classes that enable correct RDF export of Semantic Internal Objects data. |
| 6 | + * This file holds the versions of these classes necessary for SMW 1.5 only. |
| 7 | + * |
| 8 | + * @author Yaron Koren |
| 9 | + */ |
| 10 | + |
| 11 | +class SIOTitle { |
| 12 | + function __construct ($name, $namespace) { |
| 13 | + $this->mName = $name; |
| 14 | + $this->mNamespace = $namespace; |
| 15 | + } |
| 16 | + |
| 17 | + /** |
| 18 | + * Based on functions in Title class |
| 19 | + */ |
| 20 | + function getPrefixedName() { |
| 21 | + $s = ''; |
| 22 | + if ( 0 != $this->mNamespace ) { |
| 23 | + global $wgContLang; |
| 24 | + $s .= $wgContLang->getNsText( $this->mNamespace ) . ':'; |
| 25 | + } |
| 26 | + $s .= $this->mName; |
| 27 | + return $s; |
| 28 | + } |
| 29 | + |
| 30 | + function getPrefixedURL() { |
| 31 | + $s = $this->getPrefixedName(); |
| 32 | + return wfUrlencode( str_replace( ' ', '_', $s ) ); |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +class SIOInternalObjectValue extends SMWWikiPageValue { |
| 37 | + function __construct($name, $namespace) { |
| 38 | + $this->mSIOTitle = new SIOTitle( $name, $namespace ); |
| 39 | + } |
| 40 | + |
| 41 | + function getExportData() { |
| 42 | + global $smwgNamespace; |
| 43 | + return new SMWExpData( new SMWExpResource( SIOExporter::getResolverURL() . $this->mSIOTitle->getPrefixedURL() ) ); |
| 44 | + } |
| 45 | + |
| 46 | + function getTitle() { |
| 47 | + return $this->mSIOTitle; |
| 48 | + } |
| 49 | + |
| 50 | + function getWikiValue() { |
| 51 | + return $this->mSIOTitle->getPrefixedName(); |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +/** |
| 56 | + * Class to work around the fact that SMWExporter::$m_ent_wiki is protected. |
| 57 | + **/ |
| 58 | +class SIOExporter extends SMWExporter { |
| 59 | + |
| 60 | + static function getResolverURL() { |
| 61 | + return SMWExporter::$m_ent_wiki; |
| 62 | + } |
| 63 | +} |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/SIO_RDFClasses.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 64 | + native |
Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/SIO_RDFClasses2.php |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Classes that enable correct RDF export of Semantic Internal Objects data. |
| 6 | + * This file holds the versions of these classes necessary for SMW >= 1.6. |
| 7 | + * |
| 8 | + * @author Yaron Koren |
| 9 | + */ |
| 10 | + |
| 11 | +class SIOTitle { |
| 12 | + function __construct ($name, $namespace) { |
| 13 | + $this->mName = $name; |
| 14 | + $this->mNamespace = $namespace; |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +/** |
| 19 | + * @TODO - should this take advantage of the "internal object"/sub-object/ |
| 20 | + * blank-node functionality in SMW 1.6, put in place for use by the Record |
| 21 | + * type? For now, just ignore that. |
| 22 | + */ |
| 23 | +class SIOInternalObjectValue extends SMWDIWikiPage { |
| 24 | + function __construct($name, $namespace) { |
| 25 | + $this->mSIOTitle = new SIOTitle( $name, $namespace ); |
| 26 | + } |
| 27 | + |
| 28 | + function getDBkey() { |
| 29 | + return $this->mSIOTitle->mName; |
| 30 | + } |
| 31 | + |
| 32 | + function getNamespace() { |
| 33 | + return $this->mSIOTitle->mNamespace; |
| 34 | + } |
| 35 | +} |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/SIO_RDFClasses2.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 36 | + native |
Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/README |
— | — | @@ -0,0 +1,89 @@ |
| 2 | +Semantic Internal Objects Extension |
| 3 | + |
| 4 | + Version 0.6.8 |
| 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 Internal Objects is an extension to MediaWiki that defines a |
| 14 | +parser function, '#set_internal', that is used to define "internal objects" |
| 15 | +within the Semantic MediaWiki system. There are complex types of |
| 16 | +information sometimes known as 'n-ary relations' that involve more than one |
| 17 | +data value associated together. A simple example is in a cooking recipe; a |
| 18 | +recipe may call for 1 cup of flour, and the values "1", "cup" and "flour" |
| 19 | +must be encoded together; by themselves, the values are not meaningful (the |
| 20 | +third value has meaning, though not all of the meaning it could have). Such |
| 21 | +information can be stored already in SMW using multi-valued properties, |
| 22 | +though this approach is not flexible and currently leads to querying problems. |
| 23 | +Instead, #set_internal can be used to define "internal objects" within a page, |
| 24 | +which can then be queried as normal SMW pages would; a row of a recipe would |
| 25 | +be a good example of data that could be defined using #set_internal. |
| 26 | + |
| 27 | +The syntax of #set_internal is as follows: |
| 28 | + |
| 29 | +{{#set_internal:object_to_page_property |
| 30 | +|property1=value1 |
| 31 | +|property2=value2 |
| 32 | +... |
| 33 | +}} |
| 34 | + |
| 35 | +A sample call to #set_internal would be: |
| 36 | + |
| 37 | +{{#set_internal:Has recipe |
| 38 | +|Has quantity=1 |
| 39 | +|Has unit=cup |
| 40 | +|Has ingredient=flour |
| 41 | +}} |
| 42 | + |
| 43 | +This call would be placed in a page for a recipe, and it would define an object |
| 44 | +that had an automatically-generated name; if it were in a page called "Carrot |
| 45 | +cake", for instance, the object would be called "Carrot cake#1". If that page |
| 46 | +had subsequent calls to #set_internal, the objects that those calls generated |
| 47 | +would be called "Carrot cake#2", "Carrot cake#3", etc. |
| 48 | + |
| 49 | +It should be noted that #set_internal does not display anything to the screen; |
| 50 | +display of the values has to be handled separately (this can be done easily |
| 51 | +if the function is called from a template). |
| 52 | + |
| 53 | +Internal objects, once stored, can be queried as if they were wiki pages. So |
| 54 | +the following query would show a table of all the recipes that contain more |
| 55 | +than 1/2 a cup of flour, and the number of cups they contain: |
| 56 | + |
| 57 | +{{#ask:[[Has recipe::+]][[Has ingredient::flour]][[Has unit::cup]][[Has quantity::>.5]] |
| 58 | +|mainlabel=- |
| 59 | +|? Has recipe |
| 60 | +|? Has quantity |
| 61 | +}} |
| 62 | + |
| 63 | +Note the "mainlabel=-" parameter in the query: that hides the names of the |
| 64 | +internal objects from users, since those names are meaningless. |
| 65 | + |
| 66 | +For more information, see the extension homepage at: |
| 67 | +http://www.mediawiki.org/wiki/Extension:Semantic_Internal_Objects |
| 68 | + |
| 69 | +== Requirements == |
| 70 | + |
| 71 | +This version of the Semantic Internal Objects extension requires MediaWiki 1.11 |
| 72 | +or higher and Semantic MediaWiki 1.5.2 or higher. |
| 73 | + |
| 74 | +== Installation == |
| 75 | + |
| 76 | +To install the extension, place the entire 'SemanticInternalObjects' directory |
| 77 | +within your MediaWiki 'extensions' directory, then add the following |
| 78 | +line to your 'LocalSettings.php' file: |
| 79 | + |
| 80 | + require_once( "$IP/extensions/SemanticInternalObjects/SemanticInternalObjects.php" ); |
| 81 | + |
| 82 | +== Contact == |
| 83 | + |
| 84 | +Most comments, questions, suggestions and bug reports should be sent to |
| 85 | +the Semantic MediaWiki mailing list: |
| 86 | + |
| 87 | + https://lists.sourceforge.net/lists/listinfo/semediawiki-user |
| 88 | + |
| 89 | +If possible, please add "[SIO]" at the beginning of the subject line, to |
| 90 | +clarify the subject matter. |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/README |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 91 | + native |
Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects.i18n.magic.php |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * |
| 5 | + */ |
| 6 | + |
| 7 | +$magicWords = array(); |
| 8 | + |
| 9 | +/** English (English) */ |
| 10 | +$magicWords['en'] = array( |
| 11 | + 'set_internal' => array( 0, 'set_internal' ), |
| 12 | + 'set_internal_recurring_event' => array( 0, 'set_internal_recurring_event' ), |
| 13 | +); |
| 14 | + |
| 15 | +/** Arabic (العربية) */ |
| 16 | +$magicWords['ar'] = array( |
| 17 | + 'set_internal' => array( 0, 'ضبط_داخلي' ), |
| 18 | +); |
| 19 | + |
| 20 | +/** Egyptian Spoken Arabic (مصرى) */ |
| 21 | +$magicWords['arz'] = array( |
| 22 | + 'set_internal' => array( 0, 'ضبط_داخلي', 'set_internal' ), |
| 23 | +); |
| 24 | + |
| 25 | +/** German (Deutsch) */ |
| 26 | +$magicWords['de'] = array( |
| 27 | + 'set_internal' => array( 0, 'setze_intern' ), |
| 28 | +); |
| 29 | + |
| 30 | +/** Japanese (日本語) */ |
| 31 | +$magicWords['ja'] = array( |
| 32 | + 'set_internal' => array( 0, '内部設定' ), |
| 33 | +); |
| 34 | + |
| 35 | +/** Macedonian (Македонски) */ |
| 36 | +$magicWords['mk'] = array( |
| 37 | + 'set_internal' => array( 0, 'задај_внатрешни' ), |
| 38 | +); |
| 39 | + |
| 40 | +/** Dutch (Nederlands) */ |
| 41 | +$magicWords['nl'] = array( |
| 42 | + 'set_internal' => array( 0, 'intern_instellen' ), |
| 43 | +); |
| 44 | + |
| 45 | +/** Serbian (Latin script) (Srpski (latinica)) */ |
| 46 | +$magicWords['sr-el'] = array( |
| 47 | + 'set_internal' => array( 0, 'postavi_unutrašnje' ), |
| 48 | +); |
\ No newline at end of file |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects.i18n.magic.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 49 | + native |
Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects_body.php |
— | — | @@ -0,0 +1,498 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Main classes used by the Semantic Internal Objects extension. |
| 5 | + * |
| 6 | + * @author Yaron Koren |
| 7 | + */ |
| 8 | + |
| 9 | +/** |
| 10 | + * Class that holds information on a single internal object, including all |
| 11 | + * its properties. |
| 12 | + */ |
| 13 | +class SIOInternalObject { |
| 14 | + protected $mMainTitle; |
| 15 | + protected $mIndex; |
| 16 | + protected $mPropertyValuePairs; |
| 17 | + |
| 18 | + public function SIOInternalObject( $mainTitle, $index ) { |
| 19 | + $this->mMainTitle = $mainTitle; |
| 20 | + $this->mIndex = $index; |
| 21 | + $this->mPropertyValuePairs = array(); |
| 22 | + } |
| 23 | + |
| 24 | + public function addPropertyAndValue( $propName, $value ) { |
| 25 | + // SMW 1.6+ |
| 26 | + if ( class_exists( 'SMWDIProperty' ) ) { |
| 27 | + $property = SMWDIProperty::newFromUserLabel( $propName ); |
| 28 | + } else { |
| 29 | + $property = SMWPropertyValue::makeUserProperty( $propName ); |
| 30 | + } |
| 31 | + $dataValue = SMWDataValueFactory::newPropertyObjectValue( $property, $value ); |
| 32 | + |
| 33 | + if ( $dataValue->isValid() ) { |
| 34 | + $this->mPropertyValuePairs[] = array( $property, $dataValue ); |
| 35 | + } // else - show an error message? |
| 36 | + } |
| 37 | + |
| 38 | + public function getPropertyValuePairs() { |
| 39 | + return $this->mPropertyValuePairs; |
| 40 | + } |
| 41 | + |
| 42 | + public function getName() { |
| 43 | + return $this->mMainTitle->getDBkey() . '#' . $this->mIndex; |
| 44 | + } |
| 45 | + |
| 46 | + public function getNamespace() { |
| 47 | + return $this->mMainTitle->getNamespace(); |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +/** |
| 52 | + * Class for all database-related actions. |
| 53 | + * This class exists mostly because SMWSQLStore2's functions makeSMWPageID() |
| 54 | + * and makeSMWPropertyID(), which are needed for the DB access, are both |
| 55 | + * protected, and thus can't be accessed externally. |
| 56 | + */ |
| 57 | +class SIOSQLStore extends SMWSQLStore2 { |
| 58 | + |
| 59 | + static function deleteDataForPage( $subject ) { |
| 60 | + $pageName = $subject->getDBKey(); |
| 61 | + $namespace = $subject->getNamespace(); |
| 62 | + $idsForDeletion = array(); |
| 63 | + |
| 64 | + // Get the set of IDs for internal objects to be deleted. |
| 65 | + $iw = ''; |
| 66 | + $db = wfGetDB( DB_SLAVE ); |
| 67 | + $res = $db->select( |
| 68 | + 'smw_ids', |
| 69 | + array( 'smw_id' ), |
| 70 | + 'smw_title LIKE ' . $db->addQuotes( $pageName . '#%' ) . ' AND ' . 'smw_namespace=' . $db->addQuotes( $namespace ) . ' AND smw_iw=' . $db->addQuotes( $iw ), |
| 71 | + 'SIO::getSMWPageObjectIDs' |
| 72 | + ); |
| 73 | + |
| 74 | + while ( $row = $db->fetchObject( $res ) ) { |
| 75 | + $idsForDeletion[] = $row->smw_id; |
| 76 | + } |
| 77 | + |
| 78 | + if ( count( $idsForDeletion ) == 0 ) { |
| 79 | + return; |
| 80 | + } |
| 81 | + |
| 82 | + // Now, do the deletion. |
| 83 | + $db = wfGetDB( DB_MASTER ); |
| 84 | + $idsString = '(' . implode ( ', ', $idsForDeletion ) . ')'; |
| 85 | + $db->delete( 'smw_rels2', array( "(s_id IN $idsString) OR (o_id IN $idsString)" ), 'SIO::deleteRels2Data' ); |
| 86 | + $db->delete( 'smw_atts2', array( "s_id IN $idsString" ), 'SIO::deleteAtts2Data' ); |
| 87 | + $db->delete( 'smw_text2', array( "s_id IN $idsString" ), 'SIO::deleteText2Data' ); |
| 88 | + // Handle the sm_coords table only if the Semantic Maps |
| 89 | + // extension is installed and uses sm_coords. |
| 90 | + if ( defined( 'SM_VERSION' ) && version_compare( SM_VERSION, '0.6' ) >= 0 ) { |
| 91 | + $db->delete( 'sm_coords', array( "s_id IN $idsString" ), 'SIO::deleteCoordsData' ); |
| 92 | + } |
| 93 | + } |
| 94 | + |
| 95 | + /** |
| 96 | + * Returns the set of SQL values needed to insert the data for this |
| 97 | + * internal object into the database. |
| 98 | + */ |
| 99 | + function getStorageSQL( $internalObject ) { |
| 100 | + if ( method_exists( 'SMWDIWikiPage', 'getSubobjectName' ) ) { |
| 101 | + // SMW 1.6 |
| 102 | + $ioID = $this->makeSMWPageID( $internalObject->getName(), $internalObject->getNamespace(), '', '' ); |
| 103 | + } else { |
| 104 | + $ioID = $this->makeSMWPageID( $internalObject->getName(), $internalObject->getNamespace(), '' ); |
| 105 | + } |
| 106 | + $upRels2 = array(); |
| 107 | + $upAtts2 = array(); |
| 108 | + $upText2 = array(); |
| 109 | + $upCoords = array(); |
| 110 | + // set all the properties pointing from this internal object |
| 111 | + foreach ( $internalObject->getPropertyValuePairs() as $propertyValuePair ) { |
| 112 | + list( $property, $value ) = $propertyValuePair; |
| 113 | + |
| 114 | + $tableid = SMWSQLStore2::findPropertyTableID( $property ); |
| 115 | + $isRelation = ( $tableid == 'smw_rels2' ); |
| 116 | + $isAttribute = ( $tableid == 'smw_atts2' ); |
| 117 | + $isText = ( $tableid == 'smw_text2' ); |
| 118 | + $isCoords = ( $tableid == 'smw_coords' ); |
| 119 | + |
| 120 | + if ( $isRelation ) { |
| 121 | + if ( method_exists( 'SMWDIWikiPage', 'getSubobjectName' ) ) { |
| 122 | + // SMW 1.6 |
| 123 | + $mainPageID = $this->makeSMWPageID( $value->getDBkey(), $value->getNamespace(), $value->getInterwiki(), '' ); |
| 124 | + } else { |
| 125 | + $mainPageID = $this->makeSMWPageID( $value->getDBkey(), $value->getNamespace(), $value->getInterwiki() ); |
| 126 | + } |
| 127 | + $upRels2[] = array( |
| 128 | + 's_id' => $ioID, |
| 129 | + 'p_id' => $this->makeSMWPropertyID( $property ), |
| 130 | + 'o_id' => $mainPageID |
| 131 | + ); |
| 132 | + } elseif ( $isAttribute ) { |
| 133 | + if ( class_exists( 'SMWCompatibilityHelpers' ) ) { |
| 134 | + // SMW 1.6 |
| 135 | + $dataItem = $value->getDataItem(); |
| 136 | + $keys = SMWCompatibilityHelpers::getDBkeysFromDataItem( $dataItem ); |
| 137 | + $valueNum = $dataItem->getSortKey(); |
| 138 | + } else { |
| 139 | + $keys = $value->getDBkeys(); |
| 140 | + if ( method_exists( $value, 'getValueKey' ) ) { |
| 141 | + $valueNum = $value->getValueKey(); |
| 142 | + } else { |
| 143 | + $valueNum = $value->getNumericValue(); |
| 144 | + } |
| 145 | + } |
| 146 | + |
| 147 | + $upAttr = array( |
| 148 | + 's_id' => $ioID, |
| 149 | + 'p_id' => $this->makeSMWPropertyID( $property ), |
| 150 | + 'value_xsd' => $keys[0], |
| 151 | + 'value_num' => $valueNum |
| 152 | + ); |
| 153 | + |
| 154 | + // 'value_unit' DB field was removed in SMW 1.6 |
| 155 | + if ( version_compare( SMW_VERSION, '1.6 alpha', '<' ) ) { |
| 156 | + $upAttr['value_unit'] = $value->getUnit(); |
| 157 | + } |
| 158 | + |
| 159 | + $upAtts2[] = $upAttr; |
| 160 | + } elseif ( $isText ) { |
| 161 | + if ( method_exists( $value, 'getShortWikiText' ) ) { |
| 162 | + // SMW 1.6 |
| 163 | + $key = $value->getShortWikiText(); |
| 164 | + } else { |
| 165 | + $keys = $value->getDBkeys(); |
| 166 | + $key = $keys[0]; |
| 167 | + } |
| 168 | + $upText2[] = array( |
| 169 | + 's_id' => $ioID, |
| 170 | + 'p_id' => $this->makeSMWPropertyID( $property ), |
| 171 | + 'value_blob' => $key |
| 172 | + ); |
| 173 | + } elseif ( $isCoords ) { |
| 174 | + $keys = $value->getDBkeys(); |
| 175 | + $upCoords[] = array( |
| 176 | + 's_id' => $ioID, |
| 177 | + 'p_id' => $this->makeSMWPropertyID( $property ), |
| 178 | + 'lat' => $keys[0], |
| 179 | + 'lon' => $keys[1], |
| 180 | + ); |
| 181 | + } |
| 182 | + } |
| 183 | + |
| 184 | + return array( $upRels2, $upAtts2, $upText2, $upCoords ); |
| 185 | + } |
| 186 | + |
| 187 | + static function createRDF( $title, $rdfDataArray, $fullexport = true, $backlinks = false ) { |
| 188 | + // if it's not a full export, don't add internal object data |
| 189 | + if ( !$fullexport ) { |
| 190 | + return true; |
| 191 | + } |
| 192 | + |
| 193 | + $pageName = $title->getDBkey(); |
| 194 | + $namespace = $title->getNamespace(); |
| 195 | + |
| 196 | + // Go through all SIOs for the current page, create RDF for |
| 197 | + // each one, and add it to the general array. |
| 198 | + $iw = ''; |
| 199 | + $db = wfGetDB( DB_SLAVE ); |
| 200 | + $res = $db->select( |
| 201 | + 'smw_ids', |
| 202 | + array( 'smw_id', 'smw_namespace', 'smw_title' ), |
| 203 | + 'smw_title LIKE ' . $db->addQuotes( $pageName . '#%' ) . ' AND ' . 'smw_namespace=' . $db->addQuotes( $namespace ) . ' AND smw_iw=' . $db->addQuotes( $iw ), |
| 204 | + 'SIO::getSMWPageObjectIDs' |
| 205 | + ); |
| 206 | + |
| 207 | + while ( $row = $db->fetchObject( $res ) ) { |
| 208 | + $value = new SIOInternalObjectValue( $row->smw_title, intval( $row->smw_namespace ) ); |
| 209 | + if ( class_exists( 'SMWSqlStubSemanticData' ) ) { |
| 210 | + // SMW >= 1.6 |
| 211 | + $semdata = new SMWSqlStubSemanticData( $value, false ); |
| 212 | + } else { |
| 213 | + $semdata = new SMWSemanticData( $value, false ); |
| 214 | + } |
| 215 | + $propertyTables = SMWSQLStore2::getPropertyTables(); |
| 216 | + foreach ( $propertyTables as $tableName => $propertyTable ) { |
| 217 | + $data = smwfGetStore()->fetchSemanticData( $row->smw_id, null, $propertyTable ); |
| 218 | + foreach ( $data as $d ) { |
| 219 | + $semdata->addPropertyStubValue( reset( $d ), end( $d ) ); |
| 220 | + } |
| 221 | + } |
| 222 | + |
| 223 | + $rdfDataArray[] = SMWExporter::makeExportData( $semdata, null ); |
| 224 | + } |
| 225 | + |
| 226 | + return true; |
| 227 | + } |
| 228 | +} |
| 229 | + |
| 230 | +/** |
| 231 | + * Class for hook functions for creating and storing information |
| 232 | + */ |
| 233 | +class SIOHandler { |
| 234 | + |
| 235 | + static $mCurPageFullName = ''; |
| 236 | + static $mInternalObjectIndex = 1; |
| 237 | + static $mInternalObjects = array(); |
| 238 | + static $mHandledPages = array(); |
| 239 | + |
| 240 | + /** |
| 241 | + * Called with the 'ParserClearState' hook, when more than one page |
| 242 | + * is parsed in a single action. |
| 243 | + */ |
| 244 | + public static function clearState( &$parser ) { |
| 245 | + // For some reason, the #set_internal calls on a page are |
| 246 | + // sometimes called twice (or more?). Ideally, there would |
| 247 | + // be a way to prevent that, but until then, we use the |
| 248 | + // $mHandledPages array to store pages whose internal objects |
| 249 | + // have already been created - if doSetInternal() is called |
| 250 | + // on a page whose name is already is in this array, the |
| 251 | + // page is ignored. |
| 252 | + if ( ! empty( self::$mCurPageFullName ) ) { |
| 253 | + self::$mHandledPages[] = self::$mCurPageFullName; |
| 254 | + } |
| 255 | + |
| 256 | + self::$mCurPageFullName = ''; |
| 257 | + self::$mInternalObjectIndex = 1; |
| 258 | + |
| 259 | + return true; |
| 260 | + } |
| 261 | + |
| 262 | + /** |
| 263 | + * Handle the #set_internal parser function. |
| 264 | + */ |
| 265 | + public static function doSetInternal( &$parser ) { |
| 266 | + $title = $parser->getTitle(); |
| 267 | + $mainPageFullName = $title->getText(); |
| 268 | + if ( ( $nsText = $title->getNsText() ) != '' ) { |
| 269 | + $mainPageFullName = $nsText . ':' . $mainPageFullName; |
| 270 | + } |
| 271 | + |
| 272 | + if ( in_array( $mainPageFullName, self::$mHandledPages ) ) { |
| 273 | + // The #set_internal calls for this page have already |
| 274 | + // been processed! Skip it. |
| 275 | + return; |
| 276 | + } |
| 277 | + |
| 278 | + if ( $mainPageFullName == self::$mCurPageFullName ) { |
| 279 | + self::$mInternalObjectIndex++; |
| 280 | + } else { |
| 281 | + self::$mCurPageFullName = $mainPageFullName; |
| 282 | + self::$mInternalObjectIndex = 1; |
| 283 | + } |
| 284 | + |
| 285 | + $curObjectNum = self::$mInternalObjectIndex; |
| 286 | + $params = func_get_args(); |
| 287 | + array_shift( $params ); // we already know the $parser... |
| 288 | + $internalObject = new SIOInternalObject( $title, $curObjectNum ); |
| 289 | + $objToPagePropName = array_shift( $params ); |
| 290 | + $internalObject->addPropertyAndValue( $objToPagePropName, self::$mCurPageFullName ); |
| 291 | + |
| 292 | + foreach ( $params as $param ) { |
| 293 | + $parts = explode( '=', trim( $param ), 2 ); |
| 294 | + |
| 295 | + if ( count( $parts ) == 2 ) { |
| 296 | + $key = $parts[0]; |
| 297 | + $value = $parts[1]; |
| 298 | + // if the property name ends with '#list', it's |
| 299 | + // a comma-delimited group of values |
| 300 | + if ( substr( $key, - 5 ) == '#list' ) { |
| 301 | + $key = substr( $key, 0, strlen( $key ) - 5 ); |
| 302 | + $listValues = explode( ',', $value ); |
| 303 | + |
| 304 | + foreach ( $listValues as $listValue ) { |
| 305 | + $internalObject->addPropertyAndValue( $key, trim( $listValue ) ); |
| 306 | + } |
| 307 | + } else { |
| 308 | + $internalObject->addPropertyAndValue( $key, $value ); |
| 309 | + } |
| 310 | + } |
| 311 | + } |
| 312 | + |
| 313 | + self::$mInternalObjects[] = $internalObject; |
| 314 | + } |
| 315 | + |
| 316 | + /** |
| 317 | + * Handle the #set_internal_recurring_event parser function. |
| 318 | + */ |
| 319 | + public static function doSetInternalRecurringEvent( &$parser ) { |
| 320 | + $params = func_get_args(); |
| 321 | + array_shift( $params ); // We already know the $parser ... |
| 322 | + |
| 323 | + // First param should be a standalone property name. |
| 324 | + $objToPagePropName = array_shift( $params ); |
| 325 | + |
| 326 | + // The location of this function changed in SMW 1.5.3 |
| 327 | + if ( class_exists( 'SMWSetRecurringEvent' ) ) { |
| 328 | + $results = SMWSetRecurringEvent::getDatesForRecurringEvent( $params ); |
| 329 | + } else { |
| 330 | + $results = SMWParserExtensions::getDatesForRecurringEvent( $params ); |
| 331 | + } |
| 332 | + |
| 333 | + if ( $results == null ) { |
| 334 | + return null; |
| 335 | + } |
| 336 | + |
| 337 | + list( $property, $all_date_strings, $unused_params ) = $results; |
| 338 | + |
| 339 | + // Mimic a call to #set_internal for each date. |
| 340 | + foreach ( $all_date_strings as $date_string ) { |
| 341 | + $first_params = array( |
| 342 | + &$parser, |
| 343 | + $objToPagePropName, |
| 344 | + "$property=$date_string" |
| 345 | + ); |
| 346 | + |
| 347 | + $cur_params = array_merge( $first_params, $unused_params ); |
| 348 | + call_user_func_array( 'SIOHandler::doSetInternal', $cur_params ); |
| 349 | + } |
| 350 | + } |
| 351 | + |
| 352 | + /** |
| 353 | + * Called when a page is deleted. |
| 354 | + */ |
| 355 | + public static function deleteData( $sqlStore, $subject ) { |
| 356 | + SIOSQLStore::deleteDataForPage( $subject ); |
| 357 | + return true; |
| 358 | + } |
| 359 | + |
| 360 | + /** |
| 361 | + * Called when a page's semantic data is updated - either it's been |
| 362 | + * modified, or one of its templates has been modified, or an SMW |
| 363 | + * "refresh data" action has been called. |
| 364 | + */ |
| 365 | + public static function updateData( $sqlStore, $data ) { |
| 366 | + $sioSQLStore = new SIOSQLStore(); |
| 367 | + // Find all "pages" in the SMW IDs table that are internal |
| 368 | + // objects for this page, and delete their properties from |
| 369 | + // the SMW tables. |
| 370 | + // Then save the current contents of the $mInternalObjects |
| 371 | + // array. |
| 372 | + $subject = $data->getSubject(); |
| 373 | + SIOSQLStore::deleteDataForPage( $subject ); |
| 374 | + |
| 375 | + $allRels2Inserts = array(); |
| 376 | + $allAtts2Inserts = array(); |
| 377 | + $allText2Inserts = array(); |
| 378 | + $allCoordsInserts = array(); |
| 379 | + |
| 380 | + foreach ( self::$mInternalObjects as $internalObject ) { |
| 381 | + list( $upRels2, $upAtts2, $upText2, $upCoords ) = $sioSQLStore->getStorageSQL( $internalObject ); |
| 382 | + $allRels2Inserts = array_merge( $allRels2Inserts, $upRels2 ); |
| 383 | + $allAtts2Inserts = array_merge( $allAtts2Inserts, $upAtts2 ); |
| 384 | + $allText2Inserts = array_merge( $allText2Inserts, $upText2 ); |
| 385 | + $allCoordsInserts = array_merge( $allCoordsInserts, $upCoords ); |
| 386 | + wfRunHooks( 'SIOHandler::updateData', array( $internalObject ) ); |
| 387 | + } |
| 388 | + |
| 389 | + // now save everything to the database, in a single transaction |
| 390 | + $db = wfGetDB( DB_MASTER ); |
| 391 | + $db->begin( 'SIO::updatePageData' ); |
| 392 | + |
| 393 | + if ( count( $allRels2Inserts ) > 0 ) { |
| 394 | + $db->insert( 'smw_rels2', $allRels2Inserts, 'SIO::updateRels2Data' ); |
| 395 | + } |
| 396 | + if ( count( $allAtts2Inserts ) > 0 ) { |
| 397 | + $db->insert( 'smw_atts2', $allAtts2Inserts, 'SIO::updateAtts2Data' ); |
| 398 | + } |
| 399 | + if ( count( $allText2Inserts ) > 0 ) { |
| 400 | + $db->insert( 'smw_text2', $allText2Inserts, 'SIO::updateText2Data' ); |
| 401 | + } |
| 402 | + if ( count( $allCoordsInserts ) > 0 ) { |
| 403 | + $db->insert( 'sm_coords', $allCoordsInserts, 'SIO::updateCoordsData' ); |
| 404 | + } |
| 405 | + |
| 406 | + // end transaction |
| 407 | + $db->commit( 'SIO::updatePageData' ); |
| 408 | + self::$mInternalObjects = array(); |
| 409 | + |
| 410 | + return true; |
| 411 | + } |
| 412 | + |
| 413 | + /** |
| 414 | + * Called after a page is moved - renames all the internal objects |
| 415 | + * named "Old page#x" to "New page#x". |
| 416 | + */ |
| 417 | + static public function handlePageMove( &$old_title, &$new_title, &$user, $page_id, $redir_id ) { |
| 418 | + $oldPageName = $old_title->getDBkey(); |
| 419 | + $oldNamespace = $old_title->getNamespace(); |
| 420 | + $newPageName = $new_title->getDBkey(); |
| 421 | + $newNamespace = $new_title->getNamespace(); |
| 422 | + $iw = ''; |
| 423 | + $sioNames = array(); |
| 424 | + $db = wfGetDB( DB_SLAVE ); |
| 425 | + // Unfortunately, there's no foolproof way to do the replacement |
| 426 | + // with a single SQL call, using regexps and wildcards - |
| 427 | + // instead, we first get the set of all matching entries in |
| 428 | + // the 'smw_ids' table, then call an explicit update on each |
| 429 | + // one. |
| 430 | + $res = $db->select( |
| 431 | + 'smw_ids', |
| 432 | + array( 'smw_title' ), |
| 433 | + 'smw_title LIKE ' . $db->addQuotes( $oldPageName . '#%' ) . ' AND ' . 'smw_namespace=' . $db->addQuotes( $oldNamespace ) . ' AND smw_iw=' . $db->addQuotes( $iw ), |
| 434 | + 'SIO::getTitlesForPageMove' |
| 435 | + ); |
| 436 | + |
| 437 | + while ( $row = $db->fetchObject( $res ) ) { |
| 438 | + $sioNames[] = $row->smw_title; |
| 439 | + } |
| 440 | + |
| 441 | + foreach ( $sioNames as $sioName ) { |
| 442 | + // update the name, and possibly the namespace as well |
| 443 | + $newSIOName = str_replace( $oldPageName, $newPageName, $sioName ); |
| 444 | + $db->update( |
| 445 | + 'smw_ids', |
| 446 | + array( 'smw_title' => $newSIOName, 'smw_namespace' => $newNamespace ), |
| 447 | + array( 'smw_title' => $sioName, 'smw_namespace' => $oldNamespace ), |
| 448 | + 'SIO::updateTitlesForPageMove' |
| 449 | + ); |
| 450 | + } |
| 451 | + |
| 452 | + return true; |
| 453 | + } |
| 454 | + |
| 455 | + /** |
| 456 | + * Takes a set of SMW "update jobs", and keeps only the unique, actual |
| 457 | + * titles among them - this is useful if there are any internal objects |
| 458 | + * among the group; a set of names like "Page name#1", "Page name#2" |
| 459 | + * etc. should be turned into just "Page name". |
| 460 | + */ |
| 461 | + static function handleUpdatingOfInternalObjects( &$jobs ) { |
| 462 | + $uniqueTitles = array(); |
| 463 | + |
| 464 | + foreach ( $jobs as $i => $job ) { |
| 465 | + $title = Title::makeTitleSafe( $job->title->getNamespace(), $job->title->getText() ); |
| 466 | + $id = $title->getArticleID(); |
| 467 | + $uniqueTitles[$id] = $title; |
| 468 | + } |
| 469 | + |
| 470 | + $jobs = array(); |
| 471 | + |
| 472 | + foreach ( $uniqueTitles as $id => $title ) { |
| 473 | + $jobs[] = new SMWUpdateJob( $title ); |
| 474 | + } |
| 475 | + |
| 476 | + return true; |
| 477 | + } |
| 478 | + |
| 479 | + /** |
| 480 | + * Takes a set of SMW "update jobs" generated by refresh data and removes |
| 481 | + * any job with a fragment (in other words a job trying to update a SIO object) |
| 482 | + * We aren't guaranteed that all the jobs related to a single page using SIO |
| 483 | + * will be in a single one of these batches so we remove everything updating |
| 484 | + * a SIO object instead of filtering them down to unique titles. |
| 485 | + */ |
| 486 | + static function handleRefreshingOfInternalObjects( &$jobs ) { |
| 487 | + $allJobs = $jobs; |
| 488 | + $jobs = array(); |
| 489 | + |
| 490 | + foreach ( $allJobs as $job ) { |
| 491 | + if ( strpos( $job->title->getText(), '#' ) === false ) { |
| 492 | + $jobs[] = $job; |
| 493 | + } |
| 494 | + } |
| 495 | + |
| 496 | + return true; |
| 497 | + } |
| 498 | + |
| 499 | +} |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects_body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 500 | + native |
Index: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects.i18n.php |
— | — | @@ -0,0 +1,369 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalization file for Semantic Internal Objects |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Language |
| 8 | + * @ingroup I18n |
| 9 | + * @ingroup SemanticInternalObjects |
| 10 | + */ |
| 11 | + |
| 12 | +$messages = array(); |
| 13 | + |
| 14 | +/** English |
| 15 | + * @author Yaron Koren |
| 16 | + */ |
| 17 | +$messages['en'] = array( |
| 18 | + 'semanticinternalobjects-desc' => 'Setting of internal objects in Semantic MediaWiki', |
| 19 | + 'semanticinternalobjects-internalproperty' => 'Internal property', |
| 20 | +); |
| 21 | + |
| 22 | +/** Message documentation (Message documentation) |
| 23 | + * @author Yaron Koren |
| 24 | + */ |
| 25 | +$messages['qqq'] = array( |
| 26 | + 'semanticinternalobjects-desc' => '{{desc}}', |
| 27 | + 'semanticinternalobjects-internalproperty' => 'A semantic property stored internally in the page', |
| 28 | +); |
| 29 | + |
| 30 | +/** Gheg Albanian (Gegë) |
| 31 | + * @author Mdupont |
| 32 | + */ |
| 33 | +$messages['aln'] = array( |
| 34 | + 'semanticinternalobjects-desc' => 'Vendosja e objekteve të brendshëm në Semantic MediaWiki', |
| 35 | +); |
| 36 | + |
| 37 | +/** Arabic (العربية) |
| 38 | + * @author Meno25 |
| 39 | + */ |
| 40 | +$messages['ar'] = array( |
| 41 | + 'semanticinternalobjects-desc' => 'ضبط الأشياء الداخلية في ميدياويكي الدلالي', |
| 42 | +); |
| 43 | + |
| 44 | +/** Asturian (Asturianu) |
| 45 | + * @author Xuacu |
| 46 | + */ |
| 47 | +$messages['ast'] = array( |
| 48 | + 'semanticinternalobjects-desc' => "Definición d'oxetos internos en Semantic MediaWiki", |
| 49 | + 'semanticinternalobjects-internalproperty' => 'Propiedá interna', |
| 50 | +); |
| 51 | + |
| 52 | +/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
| 53 | + * @author EugeneZelenko |
| 54 | + * @author Zedlik |
| 55 | + */ |
| 56 | +$messages['be-tarask'] = array( |
| 57 | + 'semanticinternalobjects-desc' => "Налады ўнутраных аб'ектаў у Semantic MediaWiki", |
| 58 | +); |
| 59 | + |
| 60 | +/** Breton (Brezhoneg) |
| 61 | + * @author Fulup |
| 62 | + */ |
| 63 | +$messages['br'] = array( |
| 64 | + 'semanticinternalobjects-desc' => 'Kefluniadur traezoù diabarzh e Semanctic MediaWiki', |
| 65 | + 'semanticinternalobjects-internalproperty' => 'Perzh diabarzh', |
| 66 | +); |
| 67 | + |
| 68 | +/** Bosnian (Bosanski) |
| 69 | + * @author CERminator |
| 70 | + */ |
| 71 | +$messages['bs'] = array( |
| 72 | + 'semanticinternalobjects-desc' => 'Postavljanje unutrašnjih objekata u Semantic MediaWiki', |
| 73 | +); |
| 74 | + |
| 75 | +/** Catalan (Català) |
| 76 | + * @author Toniher |
| 77 | + */ |
| 78 | +$messages['ca'] = array( |
| 79 | + 'semanticinternalobjects-desc' => "Definició d'objectes interns en el Semantic MediaWiki", |
| 80 | + 'semanticinternalobjects-internalproperty' => 'Propietat interna', |
| 81 | +); |
| 82 | + |
| 83 | +/** German (Deutsch) |
| 84 | + * @author Imre |
| 85 | + * @author Kghbln |
| 86 | + */ |
| 87 | +$messages['de'] = array( |
| 88 | + 'semanticinternalobjects-desc' => 'Ermöglicht das Definieren interner semantischer Datenobjekte', |
| 89 | + 'semanticinternalobjects-internalproperty' => 'Internes Attribut', |
| 90 | +); |
| 91 | + |
| 92 | +/** Lower Sorbian (Dolnoserbski) |
| 93 | + * @author Michawiki |
| 94 | + */ |
| 95 | +$messages['dsb'] = array( |
| 96 | + 'semanticinternalobjects-desc' => 'Nastajenje internych objektow w Semantic MediaWiki', |
| 97 | +); |
| 98 | + |
| 99 | +/** Greek (Ελληνικά) |
| 100 | + * @author Omnipaedista |
| 101 | + */ |
| 102 | +$messages['el'] = array( |
| 103 | + 'semanticinternalobjects-desc' => 'Ρυθμίσεις εσωτερικών αντικειμένων στη Σημασιολογική MediaWiki', |
| 104 | +); |
| 105 | + |
| 106 | +/** Spanish (Español) |
| 107 | + * @author Crazymadlover |
| 108 | + */ |
| 109 | +$messages['es'] = array( |
| 110 | + 'semanticinternalobjects-desc' => 'Configuración de objetos internos en Semantic MediaWiki', |
| 111 | +); |
| 112 | + |
| 113 | +/** Finnish (Suomi) |
| 114 | + * @author Centerlink |
| 115 | + * @author Crt |
| 116 | + */ |
| 117 | +$messages['fi'] = array( |
| 118 | + 'semanticinternalobjects-desc' => 'Sisäisten objektien asetukset semanttisessa MediaWikissä.', |
| 119 | +); |
| 120 | + |
| 121 | +/** French (Français) |
| 122 | + * @author Crochet.david |
| 123 | + * @author Gomoko |
| 124 | + */ |
| 125 | +$messages['fr'] = array( |
| 126 | + 'semanticinternalobjects-desc' => 'Réglage des objets internes dans Semantic MediaWiki', |
| 127 | + 'semanticinternalobjects-internalproperty' => 'Propriété interne', |
| 128 | +); |
| 129 | + |
| 130 | +/** Franco-Provençal (Arpetan) |
| 131 | + * @author ChrisPtDe |
| 132 | + */ |
| 133 | +$messages['frp'] = array( |
| 134 | + 'semanticinternalobjects-internalproperty' => 'Propriètât de dedens', |
| 135 | +); |
| 136 | + |
| 137 | +/** Galician (Galego) |
| 138 | + * @author Toliño |
| 139 | + */ |
| 140 | +$messages['gl'] = array( |
| 141 | + 'semanticinternalobjects-desc' => 'Configuracións de obxectos internos en Semantic MediaWiki', |
| 142 | + 'semanticinternalobjects-internalproperty' => 'Propiedade interna', |
| 143 | +); |
| 144 | + |
| 145 | +/** Swiss German (Alemannisch) |
| 146 | + * @author Als-Chlämens |
| 147 | + * @author Als-Holder |
| 148 | + */ |
| 149 | +$messages['gsw'] = array( |
| 150 | + 'semanticinternalobjects-desc' => 'Intärni Objäkt in Semantic MediaWiki yysetze', |
| 151 | + 'semanticinternalobjects-internalproperty' => 'Interns Attribut', |
| 152 | +); |
| 153 | + |
| 154 | +/** Hebrew (עברית) |
| 155 | + * @author Rotemliss |
| 156 | + * @author YaronSh |
| 157 | + */ |
| 158 | +$messages['he'] = array( |
| 159 | + 'semanticinternalobjects-desc' => 'הגדרות העצמים הפנימיים במדיה־ויקי הסמנטי', |
| 160 | +); |
| 161 | + |
| 162 | +/** Hiligaynon (Ilonggo) |
| 163 | + * @author Tagimata |
| 164 | + */ |
| 165 | +$messages['hil'] = array( |
| 166 | + 'semanticinternalobjects-desc' => 'Pagplastar sang internal na mga bagay sa Semantik MedyaWiki', |
| 167 | +); |
| 168 | + |
| 169 | +/** Upper Sorbian (Hornjoserbsce) |
| 170 | + * @author Michawiki |
| 171 | + */ |
| 172 | +$messages['hsb'] = array( |
| 173 | + 'semanticinternalobjects-desc' => 'Nastajenje internych objektow w Semantic MediaWiki', |
| 174 | + 'semanticinternalobjects-internalproperty' => 'Interna kajkosć', |
| 175 | +); |
| 176 | + |
| 177 | +/** Hungarian (Magyar) |
| 178 | + * @author Dj |
| 179 | + * @author Glanthor Reviol |
| 180 | + */ |
| 181 | +$messages['hu'] = array( |
| 182 | + 'semanticinternalobjects-desc' => 'Belső objektumok beállítása a szemantikus MediaWikiben', |
| 183 | + 'semanticinternalobjects-internalproperty' => 'Belső tulajdonság', |
| 184 | +); |
| 185 | + |
| 186 | +/** Interlingua (Interlingua) |
| 187 | + * @author McDutchie |
| 188 | + */ |
| 189 | +$messages['ia'] = array( |
| 190 | + 'semanticinternalobjects-desc' => 'Configuration de objectos interne in Semantic MediaWiki', |
| 191 | + 'semanticinternalobjects-internalproperty' => 'Proprietate interne', |
| 192 | +); |
| 193 | + |
| 194 | +/** Indonesian (Bahasa Indonesia) |
| 195 | + * @author Bennylin |
| 196 | + */ |
| 197 | +$messages['id'] = array( |
| 198 | + 'semanticinternalobjects-desc' => 'Seting untuk objek internal pada Semantic MediaWiki', |
| 199 | +); |
| 200 | + |
| 201 | +/** Italian (Italiano) |
| 202 | + * @author Gianfranco |
| 203 | + */ |
| 204 | +$messages['it'] = array( |
| 205 | + 'semanticinternalobjects-desc' => 'Configurazione degli oggetti interni in Semantic MediaWiki', |
| 206 | +); |
| 207 | + |
| 208 | +/** Japanese (日本語) |
| 209 | + * @author Fryed-peach |
| 210 | + */ |
| 211 | +$messages['ja'] = array( |
| 212 | + 'semanticinternalobjects-desc' => 'Semantic MediaWiki の内部オブジェクトの設定', |
| 213 | +); |
| 214 | + |
| 215 | +/** Colognian (Ripoarisch) |
| 216 | + * @author Purodha |
| 217 | + */ |
| 218 | +$messages['ksh'] = array( |
| 219 | + 'semanticinternalobjects-desc' => 'De ennere Objäkte vum Semantesch MedijaWiki enschtälle.', |
| 220 | + 'semanticinternalobjects-internalproperty' => 'Enner Eijeschaff', |
| 221 | +); |
| 222 | + |
| 223 | +/** Luxembourgish (Lëtzebuergesch) |
| 224 | + * @author Robby |
| 225 | + */ |
| 226 | +$messages['lb'] = array( |
| 227 | + 'semanticinternalobjects-desc' => 'Astellung vun internen Objeten a Semantic MediaWiki', |
| 228 | + 'semanticinternalobjects-internalproperty' => 'Intern Eegeschaft', |
| 229 | +); |
| 230 | + |
| 231 | +/** Macedonian (Македонски) |
| 232 | + * @author Bjankuloski06 |
| 233 | + */ |
| 234 | +$messages['mk'] = array( |
| 235 | + 'semanticinternalobjects-desc' => 'Задавање на внатрешни објекти во Семантички МедијаВики', |
| 236 | + 'semanticinternalobjects-internalproperty' => 'Внатрешно својство', |
| 237 | +); |
| 238 | + |
| 239 | +/** Malay (Bahasa Melayu) |
| 240 | + * @author Anakmalaysia |
| 241 | + */ |
| 242 | +$messages['ms'] = array( |
| 243 | + 'semanticinternalobjects-desc' => 'Penetapan objek dalaman di Semantic MediaWiki', |
| 244 | + 'semanticinternalobjects-internalproperty' => 'Harta dalaman', |
| 245 | +); |
| 246 | + |
| 247 | +/** Norwegian (bokmål) (Norsk (bokmål)) |
| 248 | + * @author Event |
| 249 | + * @author Nghtwlkr |
| 250 | + */ |
| 251 | +$messages['nb'] = array( |
| 252 | + 'semanticinternalobjects-desc' => 'Innstilling for interne objekter i Semantic MediaWiki', |
| 253 | + 'semanticinternalobjects-internalproperty' => 'Intern egenskap', |
| 254 | +); |
| 255 | + |
| 256 | +/** Dutch (Nederlands) |
| 257 | + * @author Siebrand |
| 258 | + */ |
| 259 | +$messages['nl'] = array( |
| 260 | + 'semanticinternalobjects-desc' => 'Interne objecten in Semantic MediaWiki instellen', |
| 261 | + 'semanticinternalobjects-internalproperty' => 'Interne eigenschap', |
| 262 | +); |
| 263 | + |
| 264 | +/** Occitan (Occitan) |
| 265 | + * @author Cedric31 |
| 266 | + */ |
| 267 | +$messages['oc'] = array( |
| 268 | + 'semanticinternalobjects-desc' => 'Reglatge dels objèctes intèrnes dins Semantic MediaWiki', |
| 269 | +); |
| 270 | + |
| 271 | +/** Polish (Polski) |
| 272 | + * @author Sp5uhe |
| 273 | + */ |
| 274 | +$messages['pl'] = array( |
| 275 | + 'semanticinternalobjects-desc' => 'Ustawianie wewnętrznych obiektów Semantic MediaWiki.', |
| 276 | +); |
| 277 | + |
| 278 | +/** Piedmontese (Piemontèis) |
| 279 | + * @author Dragonòt |
| 280 | + */ |
| 281 | +$messages['pms'] = array( |
| 282 | + 'semanticinternalobjects-desc' => "Ampostassion d'oget intern an drinta a Semantic MediaWiki", |
| 283 | + 'semanticinternalobjects-internalproperty' => 'Proprietà anterna', |
| 284 | +); |
| 285 | + |
| 286 | +/** Portuguese (Português) |
| 287 | + * @author Hamilton Abreu |
| 288 | + * @author Indech |
| 289 | + */ |
| 290 | +$messages['pt'] = array( |
| 291 | + 'semanticinternalobjects-desc' => 'Configuração de objetos internos no MediaWiki Semântico', |
| 292 | +); |
| 293 | + |
| 294 | +/** Brazilian Portuguese (Português do Brasil) |
| 295 | + * @author Eduardo.mps |
| 296 | + */ |
| 297 | +$messages['pt-br'] = array( |
| 298 | + 'semanticinternalobjects-desc' => 'Definição de objetos internos no Semantic MediaWiki', |
| 299 | +); |
| 300 | + |
| 301 | +/** Tarandíne (Tarandíne) |
| 302 | + * @author Joetaras |
| 303 | + */ |
| 304 | +$messages['roa-tara'] = array( |
| 305 | + 'semanticinternalobjects-desc' => "'Mboste le oggette inderne jndr'à MediaUicchi Semandiche", |
| 306 | +); |
| 307 | + |
| 308 | +/** Russian (Русский) |
| 309 | + * @author Александр Сигачёв |
| 310 | + */ |
| 311 | +$messages['ru'] = array( |
| 312 | + 'semanticinternalobjects-desc' => 'Установка внутренних объектов в Semantic MediaWiki', |
| 313 | +); |
| 314 | + |
| 315 | +/** Slovak (Slovenčina) |
| 316 | + * @author Helix84 |
| 317 | + */ |
| 318 | +$messages['sk'] = array( |
| 319 | + 'semanticinternalobjects-desc' => 'Nastavenie vnútorných objektov v Semantic MediaWiki', |
| 320 | +); |
| 321 | + |
| 322 | +/** Slovenian (Slovenščina) |
| 323 | + * @author Dbc334 |
| 324 | + * @author Lesko987 |
| 325 | + */ |
| 326 | +$messages['sl'] = array( |
| 327 | + 'semanticinternalobjects-desc' => 'Nastavitev notranjih predmetov v semantičnem MediaWiki', |
| 328 | + 'semanticinternalobjects-internalproperty' => 'Notranja lastnina', |
| 329 | +); |
| 330 | + |
| 331 | +/** Swedish (Svenska) |
| 332 | + * @author Per |
| 333 | + */ |
| 334 | +$messages['sv'] = array( |
| 335 | + 'semanticinternalobjects-desc' => 'Inställning för interna objekt i Semantic MediaWiki', |
| 336 | +); |
| 337 | + |
| 338 | +/** Tagalog (Tagalog) |
| 339 | + * @author AnakngAraw |
| 340 | + */ |
| 341 | +$messages['tl'] = array( |
| 342 | + 'semanticinternalobjects-desc' => 'Pagtatakda ng panloob na mga bagay sa Semantic MediaWiki', |
| 343 | +); |
| 344 | + |
| 345 | +/** Turkish (Türkçe) |
| 346 | + * @author Vito Genovese |
| 347 | + */ |
| 348 | +$messages['tr'] = array( |
| 349 | + 'semanticinternalobjects-desc' => "Anlamsal MediaWiki'deki iç nesnelerin ayarlanması", |
| 350 | +); |
| 351 | + |
| 352 | +/** Vietnamese (Tiếng Việt) |
| 353 | + * @author Minh Nguyen |
| 354 | + */ |
| 355 | +$messages['vi'] = array( |
| 356 | + 'semanticinternalobjects-desc' => 'Thiết kế các đối tượng nội bộ trong Semantic MediaWiki', |
| 357 | +); |
| 358 | + |
| 359 | +/** Simplified Chinese (中文(简体)) |
| 360 | + * @author Liangent |
| 361 | + */ |
| 362 | +$messages['zh-hans'] = array( |
| 363 | + 'semanticinternalobjects-desc' => '在语义MediaWiki中设置内部对象', |
| 364 | +); |
| 365 | + |
| 366 | +/** Traditional Chinese (中文(繁體)) */ |
| 367 | +$messages['zh-hant'] = array( |
| 368 | + 'semanticinternalobjects-desc' => '在語義MediaWiki中設置內部對象', |
| 369 | +); |
| 370 | + |
Property changes on: tags/extensions/SemanticInternalObjects/REL_0_6_8/SemanticInternalObjects.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 371 | + native |