Page MenuHomePhabricator

rdf export does not generate valid XML
Closed, ResolvedPublic

Description

Author: aaron.graves

Description:
I go to the following URL:

http://wikis.company.com/wiki_instance/index.php/Special:ExportRDF/Namespace:Random_Page

And the XML that is generated is malformed. It appears that any tags that use the dublin core namespace are not printed.

<swivt:Subject rdf:about="&wiki;Foobar">
...
< rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Author Name</>
< rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Title</>
...

As you might guess, those lines ought to look like this:

<dc:author rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Author Name</dc:author>
<dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Title</dc:title>

Upgrading from 1.3 to 1.4.2 caused this problem. We can't downgrade because we really need the JSON export, but we need the rdf for backwards compatibility as well.

We are running:
Apache 2
PHP 5
MedaWiki 1.14.0
SMW 1.4.2
Ubuntu

Digging through the code, I noticed that $property->getQName() inside the printExpData(...) function (in SMW_SpecialOWLExport.php) is returning a blank string for any DC tags. Unfortunately, I am not familiar with the codebase, and I spent a long time spinning my wheels, trying to figure out where that object gets constructed, with no success.

I should mention that we ran all of the command-line maintenance tools, including the upgrade script and the one that rebuilds all of the semantic data once we upgraded to 1.4.2. Other than this one issue, SMW / MW seem to function as expected.

As I mentioned earlier, this behavior started upon upgrading from SMW 1.3 to 1.4.2 and is not present in 1.3. This bug is causing us a great deal of pain; any assistance the developers might be able to offer would be greatly appreciated.


Version: unspecified
Severity: major

Details

Reference
bz17953

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:30 PM
bzimport set Reference to bz17953.

The URL you provided above does not seem to work (server not found). I need to have a closer look to see what is wrong. Some aspects of the vocabulary import have changed slightly; maybe this is the reason.

ianmcorvidae wrote:

I am experiencing the same problem. Versions:

MediaWiki 1.15.0
PHP 5.2.9 (apache)
MySQL 5.0.67
Semantic Mediawiki 1.4.2

wiki: http://wiki.ianmcorvidae.net/

example (failed) RDF export: http://wiki.ianmcorvidae.net/wiki/Special:ExportRDF/Ian_McEwen

In this case, I'm using FOAF; I also see that in the section where the various 'xmlns:' declarations are made, there is none made for FOAF:

<rdf:RDF
xmlns:rdf="&rdf;"
xmlns:rdfs="&rdfs;"
xmlns:owl ="&owl;"
xmlns:swivt="&swivt;"
xmlns:wiki="&wiki;"
xmlns:property="&property;"
xmlns:="">

additionally, FOAF cannot be found in the doctype header, although it appears all other such things are

<!DOCTYPE rdf:RDF[
<!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
<!ENTITY owl 'http://www.w3.org/2002/07/owl#'>
<!ENTITY swivt 'http://semantic-mediawiki.org/swivt/1.0#'>
<!ENTITY wiki 'http://wiki.ianmcorvidae.net/wiki/Special:URIResolver/'>
<!ENTITY property 'http://wiki.ianmcorvidae.net/wiki/Special:URIResolver/Property-3A'>
<!ENTITY wikiurl 'http://wiki.ianmcorvidae.net/wiki/'>
]>

The failing line (in this case; I don't have much using imported vocabularies, given they didn't work):

< rdf:resource="&wiki;Ian_McEwen"/>

which should be (I believe):

     
<foaf:name rdf:resource="$wiki;Ian_McEwen"/>

ianmcorvidae wrote:

Pardon; the line should probably be: <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Ian McEwen</foaf:name> or so. (amending previous comment)

This bug is fixed in the current SVN version.

  • Bug 19563 has been marked as a duplicate of this bug. ***