Closed Bug 268841 Opened 20 years ago Closed 7 years ago

GetTarget() return null for empty literals.

Categories

(Core Graveyard :: RDF, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: aperez, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

From javascript, datasource.GetTarget(resource, emptyproperty, true) returns
null instead of an empty literal when the resource is described as this:

<ex:MyClass about="urn:myresource">
  <ex:myproperty/>
</ex:MyClass>

The problem also exists is the resource is described as this:

<ex:MyClass about="urn:myresource">
  <ex:myproperty></ns:myproperty>
</ex:MyClass>


Reproducible: Always
Steps to Reproduce:
var res = rdf.GetResource("urn:myresource");
var prop = rdf.GetResource("http://www.example.com/myproperty");
var target = ds.GetTarget(res, prop, true);
Actual Results:  
target === null

Expected Results:  
a Components.interfaces.nsIRDFLiteral whose Value attribute is the empty string
(I doubt if it could be null, undefined or the empty string, but I belive it
should be the empty string.)

Discussion about empty elements in www-rdf-comments mailing list:

  http://lists.w3.org/Archives/Public/www-rdf-comments/2001JanMar/0128.html


W3C RDF Issue tracking (contains resolution):

  http://www.w3.org/2000/03/rdf-tracking/#rdfms-empty-property-elements


W3C test cases for empty property elements:

  http://www.w3.org/2000/10/rdf-tests/rdfcore/rdfms-empty-property-elements/
This should be trivial to fix.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: nobody → axel
Blocks: 11650
Status: ASSIGNED → NEW
Sorry for not getting this fixed back when. Today, we're not going to take changes like this to RDF anymore, so I'm resolving this WONTFIX.
Assignee: axel → nobody
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.