http://www.mediawiki.org/wiki/Special:Code/MediaWiki/98046

Revision: 98046
Author:   samuellampa
Date:     2011-09-25 01:59:36 +0000 (Sun, 25 Sep 2011)
Log Message:
-----------
Changed getName() to getUri() for subject/object, and to getLexicalForm() for 
literals

Modified Paths:
--------------
    trunk/extensions/RDFIO/stores/SMW_ARC2Store.php

Modified: trunk/extensions/RDFIO/stores/SMW_ARC2Store.php
===================================================================
--- trunk/extensions/RDFIO/stores/SMW_ARC2Store.php     2011-09-25 00:49:39 UTC 
(rev 98045)
+++ trunk/extensions/RDFIO/stores/SMW_ARC2Store.php     2011-09-25 01:59:36 UTC 
(rev 98046)
@@ -54,7 +54,7 @@
      */
     function updateData( SMWSemanticData $data ) {
         $export = SMWExporter::makeExportData( $data );
-        $subject_uri = SMWExporter::expandURI( 
$export->getSubject()->getName() );
+        $subject_uri = SMWExporter::expandURI( $export->getSubject()->getUri() 
);
 
         // remove subject from triple store
         $this->removeDataForURI( $subject_uri );
@@ -74,19 +74,20 @@
             $pre_str = "";
 
             if ( $object instanceof SMWExpLiteral ) {
-                $obj_str = "\"" . $object->getName() . "\"" . ( ( 
$object->getDatatype() == "" ) ? "" : "^^<" . $object->getDatatype() . ">" );
+               // @todo FIXME: Add escaping for results of getLexicalForm()?
+                $obj_str = "\"" . $object->getLexicalForm() . "\"" . ( ( 
$object->getDatatype() == "" ) ? "" : "^^<" . $object->getDatatype() . ">" );
             } elseif ( $object instanceof SMWExpResource ) {
-                $obj_str = "<" . SMWExporter::expandURI( $object->getName() ) 
. ">";
+                $obj_str = "<" . SMWExporter::expandURI( $object->getUri() ) . 
">";
             } else {
                 $obj_str = "\"\"";
             }
 
             if ( $subject instanceof SMWExpResource ) {
-                $sub_str = "<" . SMWExporter::expandURI( $subject->getName() ) 
. ">";
+                $sub_str = "<" . SMWExporter::expandURI( $subject->getUri() ) 
. ">";
             }
 
             if ( $predicate instanceof SMWExpResource ) {
-                $pre_str = "<" . SMWExporter::expandURI( $predicate->getName() 
) . ">";
+                $pre_str = "<" . SMWExporter::expandURI( $predicate->getUri() 
) . ">";
             }
 
             $sparqlUpdateText .= $sub_str . " " . $pre_str . " " . $obj_str . 
" .\n";
@@ -224,7 +225,7 @@
             $dv = SMWDataValueFactory::newTypeIDValue( '_wpg' );
             $dv->setTitle( $title );
             $exp = $dv->getExportData();
-            $uri = $exp->getSubject()->getName();
+            $uri = $exp->getSubject()->getUri();
         } else {
             // There could be other types as well that we do NOT handle here
         }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to