r98046 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98045‎ | r98046 | r98047 >
Date:01:59, 25 September 2011
Author:samuellampa
Status:deferred
Tags:
Comment:
Changed getName() to getUri() for subject/object, and to getLexicalForm() for literals
Modified paths:
  • /trunk/extensions/RDFIO/stores/SMW_ARC2Store.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RDFIO/stores/SMW_ARC2Store.php
@@ -54,7 +54,7 @@
5555 */
5656 function updateData( SMWSemanticData $data ) {
5757 $export = SMWExporter::makeExportData( $data );
58 - $subject_uri = SMWExporter::expandURI( $export->getSubject()->getName() );
 58+ $subject_uri = SMWExporter::expandURI( $export->getSubject()->getUri() );
5959
6060 // remove subject from triple store
6161 $this->removeDataForURI( $subject_uri );
@@ -74,19 +74,20 @@
7575 $pre_str = "";
7676
7777 if ( $object instanceof SMWExpLiteral ) {
78 - $obj_str = "\"" . $object->getName() . "\"" . ( ( $object->getDatatype() == "" ) ? "" : "^^<" . $object->getDatatype() . ">" );
 78+ // @todo FIXME: Add escaping for results of getLexicalForm()?
 79+ $obj_str = "\"" . $object->getLexicalForm() . "\"" . ( ( $object->getDatatype() == "" ) ? "" : "^^<" . $object->getDatatype() . ">" );
7980 } elseif ( $object instanceof SMWExpResource ) {
80 - $obj_str = "<" . SMWExporter::expandURI( $object->getName() ) . ">";
 81+ $obj_str = "<" . SMWExporter::expandURI( $object->getUri() ) . ">";
8182 } else {
8283 $obj_str = "\"\"";
8384 }
8485
8586 if ( $subject instanceof SMWExpResource ) {
86 - $sub_str = "<" . SMWExporter::expandURI( $subject->getName() ) . ">";
 87+ $sub_str = "<" . SMWExporter::expandURI( $subject->getUri() ) . ">";
8788 }
8889
8990 if ( $predicate instanceof SMWExpResource ) {
90 - $pre_str = "<" . SMWExporter::expandURI( $predicate->getName() ) . ">";
 91+ $pre_str = "<" . SMWExporter::expandURI( $predicate->getUri() ) . ">";
9192 }
9293
9394 $sparqlUpdateText .= $sub_str . " " . $pre_str . " " . $obj_str . " .\n";
@@ -224,7 +225,7 @@
225226 $dv = SMWDataValueFactory::newTypeIDValue( '_wpg' );
226227 $dv->setTitle( $title );
227228 $exp = $dv->getExportData();
228 - $uri = $exp->getSubject()->getName();
 229+ $uri = $exp->getSubject()->getUri();
229230 } else {
230231 // There could be other types as well that we do NOT handle here
231232 }

Status & tagging log