Last modified: 2014-09-23 20:00:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29779, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27779 - SMW_dumpRDF.php does not appear to work for SMW >= 1.5.5
SMW_dumpRDF.php does not appear to work for SMW >= 1.5.5
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Markus Krötzsch
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-28 07:40 UTC by Alex
Modified: 2014-09-23 20:00 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Temporary patch to SMW_Serializer_RDFXML.php as suggested by Markus on semediawiki-user mailing list (661 bytes, patch)
2011-02-28 07:40 UTC, Alex
Details

Description Alex 2011-02-28 07:40:26 UTC
Created attachment 8220 [details]
Temporary patch to SMW_Serializer_RDFXML.php as suggested by Markus on semediawiki-user mailing list

The SMW_dumpRDF script does not appear to work properly for MW 1.16.2, SMW
1.5.5.2 or 1.5.6, on PHP 5.2.10. I have a variety of other extensions installed, but these problems persist even if I disable all other extensions (none of which require patching MW or SMW code). All properties in the system have their own pages and types, and all types have their own pages.

The script will go through some content and generate a file up to about 330 KB, then stop with the following error message: 

Catchable fatal error: Argument 1 passed to SMWSerializer::requireDeclaration() must be an instance of SMWExpResource, instance of SMWExpData given, called in /path/to/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_RDFXML.php on line 158 and defined in /path/to/extensions/SemanticMediaWiki/includes/export/SMW_Serializer.php on line 218

I have only tested this on a system with multiple wikis that use a lot of shared code and symlinks, e.g., "cd /path/to/mwinstall; export MW_INSTALL_PATH=. && php extensions/SemanticMediaWiki/maintenance/SMW_dumpRDF.php -o /path/to/file" 

The result is the same whether I use "-o /path/to/file" or "> /path/to/file". 

The "/path/to" above represents the actual path; it gets reported in full by the error message and correctly reports the symlink target. 

The attached patch from Markus to includes/export/SMW_Serializer_RDFXML.php seems to allow the export to work. I have not fully validated the export data, but the dump appears to capture everything it is supposed to.
Comment 1 Alex 2011-02-28 08:29:40 UTC
Additional comment: The export outputs "rdf:datatype" instead of "rdf:Datatype". Protege (4.1b) complains about this: it causes reasoners not to start because the schema at http://www.w3.org/2000/01/rdf-schema labels datatype as "Datatype" and Protege imports all the files at the top of an SMW RDF export. 

A simple 

perl -i.bak -pe 's/rdf:datatype/rdf:Datatype/g' filename 

fixes the file so Protege likes it, but perhaps you may want to change line 145 of SMW_Serializer_RDFXML.php to 

							$this->post_ns_buffer .= ' rdf:Datatype="' . $object->getDatatype() . '"';

(see also SMW_QP_RSSlink.php)

I am not sure if other OWL/RDF editors are as picky, but hopefully this will help limit any problems.
Comment 2 p858snake 2011-04-30 00:09:47 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 3 Sumana Harihareswara 2011-12-23 18:16:20 UTC
Adding "need-review" keyword.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links