r73292 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73291‎ | r73292 | r73293 >
Date:14:30, 18 September 2010
Author:siebrand
Status:deferred
Tags:
Comment:
* svn eol-style:native
* ran stylize.php
Modified paths:
  • /trunk/extensions/RDFIO/COPYING (modified) (history)
  • /trunk/extensions/RDFIO/INSTALL (modified) (history)
  • /trunk/extensions/RDFIO/RDFIO.php (modified) (history)
  • /trunk/extensions/RDFIO/README (modified) (history)
  • /trunk/extensions/RDFIO/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/RDFIO/bundle/ARC2_SPARQLSerializerPlugin.php (modified) (history)
  • /trunk/extensions/RDFIO/classes/PageHandler.php (modified) (history)
  • /trunk/extensions/RDFIO/classes/RDFStore.php (modified) (history)
  • /trunk/extensions/RDFIO/classes/SMWBatchWriter.php (modified) (history)
  • /trunk/extensions/RDFIO/classes/Utils.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialARC2Admin.alias.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialARC2Admin.i18n.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialARC2Admin.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialARC2Admin_body.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialRDFImport.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialRDFImport_body.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint.i18n.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint.php (modified) (history)
  • /trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint_body.php (modified) (history)
  • /trunk/extensions/RDFIO/stores/SMW_ARC2Store.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RDFIO/stores/SMW_ARC2Store.php
@@ -2,9 +2,9 @@
33
44 global $IP;
55
6 -require_once("$IP/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php");
 6+require_once( "$IP/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php" );
77
8 -if( !defined( 'MEDIAWIKI' ) ) {
 8+if ( !defined( 'MEDIAWIKI' ) ) {
99 die( 'Not a valid entry point.' );
1010 }
1111
@@ -22,28 +22,28 @@
2323 global $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword, $smwgARC2StoreConfig;
2424
2525 /* instantiation */
26 - $this->arc2store = ARC2::getStore($smwgARC2StoreConfig);
 26+ $this->arc2store = ARC2::getStore( $smwgARC2StoreConfig );
2727 }
2828
2929 /**
3030 * wraps removeDataForURI
3131 * @param $subject
3232 */
33 - function deleteSubject(Title $subject) {
34 - $subject_uri = SMWExporter::expandURI($this->getURI($subject));
35 - $this->removeDataForURI($subject_uri);
 33+ function deleteSubject( Title $subject ) {
 34+ $subject_uri = SMWExporter::expandURI( $this->getURI( $subject ) );
 35+ $this->removeDataForURI( $subject_uri );
3636
37 - return parent::deleteSubject($subject);
 37+ return parent::deleteSubject( $subject );
3838 }
3939
4040 /**
4141 * deletes triples that have $uri as subject
4242 * @param $uri
4343 */
44 - function removeDataForURI($uri) {
45 - $sparqlUpdateText = "DELETE { <".$uri."> ?x ?y . }";
46 - wfDebugLog('SPARQL_LOG', "===DELETE===\n".$sparqlUpdateText);
47 - $response = $this->do_arc2_query($sparqlUpdateText);
 44+ function removeDataForURI( $uri ) {
 45+ $sparqlUpdateText = "DELETE { <" . $uri . "> ?x ?y . }";
 46+ wfDebugLog( 'SPARQL_LOG', "===DELETE===\n" . $sparqlUpdateText );
 47+ $response = $this->do_arc2_query( $sparqlUpdateText );
4848 return $response;
4949 }
5050
@@ -51,18 +51,18 @@
5252 * Does update. First deletes, then inserts.
5353 * @param $data
5454 */
55 - function updateData(SMWSemanticData $data) {
56 - $export = SMWExporter::makeExportData($data);
57 - $subject_uri = SMWExporter::expandURI($export->getSubject()->getName());
 55+ function updateData( SMWSemanticData $data ) {
 56+ $export = SMWExporter::makeExportData( $data );
 57+ $subject_uri = SMWExporter::expandURI( $export->getSubject()->getName() );
5858
5959 // remove subject from triple store
60 - $this->removeDataForURI($subject_uri);
 60+ $this->removeDataForURI( $subject_uri );
6161
6262 $triple_list = $export->getTripleList();
6363
6464 $sparqlUpdateText = "INSERT INTO <> {\n";
6565
66 - foreach ($triple_list as $triple) {
 66+ foreach ( $triple_list as $triple ) {
6767
6868 $subject = $triple[0];
6969 $predicate = $triple[1];
@@ -72,23 +72,23 @@
7373 $sub_str = "";
7474 $pre_str = "";
7575
76 - if ($object instanceof SMWExpLiteral) {
77 - $obj_str = "\"".$object->getName()."\"".(($object->getDatatype() == "") ? "" : "^^<".$object->getDatatype().">");
78 - } else if ($object instanceof SMWExpResource) {
79 - $obj_str = "<".SMWExporter::expandURI($object->getName()).">";
 76+ if ( $object instanceof SMWExpLiteral ) {
 77+ $obj_str = "\"" . $object->getName() . "\"" . ( ( $object->getDatatype() == "" ) ? "" : "^^<" . $object->getDatatype() . ">" );
 78+ } else if ( $object instanceof SMWExpResource ) {
 79+ $obj_str = "<" . SMWExporter::expandURI( $object->getName() ) . ">";
8080 } else {
8181 $obj_str = "\"\"";
8282 }
8383
84 - if ($subject instanceof SMWExpResource) {
85 - $sub_str = "<".SMWExporter::expandURI($subject->getName()).">";
 84+ if ( $subject instanceof SMWExpResource ) {
 85+ $sub_str = "<" . SMWExporter::expandURI( $subject->getName() ) . ">";
8686 }
8787
88 - if ($predicate instanceof SMWExpResource) {
89 - $pre_str = "<".SMWExporter::expandURI($predicate->getName()).">";
 88+ if ( $predicate instanceof SMWExpResource ) {
 89+ $pre_str = "<" . SMWExporter::expandURI( $predicate->getName() ) . ">";
9090 }
9191
92 - $sparqlUpdateText .= $sub_str." ".$pre_str." ".$obj_str." .\n";
 92+ $sparqlUpdateText .= $sub_str . " " . $pre_str . " " . $obj_str . " .\n";
9393 }
9494 $sparqlUpdateText .= "}\n";
9595
@@ -96,22 +96,22 @@
9797 // var_dump();
9898 // TODO Debug-code
9999
100 - wfDebugLog('SPARQL_LOG', "===INSERT===\n".$sparqlUpdateText);
 100+ wfDebugLog( 'SPARQL_LOG', "===INSERT===\n" . $sparqlUpdateText );
101101
102 - $response = $this->do_arc2_query($sparqlUpdateText);
 102+ $response = $this->do_arc2_query( $sparqlUpdateText );
103103
104 - return parent::updateData($data);
 104+ return parent::updateData( $data );
105105 }
106106
107107 /**
108108 * Insert new pages into endpoint. Used to import data.
109109 * @param $title
110110 */
111 - function insertData(Title $title, $pageid) {
112 - $newpage = SMWDataValueFactory::newTypeIDValue('_wpg');
113 - $newpage->setValues($title->getDBkey(), $title->getNamespace(), $pageid);
114 - $semdata = $this->getSemanticData($newpage);
115 - $this->updateData($semdata);
 111+ function insertData( Title $title, $pageid ) {
 112+ $newpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
 113+ $newpage->setValues( $title->getDBkey(), $title->getNamespace(), $pageid );
 114+ $semdata = $this->getSemanticData( $newpage );
 115+ $this->updateData( $semdata );
116116 }
117117
118118 /**
@@ -121,25 +121,25 @@
122122 * @param $pageid
123123 * @param $redirid
124124 */
125 - function changeTitle(Title $oldtitle, Title $newtitle, $pageid, $redirid=0) {
 125+ function changeTitle( Title $oldtitle, Title $newtitle, $pageid, $redirid = 0 ) {
126126
127127 // Save it in parent store now!
128128 // We need that so we get all information correctly!
129 - $result = parent::changeTitle($oldtitle, $newtitle, $pageid, $redirid);
 129+ $result = parent::changeTitle( $oldtitle, $newtitle, $pageid, $redirid );
130130
131131 // delete old stuff
132 - $old_uri = SMWExporter::expandURI($this->getURI($oldtitle));
133 - $this->removeDataForURI($old_uri);
 132+ $old_uri = SMWExporter::expandURI( $this->getURI( $oldtitle ) );
 133+ $this->removeDataForURI( $old_uri );
134134
135 - $newpage = SMWDataValueFactory::newTypeIDValue('_wpg');
136 - $newpage->setValues($newtitle->getDBkey(), $newtitle->getNamespace(), $pageid);
137 - $semdata = $this->getSemanticData($newpage);
138 - $this->updateData($semdata);
 135+ $newpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
 136+ $newpage->setValues( $newtitle->getDBkey(), $newtitle->getNamespace(), $pageid );
 137+ $semdata = $this->getSemanticData( $newpage );
 138+ $this->updateData( $semdata );
139139
140 - $oldpage = SMWDataValueFactory::newTypeIDValue('_wpg');
141 - $oldpage->setValues($oldtitle->getDBkey(), $oldtitle->getNamespace(), $redirid);
142 - $semdata = $this->getSemanticData($oldpage);
143 - $this->updateData($semdata,false);
 140+ $oldpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
 141+ $oldpage->setValues( $oldtitle->getDBkey(), $oldtitle->getNamespace(), $redirid );
 142+ $semdata = $this->getSemanticData( $oldpage );
 143+ $this->updateData( $semdata, false );
144144
145145 return $result;
146146 }
@@ -148,12 +148,12 @@
149149 * no setup required
150150 * @param unknown_type $verbose
151151 */
152 - function setup($verbose = true) {
153 - return parent::setup($verbose);
 152+ function setup( $verbose = true ) {
 153+ return parent::setup( $verbose );
154154 }
155155
156156
157 - function drop($verbose = true) {
 157+ function drop( $verbose = true ) {
158158 return parent::drop();
159159 }
160160
@@ -162,13 +162,13 @@
163163 * TODO: Deprecated, replaced by do_arc2_query
164164 * @param $requestString
165165 */
166 - function do_arc2_post($requestString) {
 166+ function do_arc2_post( $requestString ) {
167167 $postdata = http_build_query(
168168 array(
169169 'request' => $requestString
170170 )
171171 );
172 - $opts = array('http' =>
 172+ $opts = array( 'http' =>
173173 array(
174174 'method' => 'POST',
175175 'header' => 'Content-type: application/x-www-form-urlencoded',
@@ -176,20 +176,20 @@
177177 )
178178 );
179179
180 - $context = stream_context_create($opts);
181 - $result = file_get_contents(SPARQL_ENDPOINT_UPDATE_URL, false, $context);
 180+ $context = stream_context_create( $opts );
 181+ $result = file_get_contents( SPARQL_ENDPOINT_UPDATE_URL, false, $context );
182182 return $result;
183183 }
184184
185 -
 185+
186186 /**
187187 * Communicates with ARC2 RDF Store
188188 * @param $requestString
189189 */
190 - function do_arc2_query($requestString) {
 190+ function do_arc2_query( $requestString ) {
191191
192192 $q = $requestString;
193 - $rs = $this->arc2store->query($q);
 193+ $rs = $this->arc2store->query( $q );
194194 $result = $rs;
195195
196196 // echo( "<pre>" . $this->unhtmlify( $requestString ) . "</pre>" );
@@ -206,8 +206,8 @@
207207 * @return string $outstring
208208 */
209209 function unhtmlify( $instring ) {
210 - $outstring = str_replace('<','&lt;',$instring);
211 - $outstring = str_replace('>','&gt;',$outstring);
 210+ $outstring = str_replace( '<', '&lt;', $instring );
 211+ $outstring = str_replace( '>', '&gt;', $outstring );
212212 return $outstring;
213213 }
214214
@@ -217,14 +217,14 @@
218218 * @param string $title
219219 * @return string $uri
220220 */
221 - protected function getURI($title) {
 221+ protected function getURI( $title ) {
222222 $uri = "";
223 - if($title instanceof Title){
224 - $dv = SMWDataValueFactory::newTypeIDValue('_wpg');
225 - $dv->setTitle($title);
 223+ if ( $title instanceof Title ) {
 224+ $dv = SMWDataValueFactory::newTypeIDValue( '_wpg' );
 225+ $dv->setTitle( $title );
226226 $exp = $dv->getExportData();
227227 $uri = $exp->getSubject()->getName();
228 - }else{
 228+ } else {
229229 // There could be other types as well that we do NOT handle here
230230 }
231231
Index: trunk/extensions/RDFIO/specials/SpecialARC2Admin.alias.php
@@ -1,6 +1,6 @@
22 <?php
33 $aliases = array();
4 -
 4+
55 /** English */
66 $aliases['en'] = array(
77 'SpecialARC2Admin' => array( 'ARC2Admin' ),
Index: trunk/extensions/RDFIO/specials/SpecialARC2Admin_body.php
@@ -7,7 +7,7 @@
88 class SpecialARC2Admin extends SpecialPage {
99
1010 protected $m_issysop;
11 -
 11+
1212 function __construct() {
1313 global $wgUser;
1414
@@ -16,14 +16,14 @@
1717 $this->m_issysop = true;
1818 } else {
1919 $this->m_issysop = false;
20 - }
21 -
 20+ }
 21+
2222 parent::__construct( 'SpecialARC2Admin' );
23 - wfLoadExtensionMessages('SpecialARC2Admin');
 23+ wfLoadExtensionMessages( 'SpecialARC2Admin' );
2424 }
2525
2626 function execute( $par ) {
27 - global $wgRequest, $wgOut, $wgDBserver, $wgDBname, $wgDBuser,
 27+ global $wgRequest, $wgOut, $wgDBserver, $wgDBname, $wgDBuser,
2828 $wgDBpassword, $smwgARC2StoreConfig, $wgArticlePath,
2929 $wgServer, $wgScriptPath, $wgUser;
3030
@@ -31,14 +31,14 @@
3232 $output = "";
3333
3434 # Get request data from, e.g.
35 - $rdfio_action = $wgRequest->getText('rdfio_action');
 35+ $rdfio_action = $wgRequest->getText( 'rdfio_action' );
3636
3737 # instantiation
38 - $store = ARC2::getStore($smwgARC2StoreConfig);
 38+ $store = ARC2::getStore( $smwgARC2StoreConfig );
3939
4040 $output .= "\n===RDF Store Setup===\n'''Status:'''\n\n";
4141
42 - if (!$store->isSetUp()) {
 42+ if ( !$store->isSetUp() ) {
4343 $output .= "* Store is '''not''' set up\n";
4444 if ( $rdfio_action == "setup" ) {
4545 if ( !$wgUser->matchEditToken( $wgRequest->getText( 'token' ) ) ) {
@@ -48,9 +48,9 @@
4949 $output .= "* Setting up now ...\n";
5050 $store->setUp();
5151 $output .= "* Done!\n";
52 - } else{
 52+ } else {
5353 $errormessage = "Only sysops can perform this operation!";
54 - $wgOut->addHTML( RDFIOUtils::formatErrorHTML("Permission Error", $errormessage) );
 54+ $wgOut->addHTML( RDFIOUtils::formatErrorHTML( "Permission Error", $errormessage ) );
5555 }
5656 }
5757 }
Index: trunk/extensions/RDFIO/specials/SpecialARC2Admin.i18n.php
@@ -1,8 +1,8 @@
22 <?php
33 $messages = array();
4 -
5 -$messages['en'] = array(
 4+
 5+$messages['en'] = array(
66 'specialarc2admin' => 'ARC2 RDF Store Admin Page',
77 'specialarc2admin-desc' => 'Administration page for the ARC2 RDF Store for Semantic MediaWiki',
88 );
9 -
 9+
Index: trunk/extensions/RDFIO/specials/SpecialARC2Admin.php
@@ -1,6 +1,6 @@
22 <?php
33 # Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
4 -if (!defined('MEDIAWIKI')) {
 4+if ( !defined( 'MEDIAWIKI' ) ) {
55 echo <<<EOT
66 To install my extension, put the following line in LocalSettings.php:
77 require_once( "\$IP/extensions/SMWRDFConnector/SpecialARC2Admin.php" );
@@ -17,7 +17,7 @@
1818 'version' => '0.0.0',
1919 );
2020
21 -$dir = dirname(__FILE__) . '/';
 21+$dir = dirname( __FILE__ ) . '/';
2222
2323 $wgAutoloadClasses['SpecialARC2Admin'] = $dir . 'SpecialARC2Admin_body.php'; # Tell MediaWiki to load the extension body.
2424 $wgExtensionMessagesFiles['SpecialARC2Admin'] = $dir . 'SpecialARC2Admin.i18n.php';
Index: trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint_body.php
@@ -15,12 +15,12 @@
1616 protected $m_outputequivuris;
1717 protected $m_haswriteaccess; // User permission
1818 protected $m_hasdeleteaccess; // User permission
19 -
 19+
2020 function __construct() {
2121 global $wgUser, $rdfiogQueryByOrigURI;
2222
2323 parent::__construct( 'SPARQLEndpoint' );
24 - wfLoadExtensionMessages('SPARQLEndpoint');
 24+ wfLoadExtensionMessages( 'SPARQLEndpoint' );
2525 $this->m_sparqlendpointconfig = $this->getSPARQLEndpointConfig();
2626 $this->m_sparqlendpoint = ARC2::getStoreEndpoint( $this->m_sparqlendpointconfig );
2727 $this->m_sparqlparser = ARC2::getSPARQLPlusParser();
@@ -31,12 +31,12 @@
3232 $this->m_haswriteaccess = true;
3333 } else {
3434 $this->m_haswriteaccess = false;
35 - }
 35+ }
3636 if ( in_array( 'edit', $userrights ) && in_array( 'delete', $userrights ) ) {
3737 $this->m_hasdeleteaccess = true;
3838 } else {
3939 $this->m_hasdeleteaccess = false;
40 - }
 40+ }
4141 }
4242
4343 /**
@@ -47,15 +47,15 @@
4848
4949 $this->setHeaders();
5050 $this->handleRequestData();
51 -
 51+
5252 $executesparql = true;
53 -
 53+
5454 if ( $this->m_query == '' ) {
5555 $this->printHTMLForm();
5656 } else {
5757 $this->ensureSparqlEndpointInstalled();
5858 $this->convertURIsInQuery();
59 -
 59+
6060 if ( $this->m_querytype == 'insert' ) { // TODO
6161 if ( $this->checkAllowInsert() ) {
6262 $this->importTriplesInQuery();
@@ -68,7 +68,7 @@
6969 // TODO Add a "successfully inserted/deleted" message here
7070 $this->printHTMLForm();
7171 } else { // We are querying/outputting data, not editing
72 -
 72+
7373 if ( $this->m_outputtype == 'htmltab' ) {
7474 $this->printHTMLForm();
7575 if ( $wgRequest->getBool( 'showquery', false ) ) {
@@ -146,40 +146,40 @@
147147 * in class variables
148148 */
149149 function handleRequestData() {
150 - global $wgRequest,
 150+ global $wgRequest,
151151 $rdfiogQueryByOrigURI,
152152 $rdfiogQueryByEquivURI,
153153 $rdfiogOutputOrigURIs,
154154 $rdfiogOutputEquivURIs;
155 -
 155+
156156 $this->m_query = $wgRequest->getText( 'query' );
157 -
 157+
158158 if ( $rdfiogQueryByOrigURI == '' ) {
159159 $this->m_querybyoriguri = $wgRequest->getBool( 'origuri_q' ); // No default value, as to not overwrite configurable setting in LocalSettings.php
160160 } else {
161161 $this->m_querybyoriguri = $rdfiogQueryByOrigURI;
162162 }
163 -
 163+
164164 if ( $rdfiogQueryByEquivURI == '' ) {
165165 $this->m_querybyequivuri = $wgRequest->getBool( 'equivuri_q' );
166166 } else {
167167 $this->m_querybyequivuri = $rdfiogQueryByEquivURI;
168168 }
169 -
 169+
170170 if ( $rdfiogOutputOrigURIs == '' ) {
171171 $this->m_outputoriguris = $wgRequest->getBool( 'origuri_o' );
172172 } else {
173173 $this->m_outputoriguris = $rdfiogOutputOrigURIs;
174174 }
175 -
 175+
176176 if ( $rdfiogOutputEquivURIs == '' ) {
177177 $this->m_outputequivuris = $wgRequest->getBool( 'equivuri_o' );
178178 } else {
179179 $this->m_outputequivuris = $rdfiogOutputEquivURIs;
180180 }
181 -
 181+
182182 $this->m_filtervocab = $wgRequest->getBool( 'filtervocab', false );
183 - $this->m_filtervocaburl = $wgRequest->getText( 'filtervocaburl');
 183+ $this->m_filtervocaburl = $wgRequest->getText( 'filtervocaburl' );
184184 $this->m_outputtype = $wgRequest->getText( 'output' );
185185 if ( $this->m_query !== '' ) {
186186 $this->m_sparqlparser->parse( $this->m_query, '' );
@@ -189,16 +189,16 @@
190190 }
191191 }
192192 }
193 -
 193+
194194 function ensureSparqlEndpointInstalled() {
195 - if (!$this->m_sparqlendpoint->isSetUp()) {
 195+ if ( !$this->m_sparqlendpoint->isSetUp() ) {
196196 $this->m_sparqlendpoint->setUp(); /* create MySQL tables */
197197 }
198198 }
199 -
 199+
200200 /**
201 - * If option is so chosen, convert URIs in the query to
202 - * their corresponding "Original URIs" or "Equivalent URIs"
 201+ * If option is so chosen, convert URIs in the query to
 202+ * their corresponding "Original URIs" or "Equivalent URIs"
203203 */
204204 function convertURIsInQuery() {
205205 if ( $this->m_querybyoriguri ) {
@@ -215,34 +215,34 @@
216216 if ( $s_type === 'uri' ) {
217217 $triple['s'] = 's';
218218 $triple['s_type'] = 'var';
219 - $newtriple = $this->createEquivURITriple( $s, 's' );
 219+ $newtriple = $this->createEquivURITriple( $s, 's' );
220220 $query_structure['query']['pattern']['patterns'][0]['patterns'][] = $newtriple;
221221 }
222222 if ( $p_type === 'uri' ) {
223223 $triple['p'] = 'p';
224224 $triple['p_type'] = 'var';
225 - $newtriple = $this->createEquivURITriple( $p, 'p', true );
 225+ $newtriple = $this->createEquivURITriple( $p, 'p', true );
226226 $query_structure['query']['pattern']['patterns'][0]['patterns'][] = $newtriple;
227227 }
228228 if ( $o_type === 'uri' ) {
229229 $triple['o'] = 'o';
230230 $triple['o_type'] = 'var';
231 - $newtriple = $this->createEquivURITriple( $o, 'o' );
 231+ $newtriple = $this->createEquivURITriple( $o, 'o' );
232232 $query_structure['query']['pattern']['patterns'][0]['patterns'][] = $newtriple;
233233 }
234234 // restore the first triple into its original location
235235 $query_structure['query']['pattern']['patterns'][0]['patterns'][0] = $triple;
236 - require_once(__DIR__ . "/bundle/ARC2_SPARQLSerializerPlugin.php");
 236+ require_once( __DIR__ . "/bundle/ARC2_SPARQLSerializerPlugin.php" );
237237 $sparqlserializer = new ARC2_SPARQLSerializerPlugin();
238238 $query = $sparqlserializer->toString( $query_structure );
239 -
 239+
240240 $this->setQueryInPost( $query );
241241 # $this->convertEquivURIsToInternalURIsInQuery(); // TODO DEPRECATED
242242 }
243243 }
244 -
 244+
245245 /**
246 - * Get an array of property URIs from the specified ontology,
 246+ * Get an array of property URIs from the specified ontology,
247247 * to function as a filter
248248 * @return array $vocab_p_uri_filter
249249 */
@@ -264,7 +264,7 @@
265265 }
266266 return $vocab_p_uri_filter;
267267 }
268 -
 268+
269269 /**
270270 * Create an RDF triple that links a wiki page to its corresponding
271271 * equivalent URI
@@ -292,7 +292,7 @@
293293 );
294294 return $equivuritriple;
295295 }
296 -
 296+
297297 /**
298298 * Check if writing to wiki is allowed, and handle a number
299299 * of exceptions to that, by showing error messages etc
@@ -319,7 +319,7 @@
320320 }
321321 }
322322 }
323 -
 323+
324324 /**
325325 * Check if deleting from wiki is allowed, and handle a number
326326 * of exceptions to that, by showing error messages etc
@@ -340,7 +340,7 @@
341341 }
342342 }
343343 }
344 -
 344+
345345 /**
346346 * Print out the datastructure of the query in preformatted text
347347 */
@@ -350,8 +350,8 @@
351351 }
352352
353353 /**
354 - * Do preparations for getting outputted data as a downloadable file
355 - * rather than written to the current page
 354+ * Do preparations for getting outputted data as a downloadable file
 355+ * rather than written to the current page
356356 */
357357 function prepareCreatingDownloadableFile() {
358358 global $wgOut;
@@ -363,7 +363,7 @@
364364 // and potentially is to be downloaded as a file
365365 $this->sendHeadersForOutputType( $this->m_outputtype );
366366 }
367 -
 367+
368368 /**
369369 * Print out the HTML Form
370370 */
@@ -391,19 +391,19 @@
392392 */
393393 function importTriplesInQuery() {
394394 $triples = $this->m_query_parsed['query']['construct_triples'];
395 - $rdfImporter = new RDFIOSMWBatchWriter( $triples, 'triples_array');
 395+ $rdfImporter = new RDFIOSMWBatchWriter( $triples, 'triples_array' );
396396 $rdfImporter->execute();
397397 }
398 -
 398+
399399 /**
400400 * After a query is parsed, delete the parsed data from the wiki
401401 */
402402 function deleteTriplesInQuery() {
403403 $triples = $this->m_query_parsed['query']['construct_triples'];
404 - $rdfImporter = new RDFIOSMWBatchWriter( $triples, 'triples_array');
 404+ $rdfImporter = new RDFIOSMWBatchWriter( $triples, 'triples_array' );
405405 $rdfImporter->executeDelete();
406406 }
407 -
 407+
408408 /**
409409 * Die and display current errors
410410 */
@@ -422,16 +422,16 @@
423423 RDFIOUtils::showErrorMessage( "SPARQL Error", $errormessage );
424424 }
425425 }
426 -
 426+
427427 /**
428428 * For each URI in the (unparsed) query that is set by an "Original URI" property in
429 - * the wiki, replace it with the page's corresponding URI Resolver URI
 429+ * the wiki, replace it with the page's corresponding URI Resolver URI
430430 */
431431 function convertOrigURIsToInternalURIsInQuery() {
432432 $query = $this->m_query;
433433 $origuris = RDFIOUtils::extractURIs( $this->m_query ); // TODO: Use parsed query instead
434434 $count = count( $origuris );
435 - if ( $count > 1 || ($count > 0 && !RDFIOUtils::contains("URIResolver", $origuris[0])) ) { // The first URI is the URI Resolver one, which always is there
 435+ if ( $count > 1 || ( $count > 0 && !RDFIOUtils::contains( "URIResolver", $origuris[0] ) ) ) { // The first URI is the URI Resolver one, which always is there
436436 foreach ( $origuris as $origuri ) {
437437 $uri = $this->m_store->getURIForOrigURI( $origuri );
438438 if ( $uri != '' ) {
@@ -443,10 +443,10 @@
444444 $this->setQueryInPost( $query );
445445 }
446446 }
447 -
 447+
448448 /**
449449 * For each URI in the (unparsed) query that is set by an "Equivalent URI" property in
450 - * the wiki, replace it with the page's corresponding URI Resolver URI
 450+ * the wiki, replace it with the page's corresponding URI Resolver URI
451451 */
452452 function convertEquivURIsToInternalURIsInQuery() {
453453 $equivuris = RDFIOUtils::extractURIs( $this->m_query ); // TODO: Use parsed query instead
@@ -464,10 +464,10 @@
465465 $this->setQueryInPost( $query );
466466 }
467467 }
468 -
 468+
469469 /**
470470 * Convert all URI Resolver URIs which have a corresponding Original URI,
471 - * to that Original URI.
 471+ * to that Original URI.
472472 * @param array $triples
473473 * @return array $triples
474474 */
@@ -488,10 +488,10 @@
489489 }
490490 return $triples;
491491 }
492 -
 492+
493493 /**
494494 * Convert all URI Resolver URIs which have a corresponding Original URI,
495 - * to that Original URI.
 495+ * to that Original URI.
496496 * @param array $triples
497497 * @return array $triples
498498 */
@@ -513,8 +513,8 @@
514514 }
515515 }
516516 return $output_structure;
517 - }
518 -
 517+ }
 518+
519519 /**
520520 * For all property URIs, add triples using equivalent uris for the,
521521 * current property uri
@@ -529,19 +529,19 @@
530530 $equivuris = $this->m_store->getEquivURIsForURI( $propertyuri, true );
531531 foreach ( $equivuris as $equivuri ) {
532532 $newtriple = array(
533 - 's' => $triple['s'],
 533+ 's' => $triple['s'],
534534 'p' => $equivuri,
535535 'o' => $triple['o']
536536 );
537537 $newtriples[] = $newtriple;
538538 }
539539 }
540 - $triples = array_merge( $triples, $newtriples );
 540+ $triples = array_merge( $triples, $newtriples );
541541 return $triples;
542542 }
543 -
 543+
544544 /**
545 - * For all property URIs and all subject and objects which have URIs,
 545+ * For all property URIs and all subject and objects which have URIs,
546546 * add triples using equivalent uris for these URIs (in all combinations
547547 * thereof). If $p_uris_filter is set, allow only triples with properties
548548 * included in this filter array
@@ -556,7 +556,7 @@
557557 // Subject
558558 $s_equivuris = array( $triple['s'] );
559559 if ( $triple['s_type'] === 'uri' ) {
560 - $s_uri = $triple['s'];
 560+ $s_uri = $triple['s'];
561561 $s_equivuris_temp = $this->m_store->getEquivURIsForURI( $s_uri );
562562 if ( count( $s_equivuris_temp ) > 0 ) {
563563 $s_equivuris = $s_equivuris_temp;
@@ -576,23 +576,23 @@
577577 $p_equivuris = $p_equivuris_temp;
578578 }
579579 }
580 -
 580+
581581 // Object
582582 $o_equivuris = array( $triple['o'] );
583583 if ( $triple['o_type'] === 'uri' ) {
584 - $o_uri = $triple['o'];
 584+ $o_uri = $triple['o'];
585585 $o_equivuris_temp = $this->m_store->getEquivURIsForURI( $o_uri );
586586 if ( count( $o_equivuris_temp ) > 0 ) {
587587 $o_equivuris = $o_equivuris_temp;
588588 }
589589 }
590 -
 590+
591591 // Generate triples
592592 foreach ( $s_equivuris as $s_equivuri ) {
593593 foreach ( $p_equivuris as $p_equivuri ) {
594594 foreach ( $o_equivuris as $o_equivuri ) {
595595 $newtriple = array(
596 - 's' => $s_equivuri,
 596+ 's' => $s_equivuri,
597597 'p' => $p_equivuri,
598598 'o' => $o_equivuri
599599 );
@@ -603,12 +603,12 @@
604604 }
605605 return $newtriples;
606606 }
607 -
 607+
608608 function complementSPARQLResultRowsWithEquivURIs( $output_structure, $p_uris_filter = '' ) {
609609 $predvarname = $this->getPredicateVariableName();
610610 $variables = $output_structure['result']['variables'];
611611 $rows = $output_structure['result']['rows'];
612 -
 612+
613613 $predvarname = 'p'; // TODO DO a real check up
614614 $newrows_total = array();
615615 foreach ( $rows as $rowid => $row ) {
@@ -651,7 +651,7 @@
652652 $output_structure['result']['rows'] = $newrows_total;
653653 return $output_structure;
654654 }
655 -
 655+
656656 /**
657657 * Convert an ARC triple index array structure into RDF/XML
658658 * @param array $tripleindex
@@ -668,7 +668,7 @@
669669 }
670670 return $rdfxml;
671671 }
672 -
 672+
673673 /**
674674 * Convert an ARC triples array into RDF/XML
675675 * @param array $triples
@@ -685,10 +685,10 @@
686686 }
687687 return $rdfxml;
688688 }
689 -
 689+
690690 /**
691691 * Convert all URI Resolver URIs which have a corresponding Original URI,
692 - * to that Original URI.
 692+ * to that Original URI.
693693 * @param string $text
694694 * @return string $text
695695 */
@@ -704,7 +704,7 @@
705705 }
706706 return $text;
707707 }
708 -
 708+
709709 function getPredicateVariableName() {
710710 $predvarname = $this->m_query_parsed['vars'][1];
711711 return $predvarname;
@@ -722,15 +722,15 @@
723723 'db_user' => $wgDBuser,
724724 'db_pwd' => $wgDBpassword,
725725 'store_name' => $smwgARC2StoreConfig['store_name'],
726 - 'endpoint_features' =>
 726+ 'endpoint_features' =>
727727 array(
728 - 'select',
729 - 'construct',
730 - 'ask',
731 - 'describe',
 728+ 'select',
 729+ 'construct',
 730+ 'ask',
 731+ 'describe',
732732 # 'load',
733733 # 'insert', // This is not needed, since it is done via SMWWriter instead
734 - # 'delete', // This is not needed, since it is done via SMWWriter instead
 734+ # 'delete', // This is not needed, since it is done via SMWWriter instead
735735 # 'dump' /* dump is a special command for streaming SPOG export */
736736 ),
737737 'endpoint_timeout' => 60, /* not implemented in ARC2 preview */
@@ -794,7 +794,7 @@
795795 * @param string $query
796796 * @return string $htmlForm
797797 */
798 - private function getHTMLForm( $query = '') {
 798+ private function getHTMLForm( $query = '' ) {
799799 global $wgArticlePath, $wgUser, $wgRequest;
800800
801801 $uriResolverURI = $this->m_store->getURIResolverURI();
@@ -815,22 +815,22 @@
816816
817817 $selected_output_html = $wgRequest->getText( 'output', '' ) == 'htmltab' ? ' selected="selected" ' : '';
818818 $selected_output_rdfxml = $wgRequest->getText( 'output', '' ) == 'rdfxml' ? ' selected="selected" ' : '';
819 -
 819+
820820 // Make the HTML format selected by default
821821 if ( $selected_output_rdfxml == '' ) {
822822 $selected_output_html = ' selected="selected" ';
823823 }
824824
825 - $htmlForm = '<form method="post" action="' . str_replace('/$1', '', $wgArticlePath) . '/Special:SPARQLEndpoint"
 825+ $htmlForm = '<form method="post" action="' . str_replace( '/$1', '', $wgArticlePath ) . '/Special:SPARQLEndpoint"
826826 name="createEditQuery">
827827 <div style="font-size: 10px">
828 -
 828+
829829 <table border="0"><tbody>
830830 <tr><td colspan="3">Enter SPARQL query:</td><tr>
831831 <tr><td colspan="3"><textarea cols="80" rows="9" name="query">' . $query . '</textarea></td></tr>
832832 <tr>
833833 <td style="vertical-align: top; border-right: 1px solid #ccc;">
834 -
 834+
835835 <table border="0" style="background: transparent; font-size: 11px;">
836836 <tr><td width="160" style="text-align: right">Query by original URIs:</td>
837837 <td>
@@ -840,11 +840,11 @@
841841 <td>
842842 <input type="checkbox" name="equivuri_q" value="1" ' . $checked_equivuri_q . '/>
843843 </td></tr>
844 - </table>
845 -
 844+ </table>
 845+
846846 </td>
847847 <td width="170" style="vertical-align: top; border-right: 1px solid #ccc;">
848 -
 848+
849849 <table border="0" style="font-size: 11px; background: transparent;">
850850 <tr><td style="text-align: right">Output original URIs:</td>
851851 <td>
@@ -855,37 +855,37 @@
856856 <input type="checkbox" name="equivuri_o" id="outputequivuri" value="1" ' . $checked_equivuri_o . ' onChange="toggleDisplay(\'byontology\');" />
857857 </td></tr>
858858 </table>
859 -
 859+
860860 </td>
861861 <td width="260" style="vertical-align: top;">
862 -
 862+
863863 <table border="0" style="font-size: 11px; background: transparent;" >
864864 <tr><td style="text-align: right" width="180">Output format:</td>
865865 <td style="vertical-align: top">
866 - <select id="output" name="output" onChange="toggleDisplay(\'byontology\');" >
 866+ <select id="output" name="output" onChange="toggleDisplay(\'byontology\');" >
867867 <!-- <option value="" >default</option> -->
868868 <!-- <option value="json" >JSON</option> -->
869869 <!-- <option value="plain" >Plain</option> -->
870 - <!-- <option value="php_ser" >Serialized PHP</option> -->
 870+ <!-- <option value="php_ser" >Serialized PHP</option> -->
871871 <!-- <option value="turtle" >Turtle</option> -->
872 - <option value="htmltab" ' . $selected_output_html . '>HTML</option>
 872+ <option value="htmltab" ' . $selected_output_html . '>HTML</option>
873873 <option value="xml" >XML Resultset</option>
874 - <option value="rdfxml" ' . $selected_output_rdfxml . '>RDF/XML</option>
875 - <!-- <option value="infos" >Query Structure</option> -->
 874+ <option value="rdfxml" ' . $selected_output_rdfxml . '>RDF/XML</option>
 875+ <!-- <option value="infos" >Query Structure</option> -->
876876 <!-- <option value="tsv" >TSV</option> -->
877 - </select>
 877+ </select>
878878 </td></tr>
879879 <tr>
880880 <td colspan="2">
881881 <span style="font-family: arial, helvetica, sans-serif; font-size: 10px; color: #777;">(RDF/XML requires creating triples using <a href="http://www.w3.org/TR/rdf-sparql-query/#construct">CONSTRUCT</a>)</span>
882882 </td>
883883 </table>
884 -
 884+
885885 </td>
886886 </tr>
887887 <tr>
888888 <td colspan="3">
889 -
 889+
890890 <div id="byontology" style="display: none; background: #ffd; border: 1px solid #ee7;">
891891 <table border="0" style="font-size: 11px; background: transparent;" >
892892 <tr><td style="text-align: right;">Filter by vocabulary:</td>
@@ -902,19 +902,19 @@
903903 <td>&nbsp;</td>
904904 <td>
905905 <span style="font-family: arial, helvetica, sans-serif; font-size: 10px; color: #777">Example: http://xmlns.com/foaf/spec/index.rdf</span>
906 - </td></tr>
 906+ </td></tr>
907907 </table>
908 - </div>
909 -
 908+ </div>
 909+
910910 </td>
911911 </table>
912912 </div>
913 -
914 - <input type="submit" value="Submit">' . Xml::hidden( 'token', $wgUser->editToken() ) . '
 913+
 914+ <input type="submit" value="Submit">' . Xml::hidden( 'token', $wgUser->editToken() ) . '
915915 </form>';
916916 return $htmlForm;
917917 }
918 -
 918+
919919 /**
920920 * Get the javascript used for some functionality in the main SPARQL
921921 * querying HTML form
@@ -924,10 +924,10 @@
925925 $htmlFormScript = "<script type=\"text/javascript\">
926926 function toggleDisplay(id1) {
927927 var bostyle = document.getElementById(id1).style.display;
928 - var fmtsel = document.getElementById('output');
 928+ var fmtsel = document.getElementById('output');
929929 var fmt = fmtsel.options[fmtsel.selectedIndex].value;
930930 var outsel = document.getElementById('outputequivuri');
931 - if ( outsel.checked && fmt.match('rdfxml') ) {
 931+ if ( outsel.checked && fmt.match('rdfxml') ) {
932932 document.getElementById(id1).style.display = 'block';
933933 } else {
934934 document.getElementById(id1).style.display = 'none';
@@ -942,13 +942,13 @@
943943 * @return string $query
944944 */
945945 function getQuery() {
946 - $query = $wgRequest->getText('query');
 946+ $query = $wgRequest->getText( 'query' );
947947 return $query;
948948 }
949949
950950 /**
951 - * Update the query variable in the $_POST object.
952 - * Useful for passing on parsing to ARC, since $_POST is what ARC reads
 951+ * Update the query variable in the $_POST object.
 952+ * Useful for passing on parsing to ARC, since $_POST is what ARC reads
953953 * @param string $query
954954 */
955955 function setQueryInPost( $query ) {
@@ -957,8 +957,8 @@
958958 }
959959
960960 /**
961 - * Update the output (type) variable in the $_POST object.
962 - * Useful for passing on parsing to ARC, since $_POST is what ARC reads
 961+ * Update the output (type) variable in the $_POST object.
 962+ * Useful for passing on parsing to ARC, since $_POST is what ARC reads
963963 * @param string $type
964964 */
965965 function setOutputTypeInPost( $type ) {
Index: trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint.i18n.php
@@ -1,8 +1,8 @@
22 <?php
 3+
34 $messages = array();
45
56 $messages['en'] = array(
67 'sparqlendpoint' => 'SPARQL Endpoint',
78 'sparqlendpoint-desc' => 'A SPARQLEndpoint provided by the SMWRDFConnector',
89 );
9 -
Index: trunk/extensions/RDFIO/specials/SpecialRDFImport_body.php
@@ -11,7 +11,7 @@
1212 protected $m_nsprefix_in_wikititles_entities;
1313 protected $m_show_abbrscreen_properties;
1414 protected $m_show_abbrscreen_entities;
15 -
 15+
1616 function __construct() {
1717 global $wgUser;
1818
@@ -20,9 +20,9 @@
2121 $this->m_haswriteaccess = true;
2222 } else {
2323 $this->m_haswriteaccess = false;
24 - }
 24+ }
2525 parent::__construct( 'RDFImport' );
26 - wfLoadExtensionMessages('RDFImport');
 26+ wfLoadExtensionMessages( 'RDFImport' );
2727 }
2828
2929 function execute( $par ) {
@@ -30,7 +30,7 @@
3131
3232 $this->setHeaders();
3333 $this->handleRequestData();
34 -
 34+
3535 if ( $this->m_action == 'Import' ) {
3636 if ( !$wgUser->matchEditToken( $this->m_edittoken ) ) {
3737 die( 'Cross-site request forgery detected!' );
@@ -68,24 +68,24 @@
6969 $this->outputHTMLForm();
7070 }
7171 }
72 -
 72+
7373 /**
7474 * Get data from the request object and store it in class variables
7575 */
7676 function handleRequestData() {
7777 global $wgRequest;
78 - $this->m_action = $wgRequest->getText('action');
79 - $this->m_dataformat = $wgRequest->getText('dataformat');
80 - $this->m_importdata = $wgRequest->getText('importdata');
 78+ $this->m_action = $wgRequest->getText( 'action' );
 79+ $this->m_dataformat = $wgRequest->getText( 'dataformat' );
 80+ $this->m_importdata = $wgRequest->getText( 'importdata' );
8181 $this->m_edittoken = $wgRequest->getText( 'token' );
8282 $this->m_nsprefix_in_wikititles_properties = $wgRequest->getBool( 'nspintitle_prop', false );
8383 $this->m_show_abbrscreen_properties = $wgRequest->getBool( 'abbrscr_prop', false );
8484 $this->m_nsprefix_in_wikititles_entities = $wgRequest->getBool( 'nspintitle_ent', false );
8585 $this->m_show_abbrscreen_entities = $wgRequest->getBool( 'abbrscr_ent', false );
8686 }
87 -
 87+
8888 /**
89 - * Create a new SMWBatchWriter object, store it in a class variable, and
 89+ * Create a new SMWBatchWriter object, store it in a class variable, and
9090 * set some options, like which ns prefixes to use.
9191 */
9292 function initSMWBatchWriter() {
@@ -93,7 +93,7 @@
9494 $this->m_smwbatchwriter->setUseNSPInTitlesForProperties( $this->m_nsprefix_in_wikititles_properties );
9595 $this->m_smwbatchwriter->setUseNSPInTitlesForEntities( $this->m_nsprefix_in_wikititles_entities );
9696 }
97 -
 97+
9898 /**
9999 * Tell the SMWBatchWriter object to execute the import
100100 */
@@ -103,13 +103,13 @@
104104 $wgOut->addScript( $this->getExampleDataJs() );
105105 $wgOut->addHTML( $this->getHTMLFormContent() );
106106 }
107 -
 107+
108108 /**
109109 * Add more namespace prefixes in the configured namespace mapping
110110 */
111111 function addNewNsPrefixes() {
112 - $nss = $wgRequest->getArray('ns',array());
113 - $nsprefixes = $wgRequest->getArray('nsprefixes',array());
 112+ $nss = $wgRequest->getArray( 'ns', array() );
 113+ $nsprefixes = $wgRequest->getArray( 'nsprefixes', array() );
114114 $newnsmappings = array();
115115 $nsid = 0;
116116 foreach ( $nss as $ns ) {
@@ -120,7 +120,7 @@
121121 $this->initSMWBatchWriter();
122122 $this->m_smwbatchwriter->AddNamespacePrefixes( $newnsmappings );
123123 }
124 -
 124+
125125 /**
126126 * Output the HTML for the form, to the user
127127 */
@@ -129,9 +129,9 @@
130130 $wgOut->addScript( $this->getExampleDataJs() );
131131 $wgOut->addHTML( $this->getHTMLFormContent() );
132132 }
133 -
134 - /**
135 - * For a number of base uri:s, generate the HTML for a screen for
 133+
 134+ /**
 135+ * For a number of base uri:s, generate the HTML for a screen for
136136 * configuring abbreviation for them
137137 * @param array $baseuris
138138 */
@@ -153,7 +153,7 @@
154154 ";
155155 return $baseuriscreen;
156156 }
157 -
 157+
158158 /**
159159 * For an array of unabbreviated entities, generate HTML for a
160160 * formatted list of these entities' URIs
@@ -203,16 +203,16 @@
204204 \\n\
205205 </rdf:RDF>';
206206 }
207 -
 207+
208208 /**
209209 * Generate the main HTML form, if the variable $extraFormContent is set, the
210 - * content of it will be prepended before the form
 210+ * content of it will be prepended before the form
211211 * @param string $extraFormContent
212212 * @return string $htmlFormContent
213213 */
214214 public function getHTMLFormContent( $extraFormContent = '' ) {
215215 global $wgRequest, $wgUser, $wgArticlePath;
216 -
 216+
217217 // Abbreviation (and screen) options for properties
218218 $checked_nspintitle_properties = $wgRequest->getBool( 'nspintitle_prop', false ) == 1 ? ' checked="true" ' : '';
219219 $checked_abbrscr_properties = $wgRequest->getBool( 'abbrscr_prop', false ) == 1 ? ' checked="true" ' : '';
@@ -222,9 +222,9 @@
223223 $checked_abbrscr_entities = $wgRequest->getBool( 'abbrscr_ent', false ) == 1 ? ' checked="true" ' : '';
224224
225225 $this->m_importdata = $wgRequest->getText( 'importdata', '' );
226 -
 226+
227227 // Create the HTML form for RDF/XML Import
228 - $htmlFormContent = '<form method="post" action="' . str_replace('/$1', '', $wgArticlePath) . '/Special:RDFImport"
 228+ $htmlFormContent = '<form method="post" action="' . str_replace( '/$1', '', $wgArticlePath ) . '/Special:RDFImport"
229229 name="createEditQuery"><input type="hidden" name="action" value="Import">
230230 ' . $extraFormContent . '
231231 <table border="0"><tbody>
@@ -233,9 +233,9 @@
234234 </td></tr>
235235 <tr><td width="100">Data format:</td>
236236 <td>
237 - <select id="dataformat" name="dataformat">
238 - <option value="rdfxml" selected="selected">RDF/XML</option>
239 - <option value="turtle" >Turtle</option>
 237+ <select id="dataformat" name="dataformat">
 238+ <option value="rdfxml" selected="selected">RDF/XML</option>
 239+ <option value="turtle" >Turtle</option>
240240 </select>
241241 </td>
242242 <td style="text-align: right; font-size: 10px;">
Index: trunk/extensions/RDFIO/specials/SpecialSPARQLEndpoint.php
@@ -1,6 +1,6 @@
22 <?php
33 # Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
4 -if (!defined('MEDIAWIKI')) {
 4+if ( !defined( 'MEDIAWIKI' ) ) {
55 echo <<<EOT
66 To install my extension, put the following line in LocalSettings.php:
77 require_once( "\$IP/extensions/SMWRDFConnector/SpecialSPARQLEndpoint.php" );
@@ -17,7 +17,7 @@
1818 'version' => '0.0.0',
1919 );
2020
21 -$dir = dirname(__FILE__) . '/';
 21+$dir = dirname( __FILE__ ) . '/';
2222
2323 $wgAutoloadClasses['SPARQLEndpoint'] = $dir . 'SpecialSPARQLEndpoint_body.php'; # Tell MediaWiki to load the extension body.
2424 $wgExtensionMessagesFiles['SPARQLEndpoint'] = $dir . 'SpecialSPARQLEndpoint.i18n.php';
Index: trunk/extensions/RDFIO/specials/SpecialRDFImport.php
@@ -1,6 +1,6 @@
22 <?php
33 # Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
4 -if (!defined('MEDIAWIKI')) {
 4+if ( !defined( 'MEDIAWIKI' ) ) {
55 echo <<<EOT
66 To install my extension, put the following line in LocalSettings.php:
77 require_once( "\$IP/extensions/SMWRDFConnector/SpecialRDFImport.php" );
@@ -17,7 +17,7 @@
1818 'version' => '0.0.0',
1919 );
2020
21 -$dir = dirname(__FILE__) . '/';
 21+$dir = dirname( __FILE__ ) . '/';
2222
2323 $wgAutoloadClasses['RDFImport'] = $dir . 'SpecialRDFImport_body.php'; # Tell MediaWiki to load the extension body.
2424 $wgExtensionMessagesFiles['RDFImport'] = $dir . 'SpecialRDFImport.i18n.php';
Index: trunk/extensions/RDFIO/INSTALL
@@ -1,3 +1,2 @@
2 -For easily readable install instructions, see:
 2+For easily readable installation instructions, see:
33 http://www.mediawiki.org/wiki/Extension:RDFIO#Installing_RDFIO
4 -
Property changes on: trunk/extensions/RDFIO/INSTALL
___________________________________________________________________
Added: svn:eol-style
54 + native
Index: trunk/extensions/RDFIO/RELEASE-NOTES
@@ -12,10 +12,10 @@
1313 ;Numerous fixes to make remote SPARQL querying work
1414
1515 * Improved file hierarchy
16 -* Made querying and output of/querying by Original URIs and Equivalent URIs
 16+* Made querying and output of/querying by Original URIs and Equivalent URIs
1717 configurable from LocalSettings.php in SPARQL endpoint (So this can be turned on for remote queries too)
18 -* In total five new configurable settings for LocalSettings.php (see
19 - http://www.mediawiki.org/wiki/Extension:RDFIO#LocalSettings.php_configuration
 18+* In total five new configurable settings for LocalSettings.php (see
 19+ http://www.mediawiki.org/wiki/Extension:RDFIO#LocalSettings.php_configuration
2020 for full list):
2121 ** $rdfiogQueryByOrigURI = true;
2222 ** $rdfiogOutputOrigURIs = true;
@@ -26,21 +26,21 @@
2727 Bioclipse/Jena work
2828
2929
30 -== RDFIO 0.4.0 ==
 30+== RDFIO 0.4.0 ==
3131
3232 Released on 2010-08-16
3333
3434 * Support for configuring extra namespace prefixes in LocalSettings.php
3535 * More options in RDF Import screen
36 -* Output SPARQL resultset as default for remote queries, and HTML for form
 36+* Output SPARQL resultset as default for remote queries, and HTML for form
3737 queries
38 -* Enable output as Original URI/Equivalent URI also for XML Resultset output
 38+* Enable output as Original URI/Equivalent URI also for XML Resultset output
3939 format
40 -* Refactorings (Merged EquivalentURIHandler and SMWBatchWriter classes, Broke
 40+* Refactorings (Merged EquivalentURIHandler and SMWBatchWriter classes, Broke
4141 out RDFIOPageHandler in separate file)
4242 * Many bugfixes
4343
44 -== RDFIO 0.3.0 ==
 44+== RDFIO 0.3.0 ==
4545
4646 Released on 2010-07-30
4747
@@ -50,7 +50,7 @@
5151 * Option to query by Equivalent URI
5252 * Refined SPARQL Endpoint screen
5353 * Option to output all Equivalent URIs (For RDF/XML format only)
54 -* Option to filter properties by ontology (when outputting equivalent URIs) by
 54+* Option to filter properties by ontology (when outputting equivalent URIs) by
5555 specified an URL to an OWL ontology definition. (For RDF/XML format only).
5656 * Much improved processing of SPARQL queries
5757 * Various refactoring
@@ -59,7 +59,7 @@
6060 ** Don't delete Original URI properties etc when deleting other facts (r151)
6161 ** Fixed error in isURL check (r153)
6262
63 -== RDFIO 0.2.0 ==
 63+== RDFIO 0.2.0 ==
6464
6565 Released on 2010-07-20
6666
@@ -70,10 +70,9 @@
7171 * Improved code structure and comments
7272 * Various small fixes
7373
74 -== RDFIO 0.1.0 ==
 74+== RDFIO 0.1.0 ==
7575
7676 Released on 2010-07-21
7777
7878 :Summary
7979 ;First release
80 -
Property changes on: trunk/extensions/RDFIO/RELEASE-NOTES
___________________________________________________________________
Added: svn:eol-style
8180 + native
Property changes on: trunk/extensions/RDFIO/COPYING
___________________________________________________________________
Added: svn:eol-style
8281 + native
Index: trunk/extensions/RDFIO/RDFIO.php
@@ -1,24 +1,23 @@
22 <?php
3 -
43 /**
54 * Initializing file for SMW RDFIO extension.
65 *
76 * @file
87 * @ingroup RDFIO
98 */
10 -if( !defined( 'MEDIAWIKI' ) ) {
 9+if ( !defined( 'MEDIAWIKI' ) ) {
1110 die( 'Not an entry point.' );
1211 }
1312
14 -define('RDFIO_VERSION', '0.5.0');
15 -
 13+define( 'RDFIO_VERSION', '0.5.0' );
 14+
1615 global $wgExtensionCredits;
1716
18 -$wgExtensionCredits['other'][]= array(
 17+$wgExtensionCredits['other'][] = array(
1918 'path' => __FILE__,
2019 'name' => 'RDFIO',
2120 'version' => RDFIO_VERSION,
22 - 'author' => array( '[http://saml.rilspace.org Samuel Lampa]' ),
 21+ 'author' => '[http://saml.rilspace.org Samuel Lampa]',
2322 'url' => 'http://www.mediawiki.org/wiki/Extension:RDFIO',
2423 'description' => 'Extended RDF Import/Export functionality, including SPARQL endpoint, for Semantic MediaWiki'
2524 );
@@ -28,7 +27,7 @@
2928 ****************************/
3029
3130 $smwgARC2Path = $smwgIP . '/libs/arc/';
32 -require_once($smwgARC2Path . '/ARC2.php');
 31+require_once( $smwgARC2Path . '/ARC2.php' );
3332
3433 /**************************
3534 * ARC2 RDF Store config *
@@ -45,24 +44,23 @@
4645 );
4746 $smwgDefaultStore = 'SMWARC2Store'; // Determines database table prefix
4847
49 -require_once("$IP/extensions/RDFIO/stores/SMW_ARC2Store.php");
50 -require_once("$IP/extensions/RDFIO/specials/SpecialARC2Admin.php");
 48+require_once( "$IP/extensions/RDFIO/stores/SMW_ARC2Store.php" );
 49+require_once( "$IP/extensions/RDFIO/specials/SpecialARC2Admin.php" );
5150
5251 /**************************
5352 * SMWWriter settings *
5453 **************************/
 54+// @todo FIXME: use auto loader where possible.
 55+include_once( "$IP/extensions/PageObjectModel/POM.php" );
 56+include_once( "$IP/extensions/SMWWriter/SMWWriter.php" );
5557
56 -include_once("$IP/extensions/PageObjectModel/POM.php");
57 -include_once("$IP/extensions/SMWWriter/SMWWriter.php");
58 -
5958 /**************************
6059 * RDFIO Components *
6160 **************************/
6261
63 -require_once("classes/Utils.php");
64 -require_once("classes/RDFStore.php");
65 -require_once("classes/SMWBatchWriter.php");
66 -require_once("classes/PageHandler.php");
67 -require_once("specials/SpecialRDFImport.php");
68 -require_once("specials/SpecialSPARQLEndpoint.php");
69 -
 62+require_once( "classes/Utils.php" );
 63+require_once( "classes/RDFStore.php" );
 64+require_once( "classes/SMWBatchWriter.php" );
 65+require_once( "classes/PageHandler.php" );
 66+require_once( "specials/SpecialRDFImport.php" );
 67+require_once( "specials/SpecialSPARQLEndpoint.php" );
Index: trunk/extensions/RDFIO/bundle/ARC2_SPARQLSerializerPlugin.php
@@ -11,184 +11,184 @@
1212
1313 */
1414
15 -ARC2::inc('Class');
 15+ARC2::inc( 'Class' );
1616
1717 class ARC2_SPARQLSerializerPlugin extends ARC2_Class {
1818
19 - function __construct($a = '', &$caller) {
20 - parent::__construct($a, $caller);
 19+ function __construct( $a = '', &$caller ) {
 20+ parent::__construct( $a, $caller );
2121 }
22 -
23 - function ARC2_SPARQLSerializerPlugin ($a = '', &$caller) {
24 - $this->__construct($a, $caller);
 22+
 23+ function ARC2_SPARQLSerializerPlugin ( $a = '', &$caller ) {
 24+ $this->__construct( $a, $caller );
2525 }
2626
2727 function __init() {
2828 parent::__init();
2929 }
3030
31 - function toString($infos){
 31+ function toString( $infos ) {
3232 $this->infos = $infos;
33 - return self::sparql_info_to_string($infos['query']);
 33+ return self::sparql_info_to_string( $infos['query'] );
3434 }
3535
36 - function sparql_info_to_string($t, $only_triples=false){
 36+ function sparql_info_to_string( $t, $only_triples = false ) {
3737 $string = '';
38 - if(isset($t['type'])){
39 - switch($t['type']){
 38+ if ( isset( $t['type'] ) ) {
 39+ switch( $t['type'] ) {
4040 case 'construct':
41 - $string .='CONSTRUCT { '.$this->sparql_info_to_string($t['construct_triples'], true).' } ';
 41+ $string .= 'CONSTRUCT { ' . $this->sparql_info_to_string( $t['construct_triples'], true ) . ' } ';
4242 case 'describe':
4343 case 'select':
44 - if(in_array($t['type'], array('select','describe'))){
45 - $string.= ' '.strtoupper($t['type']).' ';
46 - if (isset($t['result_vars'])) foreach($t['result_vars'] as $v){
47 - $string.= ' ?'.$v['var'];
 44+ if ( in_array( $t['type'], array( 'select', 'describe' ) ) ) {
 45+ $string .= ' ' . strtoupper( $t['type'] ) . ' ';
 46+ if ( isset( $t['result_vars'] ) ) foreach ( $t['result_vars'] as $v ) {
 47+ $string .= ' ?' . $v['var'];
4848 }
49 - if (isset($t['result_iris'])) foreach($t['result_iris'] as $v){
50 - $string.= ' <'.$v['iri'].'> ';
 49+ if ( isset( $t['result_iris'] ) ) foreach ( $t['result_iris'] as $v ) {
 50+ $string .= ' <' . $v['iri'] . '> ';
5151 }
5252 }
5353 case 'ask':
54 - if(!empty($t['dataset'])){
55 - foreach($t['dataset'] as $dataset){
56 - $string.= ' FROM '.(($dataset['named'])? 'NAMED ': '').'<'.$dataset['graph'].'> ';
 54+ if ( !empty( $t['dataset'] ) ) {
 55+ foreach ( $t['dataset'] as $dataset ) {
 56+ $string .= ' FROM ' . ( ( $dataset['named'] ) ? 'NAMED ': '' ) . '<' . $dataset['graph'] . '> ';
5757 }
5858 }
59 - if(!isset($t['pattern'])) var_dump($this->infos);
60 - else $string .= ' WHERE '.$this->sparql_info_to_string($t['pattern']).'';
 59+ if ( !isset( $t['pattern'] ) ) var_dump( $this->infos );
 60+ else $string .= ' WHERE ' . $this->sparql_info_to_string( $t['pattern'] ) . '';
6161 break;
6262 case 'triple':
63 - $string.= $this->triple_to_string($t);
 63+ $string .= $this->triple_to_string( $t );
6464 break;
6565 case 'union':
6666 $patterns = array();
67 - foreach($t['patterns'] as $pattern){
68 - $patterns[]='{'.$this->sparql_info_to_string($pattern, $only_triples).'}';
 67+ foreach ( $t['patterns'] as $pattern ) {
 68+ $patterns[] = '{' . $this->sparql_info_to_string( $pattern, $only_triples ) . '}';
6969 }
70 - $string .= implode(' UNION ', $patterns);
 70+ $string .= implode( ' UNION ', $patterns );
7171 break;
7272 case 'group':
7373 case 'triples':
7474 case 'optional':
75 - $pattern_string ='';
76 - foreach($t['patterns'] as $pattern){
77 - $pattern_string.=" ".$this->sparql_info_to_string($pattern, $only_triples)." ";
 75+ $pattern_string = '';
 76+ foreach ( $t['patterns'] as $pattern ) {
 77+ $pattern_string .= " " . $this->sparql_info_to_string( $pattern, $only_triples ) . " ";
7878 }
79 - switch($t['type']){
 79+ switch( $t['type'] ) {
8080 case 'group':
81 - $string.='{ '.$pattern_string.' }';
 81+ $string .= '{ ' . $pattern_string . ' }';
8282 break;
8383 case 'triples':
84 - $string.= $pattern_string;
 84+ $string .= $pattern_string;
8585 break;
8686 case 'optional':
87 - $string.= (!$only_triples)? 'OPTIONAL { '.$pattern_string.' }' : '{ '.$pattern_string.' }' ;
88 - break;
 87+ $string .= ( !$only_triples ) ? 'OPTIONAL { ' . $pattern_string . ' }' : '{ ' . $pattern_string . ' }' ;
 88+ break;
8989 }
9090 break;
9191 case 'filter':
92 - $string .=(!$only_triples)? "FILTER(".$this->sparql_info_to_string($t['constraint']).")" : '';
 92+ $string .= ( !$only_triples ) ? "FILTER(" . $this->sparql_info_to_string( $t['constraint'] ) . ")" : '';
9393 break;
9494 case 'built_in_call':
95 - $string .=$t['operator'].strtoupper($t['call'])."(";
96 - $args=array();
97 - foreach($t['args'] as $arg){ $args[]=$this->sparql_info_to_string($arg);
 95+ $string .= $t['operator'] . strtoupper( $t['call'] ) . "(";
 96+ $args = array();
 97+ foreach ( $t['args'] as $arg ) { $args[] = $this->sparql_info_to_string( $arg );
9898 }
99 - $string .=implode(',', $args).') ';
 99+ $string .= implode( ',', $args ) . ') ';
100100 break;
101101 case 'var':
102 - $var_string ='?'.$t['value'];
103 - if(isset($t['direction'])) $var_string = strtoupper($t['direction'])."(".$var_string.")";
 102+ $var_string = '?' . $t['value'];
 103+ if ( isset( $t['direction'] ) ) $var_string = strtoupper( $t['direction'] ) . "(" . $var_string . ")";
104104 $string .= $var_string;
105105 break;
106106 case 'literal':
107107 case 'literal1':
108108 case 'literal2':
109 - $string .= $this->term_to_string($t['type'], $t['value']);
110 - if(isset($t['datatype'])) $string .= '^^'.$t['datatype'];
111 - else if (isset($t['lang'])) $string .= '@'.$t['lang'];
 109+ $string .= $this->term_to_string( $t['type'], $t['value'] );
 110+ if ( isset( $t['datatype'] ) ) $string .= '^^' . $t['datatype'];
 111+ else if ( isset( $t['lang'] ) ) $string .= '@' . $t['lang'];
112112 break;
113113 case 'expression':
114114 $expressions = array();
115 - foreach($t['patterns'] as $p) { $expressions[]=$this->sparql_info_to_string($p);
 115+ foreach ( $t['patterns'] as $p ) { $expressions[] = $this->sparql_info_to_string( $p );
116116 }
117 - switch($t['sub_type']){
 117+ switch( $t['sub_type'] ) {
118118 case 'relational':
119 - $string.= implode($t['operator'], $expressions);
 119+ $string .= implode( $t['operator'], $expressions );
120120 break;
121121 case 'and':
122 - $string.= implode(' && ', $expressions);
 122+ $string .= implode( ' && ', $expressions );
123123 break;
124124 case 'or':
125 - $string.= implode(' || ', $expressions);
 125+ $string .= implode( ' || ', $expressions );
126126 break;
127 -
 127+
128128 default:
129 - $string.= implode($t['sub_type'], $expressions);
 129+ $string .= implode( $t['sub_type'], $expressions );
130130 break;
131131 }
132 - break;
 132+ break;
133133 }
134 -
 134+
135135 }
136 - else if(is_array($t)){
137 - foreach($t as $item){
138 - $string.= $this->sparql_info_to_string($item);
 136+ else if ( is_array( $t ) ) {
 137+ foreach ( $t as $item ) {
 138+ $string .= $this->sparql_info_to_string( $item );
139139 }
140140 }
141 - if(isset($t['order_infos'])){
142 - foreach($t['order_infos'] as $order){
143 - $string.= " ORDER BY ".$this->sparql_info_to_string($order);
 141+ if ( isset( $t['order_infos'] ) ) {
 142+ foreach ( $t['order_infos'] as $order ) {
 143+ $string .= " ORDER BY " . $this->sparql_info_to_string( $order );
144144 }
145145 }
146 - if(isset($t['limit'])){
147 - $string .= ' LIMIT '.$t['limit'];
 146+ if ( isset( $t['limit'] ) ) {
 147+ $string .= ' LIMIT ' . $t['limit'];
148148 }
149 - if(isset($t['offset'])){
150 - $string .= ' OFFSET '.$t['offset'];
 149+ if ( isset( $t['offset'] ) ) {
 150+ $string .= ' OFFSET ' . $t['offset'];
151151 }
152 -
 152+
153153 return $string;
154154 }
155 -
156 - function triple_to_string($t){
 155+
 156+ function triple_to_string( $t ) {
157157 $str = '';
158 - if(empty($t)) return '';
159 - foreach(array('s','p','o') as $term){
160 - $str.= ' '.$this->term_to_string($t[$term.'_type'], $t[$term]);
 158+ if ( empty( $t ) ) return '';
 159+ foreach ( array( 's', 'p', 'o' ) as $term ) {
 160+ $str .= ' ' . $this->term_to_string( $t[$term . '_type'], $t[$term] );
161161 }
162 - return $str.' . ';
 162+ return $str . ' . ';
163163 }
164 -
165 - function term_to_string($type, $val){
166 - switch($type){
 164+
 165+ function term_to_string( $type, $val ) {
 166+ switch( $type ) {
167167 case 'var':
168 - return '?'.$val;
 168+ return '?' . $val;
169169 case 'literal':
170170 case 'literal1':
171171 case 'literal2':
172172 case 'literal_long1':
173173 case 'literal_long2':
174174 $quot = '"';
175 - if (preg_match('/\"/', $val)) {
 175+ if ( preg_match( '/\"/', $val ) ) {
176176 $quot = "'";
177 - if (preg_match('/\'/', $val)) {
 177+ if ( preg_match( '/\'/', $val ) ) {
178178 $quot = '"""';
179 - if (preg_match('/\"\"\"/', $val) || preg_match('/\"$/', $val) || preg_match('/^\"/', $val)) {
 179+ if ( preg_match( '/\"\"\"/', $val ) || preg_match( '/\"$/', $val ) || preg_match( '/^\"/', $val ) ) {
180180 $quot = "'''";
181 - $val = preg_replace("/'$/", "' ", $val);
182 - $val = preg_replace("/^'/", " '", $val);
183 - $val = str_replace("'''", '\\\'\\\'\\\'', $val);
 181+ $val = preg_replace( "/'$/", "' ", $val );
 182+ $val = preg_replace( "/^'/", " '", $val );
 183+ $val = str_replace( "'''", '\\\'\\\'\\\'', $val );
184184 }
185185 }
186186 }
187 - if ((strlen($quot) == 1) && preg_match('/[\x0d\x0a]/', $val)) {
 187+ if ( ( strlen( $quot ) == 1 ) && preg_match( '/[\x0d\x0a]/', $val ) ) {
188188 $quot = $quot . $quot . $quot;
189189 }
190 - return $quot .$val. $quot ;
 190+ return $quot . $val . $quot ;
191191 case 'uri':
192 - return '<'.$val.'>';
 192+ return '<' . $val . '>';
193193 case 'bnode':
194194 default:
195195 return $val;
Index: trunk/extensions/RDFIO/README
@@ -8,23 +8,23 @@
99
1010 == Introduction ==
1111
12 -This extension extends the RDF import and export functionality in Semantic MediaWiki
13 -by providing import of arbitrary RDF triples (not only OWL ontologies, as before
14 -(see http://semantic-mediawiki.org/wiki/Help:Ontology_import), and a SPARQL endpoint
 12+This extension extends the RDF import and export functionality in Semantic MediaWiki
 13+by providing import of arbitrary RDF triples (not only OWL ontologies, as before
 14+(see http://semantic-mediawiki.org/wiki/Help:Ontology_import), and a SPARQL endpoint
1515 that allows write operations.
1616
17 -Technically, RDFIO implements the PHP/MySQL based triple store (and its accompanying
18 -SPARQL Endpoint) provided by the [http://arc.semsol.org/ ARC2] library. For updating
 17+Technically, RDFIO implements the PHP/MySQL based triple store (and its accompanying
 18+SPARQL Endpoint) provided by the [http://arc.semsol.org/ ARC2] library. For updating
1919 wiki pages with new triples on import/sparql update, the SMWWriter extension is used.
2020
21 -The RDF import stores the original URI of all imported RDF entities (in a special
22 -property), which can later be used by the SPARQL endpoint, instead of SMW's internal
23 -URIs, which thus allows to expose the imported RDF data "in its original formats",
24 -with its original URIs. This allows to use SMW as a collaborative RDF editor, in
25 -workflows together with other semantic tools, from which it is then possible to
 21+The RDF import stores the original URI of all imported RDF entities (in a special
 22+property), which can later be used by the SPARQL endpoint, instead of SMW's internal
 23+URIs, which thus allows to expose the imported RDF data "in its original formats",
 24+with its original URIs. This allows to use SMW as a collaborative RDF editor, in
 25+workflows together with other semantic tools, from which it is then possible to
2626 "export, collaboratively edit, and import again", to/from SMW.
2727
28 -This extensions was developed as part of a Google Summer of Code 2010 project. The
 28+This extensions was developed as part of a Google Summer of Code 2010 project. The
2929 project description can be found at http://www.mediawiki.org/wiki/User:SHL/GSoC2010
3030
3131 *Caution!* This extension is not yet ready for production use! Use it on your own risk!
@@ -55,5 +55,3 @@
5656 Please reports bugs and feature requests at Bugzilla:
5757 https://bugzilla.wikimedia.org/
5858 General feedback can be given at http://www.mediawiki.org/w/index.php?title=Extension_talk:RDFIO
59 -
60 -
Property changes on: trunk/extensions/RDFIO/README
___________________________________________________________________
Added: svn:eol-style
6159 + native
Index: trunk/extensions/RDFIO/classes/PageHandler.php
@@ -53,13 +53,13 @@
5454 $propertyErrorText = $property->getErrorText();
5555 $propertyHasError = ( $propertyErrorText != '' );
5656 if ( $propertyHasError ) {
57 - $this->addError( "<p>In RDFIOPageHandler::writeOrDeleteDataToWiki(): " . $property->getErrorText() . "</p>");
 57+ $this->addError( "<p>In RDFIOPageHandler::writeOrDeleteDataToWiki(): " . $property->getErrorText() . "</p>" );
5858 }
59 -
 59+
6060 $valueErrorText = $value->getErrorText();
6161 $valueHasError = ( $valueErrorText != '' );
6262 if ( $valueHasError ) {
63 - $this->addError( "<p>Error creating property value object in RDFIOPageHandler::writeOrDeleteDataToWiki():</p><p>" . $value->getErrorText() . "</p>");
 63+ $this->addError( "<p>Error creating property value object in RDFIOPageHandler::writeOrDeleteDataToWiki():</p><p>" . $value->getErrorText() . "</p>" );
6464 }
6565 if ( $delete ) {
6666 $this->m_smwwriter_remove->addPropertyObjectValue( $property, $value );
@@ -69,7 +69,7 @@
7070 $editmessage = "Importing properties. Last property added: " . $propertystring . " : " . $valuestring;
7171 }
7272 }
73 -
 73+
7474 $this->m_smwwriter->update( $this->m_smwwriter_remove, $this->m_smwwriter_add, $editmessage );
7575 $smwWriterError = $this->m_smwwriter->getError();
7676 $smwWriterHasError = ( $smwWriterError != '' );
@@ -77,7 +77,7 @@
7878 $this->addError( "<p>SMWWriter Error: " . $smwWriterError . "</p>" );
7979 }
8080 }
81 -
 81+
8282 /**
8383 * Delete the data in the object variables from the wiki page
8484 * corresponding to this page handler
@@ -88,13 +88,13 @@
8989
9090 /**
9191 * Wrapper method for wikiPageExistsSaveEditToken()
92 - * TODO Is this really needed?
 92+ * TODO Is this really needed?
9393 */
9494 private function checkWikiPageExists() {
9595 $this->m_wikipageexists = $this->wikiPageExistsSaveEditToken();
9696 return $this->m_wikipageexists;
9797 }
98 -
 98+
9999 /**
100100 * For a wiki page title, check if it exists (and at the same time, store an edit token),
101101 * and if not, create it.
@@ -113,15 +113,15 @@
114114 private function createWikiPage() {
115115 // Prepare a 'fake' request to the MediaWiki API, which we use internally
116116 // See http://www.mediawiki.org/wiki/API:Calling_internally for more info
117 - $fauxEditRequest = new FauxRequest(array (
 117+ $fauxEditRequest = new FauxRequest( array (
118118 'action' => 'edit',
119 - 'title' => $this->m_wikititlefull, // For the faux request, the namespace must be included in text form
 119+ 'title' => $this->m_wikititlefull, // For the faux request, the namespace must be included in text form
120120 'section' => '0',
121121 'summary' => 'New Page (by SMWRDFConnector)',
122122 'text' => '<!-- Empty page -->',
123123 'token' => $this->m_edittoken
124 - ));
125 - $editApi = new ApiMain($fauxEditRequest, $enableWrite = true);
 124+ ) );
 125+ $editApi = new ApiMain( $fauxEditRequest, $enableWrite = true );
126126 $editApi->execute();
127127 $editApiOutput = & $editApi->getResultData(); // TODO: Take care of this
128128 }
@@ -132,16 +132,16 @@
133133 * @return boolean
134134 */
135135 private function wikiPageExistsSaveEditToken() {
136 - $fauxRequest = new FauxRequest(array (
 136+ $fauxRequest = new FauxRequest( array (
137137 'action' => 'query',
138138 'prop' => 'info',
139139 'intoken' => 'edit',
140140 'titles' => $this->m_wikititlefull
141 - ));
 141+ ) );
142142 // We are using the MediaWiki API internally.
143143 // See http://www.mediawiki.org/wiki/API:Calling_internally
144144 // for more info
145 - $api = new ApiMain($fauxRequest);
 145+ $api = new ApiMain( $fauxRequest );
146146 $api->execute();
147147 $apioutput = & $api->getResultData(); // TODO: Take care of this
148148 $apioutputpages = $apioutput['query']['pages'];
@@ -150,13 +150,13 @@
151151 }
152152 // Using intricacies of array structure to determine if page exists
153153 // TODO: Use more robust method
154 - $pageismissing = count($apioutput['query']['pages'][-1]) > 0;
 154+ $pageismissing = count( $apioutput['query']['pages'][ -1] ) > 0;
155155 return !$pageismissing;
156156 }
157157
158158 /**
159159 * Initialize SMWWriter for the page corresponding to title
160 - * in object variable
 160+ * in object variable
161161 * @param boolean $delete
162162 */
163163 private function initSMWWriter( $delete = false ) {
@@ -180,17 +180,17 @@
181181
182182 private function addError( $errormessage ) {
183183 $this->m_errors[] = $errormessage;
184 - $this->m_haserrors = true;
 184+ $this->m_haserrors = true;
185185 }
186 -
 186+
187187 public function hasErrors() {
188 - return $this->m_haserrors;
 188+ return $this->m_haserrors;
189189 }
190 -
 190+
191191 public function getErrors( ) {
192192 return $this->m_errors;
193193 }
194 -
 194+
195195 public function getErrorText() {
196196 $errors = $this->m_errors;
197197 $errortext = '';
@@ -199,6 +199,6 @@
200200 $errortext .= "$error\n";
201201 $i++;
202202 }
203 - return $errortext;
 203+ return $errortext;
204204 }
205205 }
Index: trunk/extensions/RDFIO/classes/Utils.php
@@ -1,7 +1,6 @@
22 <?php
33
44 class RDFIOUtils {
5 -
65 /**
76 * Checks if $uri is an URI Resolver URI (i.e. an URI used by SMW to identify wiki pages)
87 * @param string $uri
@@ -11,7 +10,7 @@
1211 $isURIResolverURI = ( preg_match( '/Special:URIResolver/', $uri, $matches ) > 0 );
1312 return $isURIResolverURI;
1413 }
15 -
 14+
1615 /**
1716 * Checks if $uri is an ARC untitled identifier
1817 * @param string $uri
@@ -23,7 +22,7 @@
2423 $isArcUntitledNode = ( $isArcUntitledNode1 || $isArcUntitledNode2 );
2524 return $isArcUntitledNode;
2625 }
27 -
 26+
2827 /**
2928 * Checks if a string is a URL (i.e., starts with 'http:')
3029 * @param $text
@@ -33,7 +32,7 @@
3433 $isURL = ( preg_match( '/^http(s)?:/', $text, $matches ) > 0 );
3534 return $isURL;
3635 }
37 -
 36+
3837 /**
3938 * Extracts the "label", or "local part" of an URI, i.e. it removes
4039 * its namespace, or base URI
@@ -45,7 +44,7 @@
4645 $basepart = $uriparts[0];
4746 $localpart = $uriparts[1];
4847 if ( $localpart[1] != '' ) {
49 - return $localpart;
 48+ return $localpart;
5049 } else {
5150 return $basepart;
5251 }
@@ -53,7 +52,7 @@
5453
5554 /**
5655 * Customized version of the splitURI($uri) of the ARC2 library (http://arc.semsol.org)
57 - * Splits a URI into its base part and local part, and returns them as an
 56+ * Splits a URI into its base part and local part, and returns them as an
5857 * array of two strings
5958 * @param string $uri
6059 * @return array
@@ -64,7 +63,7 @@
6564 * the following namespaces may lead to conflated URIs,
6665 * we have to set the split position manually
6766 */
68 - if (strpos($uri, 'www.w3.org')) {
 67+ if ( strpos( $uri, 'www.w3.org' ) ) {
6968 $specials = array(
7069 'http://www.w3.org/XML/1998/namespace',
7170 'http://www.w3.org/2005/Atom',
@@ -73,33 +72,33 @@
7473 if ( $rdfiogBaseURIs != '' ) {
7574 $specials = array_merge( $specials, $rdfiogBaseURIs );
7675 }
77 - foreach ($specials as $ns) {
78 - if (strpos($uri, $ns) === 0) {
79 - $local_part = substr($uri, strlen($ns));
80 - if (!preg_match('/^[\/\#]/', $local_part)) {
 76+ foreach ( $specials as $ns ) {
 77+ if ( strpos( $uri, $ns ) === 0 ) {
 78+ $local_part = substr( $uri, strlen( $ns ) );
 79+ if ( !preg_match( '/^[\/\#]/', $local_part ) ) {
8180 return array( $ns, $local_part );
8281 }
8382 }
8483 }
8584 }
8685 /* auto-splitting on / or # */
87 - //$re = '^(.*?)([A-Z_a-z][-A-Z_a-z0-9.]*)$';
88 - if (preg_match('/^(.*[\#])([^\#]+)$/', $uri, $matches)) {
89 - return array($matches[1], $matches[2]);
 86+ // $re = '^(.*?)([A-Z_a-z][-A-Z_a-z0-9.]*)$';
 87+ if ( preg_match( '/^(.*[\#])([^\#]+)$/', $uri, $matches ) ) {
 88+ return array( $matches[1], $matches[2] );
9089 }
91 - if (preg_match('/^(.*[\:])([^\:\/]+)$/', $uri, $matches)) {
92 - return array($matches[1], $matches[2]);
 90+ if ( preg_match( '/^(.*[\:])([^\:\/]+)$/', $uri, $matches ) ) {
 91+ return array( $matches[1], $matches[2] );
9392 }
94 - if (preg_match('/^(.*[\/])([^\/]+)$/', $uri, $matches)) {
95 - return array($matches[1], $matches[2]);
 93+ if ( preg_match( '/^(.*[\/])([^\/]+)$/', $uri, $matches ) ) {
 94+ return array( $matches[1], $matches[2] );
9695 } /* auto-splitting on last special char, e.g. urn:foo:bar */
97 - return array($uri, '');
 96+ return array( $uri, '' );
9897
9998 }
100 -
 99+
101100 static function contains( $word, $subject ) {
102101 $contains = preg_match( "/$word/i", $subject ) > 0;
103 - return $contains;
 102+ return $contains;
104103 }
105104
106105 /**
@@ -112,7 +111,7 @@
113112 print_r( $arrayToShow );
114113 echo "</pre>";
115114 }
116 -
 115+
117116 static function showErrorMessage( $title, $message ) {
118117 global $wgOut;
119118 $errorhtml = RDFIOUtils::formatErrorHTML( $title, $message );
@@ -146,7 +145,7 @@
147146 // Convert any table to sortable wiki table
148147 return $html;
149148 }
150 -
 149+
151150 /**
152151 * Add css class attributes which make tables styled and sortable inside the wiki
153152 * @param string $html
@@ -169,7 +168,7 @@
170169 }
171170
172171 /**
173 - * Convert to character identifiers used to make URLs XML compliant
 172+ * Convert to character identifiers used to make URLs XML compliant
174173 * @param string $text
175174 * @return string $text
176175 */
@@ -180,9 +179,9 @@
181180 $text = str_replace( ' ', '-20', $text );
182181 return $text;
183182 }
184 -
 183+
185184 /**
186 - * Convert back character identifiers used to make URLs XML compliant
 185+ * Convert back character identifiers used to make URLs XML compliant
187186 * @param string $text
188187 * @return string $text
189188 */
@@ -190,12 +189,12 @@
191190 $text = str_replace( '-23', '#', $text );
192191 $text = str_replace( '-3A', ':', $text );
193192 $text = str_replace( '-3F', '?', $text );
194 - $text = str_replace( '-2D', '-', $text );
 193+ $text = str_replace( '-2D', '-', $text );
195194 $text = str_replace( '-20', ' ', $text );
196195 $text = str_replace( '-3D', '=', $text );
197196 return $text;
198197 }
199 -
 198+
200199 /**
201200 * @param string $text
202201 * @return string $text
@@ -216,7 +215,7 @@
217216 $text = str_replace( '-20', '_', $text );
218217 return $text;
219218 }
220 -
 219+
221220 /**
222221 * Remove characters which don't work in wiki titles
223222 * @param string $uri
@@ -246,5 +245,4 @@
247246 $value = str_replace( ']', '', $value );
248247 return $value;
249248 }
250 -
251249 }
Index: trunk/extensions/RDFIO/classes/SMWBatchWriter.php
@@ -31,7 +31,7 @@
3232 $rdfiogPropertiesToUseAsWikiTitle,
3333 $rdfiogUseNSPrefixInWikiTitleForProperties,
3434 $rdfiogUseNSPrefixInWikiTitleForEntities;
35 -
 35+
3636 if ( $dataformat == 'triples_array' ) {
3737 $this->m_triples = $importdata;
3838 } else {
@@ -45,7 +45,7 @@
4646 $this->m_parser = ARC2::getRDFXMLParser();
4747 $this->parse();
4848 } else if ( $this->m_dataformat == 'turtle' ) {
49 - $this->m_unparseddata = $wgRequest->getText('importdata');
 49+ $this->m_unparseddata = $wgRequest->getText( 'importdata' );
5050 $this->m_parser = ARC2::getTurtleParser();
5151 $this->parse();
5252 }
@@ -98,7 +98,7 @@
9999 }
100100
101101 /**
102 - * Check for namespaces lacking a prefix ("abbreviation"), in the
 102+ * Check for namespaces lacking a prefix ("abbreviation"), in the
103103 * current namespace prefix configuration
104104 */
105105 public function checkForNamespacesWithoutPrefix() {
@@ -133,7 +133,7 @@
134134 $entityuris = array_merge( $subjecturis, $valueuris );
135135 $entityuris = array_unique( $entityuris );
136136 $unabbreviateduris = array();
137 - foreach( $entityuris as $entityuri ) {
 137+ foreach ( $entityuris as $entityuri ) {
138138 $titlebypropertyuriindex = '';
139139 $titlebypropertyuriindex = $this->getWikiTitleByPropertyURIIndex( $entityuri );
140140 if ( $titlebypropertyuriindex == '' ) {
@@ -193,7 +193,7 @@
194194 // The page below should not be deleted on delete operations
195195 if ( !$this->m_delete ) {
196196 // Add type info to the Original URI property
197 - $property_hastypeurl = array( array( 'p' => 'Has type', 'v' => 'URL') );
 197+ $property_hastypeurl = array( array( 'p' => 'Has type', 'v' => 'URL' ) );
198198 $origuripage = new RDFIOPageHandler( 'Original URI', SMW_NS_PROPERTY, $property_hastypeurl );
199199 $this->addToPages( $origuripage );
200200 }
@@ -282,7 +282,7 @@
283283 $page->writeOrDeleteDataToWiki();
284284 if ( $page->hasErrors() ) {
285285 $errortitle = "Error for wikipage \"" . $page->getWikiTitleFull() . "\"</h3>";
286 - $wgOut->addHTML( RDFIOUtils::formatErrorHTML( $errortitle, $page->getErrorText() ));
 286+ $wgOut->addHTML( RDFIOUtils::formatErrorHTML( $errortitle, $page->getErrorText() ) );
287287 }
288288 }
289289 }
@@ -298,7 +298,7 @@
299299 $page->deleteDataFromWiki();
300300 if ( $page->hasErrors() ) {
301301 $errortitle = "Error for wikipage \"" . $page->getWikiTitleFull() . "\"</h3>";
302 - $wgOut->addHTML( RDFIOUtils::formatErrorHTML( $errortitle, $page->getErrorText() ));
 302+ $wgOut->addHTML( RDFIOUtils::formatErrorHTML( $errortitle, $page->getErrorText() ) );
303303 }
304304 }
305305 }
@@ -333,7 +333,7 @@
334334 * @return array $triples
335335 */
336336 function getTriplesForSubject( $subjecturi ) {
337 - $reconstructedIndex = array( $subjecturi => $this->m_tripleindex[$subjecturi]);
 337+ $reconstructedIndex = array( $subjecturi => $this->m_tripleindex[$subjecturi] );
338338 $triples = ARC2::getTriplesFromIndex( $reconstructedIndex );
339339 return $triples;
340340 }
@@ -354,11 +354,11 @@
355355 function getUniquePropertyURIs() {
356356 $tripleindex = $this->m_tripleindex;
357357 $properties = array();
358 - foreach( $tripleindex as $cur_props ) {
359 - foreach( $cur_props as $cur_prop => $cur_propdata ) {
 358+ foreach ( $tripleindex as $cur_props ) {
 359+ foreach ( $cur_props as $cur_prop => $cur_propdata ) {
360360 $properties[$cur_prop] = array(
361 - 'type' => $cur_propdata[0]['type'],
362 - 'datatype' => $cur_propdata[0]['datatype']
 361+ 'type' => $cur_propdata[0]['type'],
 362+ 'datatype' => $cur_propdata[0]['datatype']
363363 ); // Only the type info is interesting here
364364 }
365365 }
@@ -372,16 +372,16 @@
373373 function getUniqueValueURIs() {
374374 $tripleindex = $this->m_tripleindex;
375375 $value_uris_data = array();
376 - foreach( $tripleindex as $cur_props ) {
377 - foreach( $cur_props as $cur_prop => $cur_propdatas ) {
 376+ foreach ( $tripleindex as $cur_props ) {
 377+ foreach ( $cur_props as $cur_prop => $cur_propdatas ) {
378378 foreach ( $cur_propdatas as $cur_propdata ) {
379379 $value = $cur_propdata['value'];
380380 $valuetype = $cur_propdata['type'];
381381 $valuedatatype = $cur_propdata['datatype'];
382382 if ( $valuetype == 'uri' ) {
383383 $value_uris_data[$value] = array(
384 - 'type' => $valuetype,
385 - 'datatype' => $valuedatatype
 384+ 'type' => $valuetype,
 385+ 'datatype' => $valuedatatype
386386 );
387387 }
388388 }
@@ -392,15 +392,15 @@
393393 }
394394
395395 /**
396 - * Create a property array with "Original URI" as property,
397 - * and $uri as subject
 396+ * Create a property array with "Original URI" as property,
 397+ * and $uri as subject
398398 * @param string $uri
399399 * @return array $origuripropertyarray
400400 */
401401 function createOrigURIPropertyArray( $uri ) {
402402 $origuripropertyarray = array(
403 - 'p' => 'Original URI',
404 - 'v' => $uri );
 403+ 'p' => 'Original URI',
 404+ 'v' => $uri );
405405 return $origuripropertyarray;
406406 }
407407
@@ -412,8 +412,8 @@
413413 */
414414 function createEquivURIPropertyArray( $uri ) {
415415 $equivuripropertyarray = array(
416 - 'p' => 'Equivalent URI',
417 - 'v' => $uri );
 416+ 'p' => 'Equivalent URI',
 417+ 'v' => $uri );
418418 return $equivuripropertyarray;
419419 }
420420
@@ -434,7 +434,7 @@
435435 return 'String';
436436 }
437437 } else {
438 - $this->addError('Unknown entity type in SMWBatchWriter.php:convertARCTypeToSMWType');
 438+ $this->addError( 'Unknown entity type in SMWBatchWriter.php:convertARCTypeToSMWType' );
439439 }
440440 // TODO: Expand with more options
441441 }
@@ -485,7 +485,6 @@
486486 return $this->m_haserrors;
487487 }
488488
489 -
490489 /**
491490 * Get an array with current errors
492491 * @return array
@@ -510,7 +509,7 @@
511510 }
512511
513512
514 - ///////////// PREVIOUSLY THE EQUIV URI CLASS //////////////////////
 513+ //////////// / PREVIOUSLY THE EQUIV URI CLASS //////////////////////
515514
516515
517516 /**
@@ -549,7 +548,7 @@
550549 if ( $titlebypropertyuriindex != '' ) {
551550 $wikititle = $titlebypropertyuriindex;
552551 } else if ( ( $this->m_usenspintitles_entities && !$isproperty ) ||
553 - ( $this->m_usenspintitles_properties && $isproperty ) ){
 552+ ( $this->m_usenspintitles_properties && $isproperty ) ) {
554553 $wikititle = $this->abbreviateNSFromURI( $uri );
555554 } else {
556555 $wikititle = RDFIOUtils::extractLabelFromURI( $uri );
@@ -633,15 +632,15 @@
634633
635634 if ( $localpart == '' ) {
636635 $uri = $basepart;
637 - } else if ( substr($basepart, 0, 1) == '_' ) {
 636+ } else if ( substr( $basepart, 0, 1 ) == '_' ) {
638637 // Change ARC:s default "random string", to indicate more clearly that
639638 // it lacks title
640 - $uri = str_replace('arc','untitled',$localpart);
641 - } else if ( substr($basepart, 0, 7) == 'http://' ) {
 639+ $uri = str_replace( 'arc', 'untitled', $localpart );
 640+ } else if ( substr( $basepart, 0, 7 ) == 'http://' ) {
642641 // If the abbreviation does not seem to have succeeded,
643642 // fall back to use only the local part
644643 $uri = $localpart;
645 - } else if ( substr($basepart, -1) == ':' ) {
 644+ } else if ( substr( $basepart, -1 ) == ':' ) {
646645 // Don't add another colon
647646 $uri = $basepart . $localpart;
648647 } else if ( $basepart == false || $basepart == '' ) {
@@ -665,17 +664,17 @@
666665
667666 if ( $localpart == '' ) {
668667 $uri = $basepart;
669 - } else if ( substr($basepart, 0, 1) == '_' ) {
 668+ } else if ( substr( $basepart, 0, 1 ) == '_' ) {
670669 // Change ARC:s default "random string", to indicate more clearly that
671670 // it lacks title
672 - $uri = str_replace('arc','untitled',$localpart);
 671+ $uri = str_replace( 'arc', 'untitled', $localpart );
673672 } else {
674 - $basepart = $this->getPrefixForNS($basepart);
675 - if ( substr($basepart, 0, 7) == 'http://' ) {
 673+ $basepart = $this->getPrefixForNS( $basepart );
 674+ if ( substr( $basepart, 0, 7 ) == 'http://' ) {
676675 // If the abbreviation does not seem to have succeeded,
677676 // fall back to use only the local part
678677 $uri = $localpart;
679 - } else if ( substr($basepart, -1) == ':' ) {
 678+ } else if ( substr( $basepart, -1 ) == ':' ) {
680679 // Don't add another colon
681680 $uri = $basepart . $localpart;
682681 } else {
Index: trunk/extensions/RDFIO/classes/RDFStore.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * RDFIOStore contains utility functionality that requires connecting to the
 5+ * RDFIOStore contains utility functionality that requires connecting to the
66 * ARC based RDF store
77 * @author samuel.lampa@gmail.com
88 * @package RDFIO
@@ -21,18 +21,18 @@
2222 function getOrigURIURI() {
2323 return $this->getURIResolverURI() . 'Property-3AOriginal_URI';
2424 }
25 -
 25+
2626 /**
27 - * Get SMWs internal URI for corresponding to the "Equivalent URI" property
 27+ * Get SMWs internal URI for corresponding to the "Equivalent URI" property
2828 * @return string
2929 */
3030 function getEquivURIURI() {
3131 return 'http://www.w3.org/2002/07/owl#sameAs';
3232 }
33 -
 33+
3434 /**
3535 * Get SMWs internal URI for corresponding to the "Equivalent URI" property,
36 - * for property pages
 36+ * for property pages
3737 * @return string
3838 */
3939 function getEquivURIURIForProperty() {
@@ -40,7 +40,7 @@
4141 }
4242
4343 /**
44 - * For a given RDF URI, return it's original URI, as defined in wiki articles
 44+ * For a given RDF URI, return it's original URI, as defined in wiki articles
4545 * by the "Original URI" property
4646 * @param string $uri
4747 * @return string $origuri
@@ -50,8 +50,8 @@
5151 $store = $this->m_arcstore;
5252 $origuriuri = $this->getOrigURIURI();
5353 $q = "SELECT ?origuri WHERE { <$uri> <$origuriuri> ?origuri }";
54 - $rs = $store->query($q);
55 - if (!$store->getErrors()) {
 54+ $rs = $store->query( $q );
 55+ if ( !$store->getErrors() ) {
5656 $rows = $rs['result']['rows'];
5757 $row = $rows[0];
5858 $origuri = $row['origuri'];
@@ -60,9 +60,9 @@
6161 }
6262 return $origuri;
6363 }
64 -
 64+
6565 /**
66 - * For a given RDF URI, return it's corresponding equivalend URIs
 66+ * For a given RDF URI, return it's corresponding equivalend URIs
6767 * as defined in wiki articles by the Equivalent URI property
6868 * @param string $uri
6969 * @param boolean $is_property
@@ -77,18 +77,18 @@
7878 $equivuriuri = $this->getEquivURIURI();
7979 }
8080 $q = "SELECT ?equivuri WHERE { <$uri> <$equivuriuri> ?equivuri }";
81 - $rs = $store->query($q);
82 - if (!$store->getErrors()) {
 81+ $rs = $store->query( $q );
 82+ if ( !$store->getErrors() ) {
8383 $equivuris = $rs['result']['rows'];
8484 foreach ( $equivuris as $equivuriid => $equivuri ) {
85 - $equivuris[$equivuriid] = $equivuri['equivuri'];
86 - }
 85+ $equivuris[$equivuriid] = $equivuri['equivuri'];
 86+ }
8787 } else {
8888 die( "Error in ARC Store: " . print_r( $store->getErrors(), true ) );
8989 }
9090 return $equivuris;
9191 }
92 -
 92+
9393 /**
9494 * @param string $ouri
9595 * @return string $uri
@@ -98,8 +98,8 @@
9999 $store = $this->m_arcstore;
100100 $origuriuri = $this->getOrigURIURI();
101101 $q = "SELECT ?uri WHERE { ?uri <$origuriuri> <$origuri> }";
102 - $rs = $store->query($q);
103 - if (!$store->getErrors()) {
 102+ $rs = $store->query( $q );
 103+ if ( !$store->getErrors() ) {
104104 if ( $rs !== '' ) {
105105 $rows = $rs['result']['rows'];
106106 $row = $rows[0];
@@ -121,8 +121,8 @@
122122 $store = $this->m_arcstore;
123123 $equivuriuri = $this->getEquivURIURI();
124124 $q = "SELECT ?uri WHERE { ?uri <$equivuriuri> <$equivuri> }";
125 - $rs = $store->query($q);
126 - if (!$store->getErrors()) {
 125+ $rs = $store->query( $q );
 126+ if ( !$store->getErrors() ) {
127127 $rows = $rs['result']['rows'];
128128 $row = $rows[0];
129129 $uri = $row['uri'];
@@ -141,7 +141,7 @@
142142 $uriresolveruri = $resolver->getFullURL() . '/';
143143 return $uriresolveruri;
144144 }
145 -
 145+
146146 /**
147147 * For a URI that is defined using the "Original URI" property, return the wiki
148148 * article corresponding to that entity
@@ -149,7 +149,7 @@
150150 * @return string $wikititle;
151151 */
152152 function getWikiTitleByOriginalURI( $uri ) {
153 - $wikititleresolveruri = $this->getURIForOrigURI( $uri );
 153+ $wikititleresolveruri = $this->getURIForOrigURI( $uri );
154154 $resolveruri = $this->getURIResolverURI();
155155 $wikititle = str_replace( $resolveruri, '', $wikititleresolveruri );
156156 $wikititle = str_replace( 'Property-3A', '', $wikititle );

Status & tagging log