Closed Bug 237784 Opened 20 years ago Closed 1 month ago

It's impossible to load RDF files if they don't have the extension ".rdf"

Categories

(Core Graveyard :: RDF, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: Manuel.Spam, Assigned: mozilla)

Details

Attachments

(1 file)

776 bytes, application/x-zip-compressed
Details
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7a) Gecko/20040219
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7a) Gecko/20040219

It's possible to write RDF-files without the extension ".rdf" without problems
(it's possible to create datasources for empty or not existing files which don't
have the extension ".rdf"). As soon as I want to get an datasource for an
RDF-file without the ".rdf" extension, which contains data, I get the following
error in javascript console:


Fehler: uncaught exception: [Exception... "Component returned failure code:
0x804e03f3 [nsIRDFService.GetDataSourceBlocking]"  nsresult: "0x804e03f3
(<unknown>)"  location: "JS frame :: chrome://test/content/test.js :: testload
:: line 4"  data: no]


Why can I write RDF-files with (for example) the extension ".dat" but can't open
the data I've written? I don't see any reason for the limitation to this one
extension.

Reproducible: Always
Steps to Reproduce:
1. Unzip the attached zipfile
2. edit the file-URL in the test code to the path where you've extracted the RDF
file to.
3. Run the test code
4. Now you'll get an alert which displays the one item saved in the test RDF
5. rename the test.rdf to test.dat and change the file URL to the new file
6. Run test code again

Actual Results:  
I get an error "<unknown>" in javascript console

Expected Results:  
The RDF service should load the file without throwing this error.
Attached file test code
The RDFXMLDataSource just feeds the data to the parser, which is left to guess
how to parse it.  So the parser looks at the MIME type of the data, which it
ends up having to get from the extension.

Shouldn't the RDFXMLDataSource explicitly set the type hint on the channel
(prior to calling Open())?  See
http://lxr.mozilla.org/seamonkey/source/netwerk/base/public/nsIChannel.idl#112
Status: UNCONFIRMED → NEW
Ever confirmed: true
Since we want to implement further serialisations of RDF, like N-Triples, there 
is no real way to say that we want to have XML/RDF.
That this is ok for creating files comes from the fact that that throws an
NS_ERROR_FILE_NOT_FOUND very early in the game, and we never try to get the 
mimetype for that.
I'm not really sure why the content sniffing doesn't get us text/xml though.
OS: Windows 2000 → All
Hardware: PC → All
QA Contact: rdf
Product: Core → Core Graveyard
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: