Re: Can properties have no value?

At 02:13 PM 8/2/99 -0700, Perry A. Caro wrote:
http://lists.w3.org/Archives/Public/www-rdf-comments/1999JulSep/0020

>  Based on the following production in the
>formal grammar BNF:
>
>[6.12] propertyElt  :== // fourth alternative:
>			'<' propName idRefAttr? bagIdAttr? propAttr* '/>'
>
>... a completely empty XML element (no attributes, no children) looks like a
>valid property.  But what does it mean? ... I
>don't think a completely empty XML tag is a valid property.

Good question.  I agree with your assessment that the grammar as
specified does permit an empty element in the position of a property
expression and that this should generally not be encouraged.

As you point out, the narrative description of propertyElt:
http://www.w3.org/TR/REC-rdf-syntax/#grammar

  Each propertyElt E contained by a Description element results in the
  creation of a triple {p,r,v} where:
   ...
   3.If E is an empty element (no content), v is the resource whose
     identifier is given by the resource attribute of E. If the
     content of E contains no XML markup or if parseType="Literal" is
     specified in the start tag of E then v is the content of E (a
     literal). Otherwise, the content of E must be another Description
     or container and v is the resource named by the (possibly
     implicit) ID or about of that Description or container.

omits the case that E is an empty element and E has no resource attribute.

If I were to define what is meant by

  <rdf:Description about="http://fiction.org/>
    <s:myProperty/>
  </rdf:Description>

I would define it to mean that the value of s:myProperty is an
anonymous resource about which I know nothing else.  If an
RDF schema defining s:myProperty were added, there could be
an rdfs:range assertion for s:myProperty that then allows me
to add an rdf:type property to this anonymous resource.

Or more hypothetically, given some as-yet-unspecified interface
it could also be possible to say, for example 'the resource that
has the s:myProperty relationship with http://fiction.org/ has
the s:myOtherProperty relationship with http://other.org/'; that
is, construct a graph reference to this anonymous resource.

>  When I give the following to
>SiRPAC:
>
>1: <?xml version="1.0"?>
>2: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>3:          xmlns:test="test#">
>4:   <rdf:Description about="http://www.w3.org/RDF/Implementations/SiRPAC/">
>5:     <test:noValue/>
>6:   </rdf:Description>
>7: </rdf:RDF>
>
>I get a valid triple:
>
>triple('test#noValue',
>       'http://www.w3.org/RDF/Implementations/SiRPAC/',
>       'online#genid2').
>
>But what is the value?  Is it a made-up literal?  A made-up resource?

Janne seemed to have made the same guess that I proposed above;
the value is an anonymous resource, for which SiRPAC generates
an internal identifier.

>This gets even more confusing when I switch to the abbreviated form:
>
>1: <?xml version="1.0"?>
>2: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>3:          xmlns:test="test#">
>4:   <rdf:Description about="http://www.w3.org/RDF/Implementations/SiRPAC/"
>5:    test:noValue=""/>
>6: </rdf:RDF>
>
>SiRPAC generates no triples!??!

I call this a SiRPAC bug.  This clearly states that the value of
the test:noValue statement is the empty string (a Literal).
It is the same as

  <rdf:Description>
   <test:noValue></test:noValue>
  </rdf:Description>


>  Based on my
>interpretation of the narrative description of the grammar in the RDFMS, I
>think the BNF should really be:
>
>[6.12] propertyElt  :== // fourth alternative:
>	'<' propName bagIdAttr? (idAttr | resourceAttr) propAttr* '/>'
>
>In other words:
>	* 0 or 1 bagID attribute
>	* AND, an ID attribute OR a resource reference
>	* AND, 0 or more property attributes
>
>This makes it clear that the value of an empty tag is either the ID or the
>resource reference.

I think there is a reasonable interpretation of the grammar as
specified, though I cannot assert that this was the intent of
the Working Group.  While I think this usage should not be encouraged
for the time being, I do not see a need to disallow it.  Others are
welcome to comment on the merits of clarifying the specification
either way.

>The abbreviated form of ="" should be explicitly disallowed.

I disagree with this.  The empty string is a valid literal.

-Ralph

Received on Wednesday, 22 September 1999 16:36:12 UTC