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

On Wed, 9 May 2001, Jan Grant wrote:

> Ok, this should be a quick one.

Change of words to the M+S something like this:

current spec [for reference] in section 6:

Grammar production 6.3 is


  [6.3] description    ::= '<rdf:Description' idAboutAttr? bagIdAttr? propAttr* '/>'
                         | '<rdf:Description' idAboutAttr? bagIdAttr? propAttr* '>'
                            propertyElt* '</rdf:Description>'
                         | typedNode


And the words following the grammar are:

Each propertyElt E contained by a Description element results in the
creation of a triple {p,r,v} where:

1. p is the expansion of the namespace-qualified tag name (Generic
Identifier) of E. This expansion is generated by concatenating the
namespace name given in the namespace declaration with the LocalPart of
the qualified name.
2. r is
 - the resource whose identifier is given by the value of the about
   attribute of the Description or
 - a new resource whose identifier is the value of the ID attribute of
   the Description, if present; else the new resource has no identifier.
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.

It's this last paragraph which is a bit confused. Making it explicit:

"If E is an empty element (no content) then:
 - If E has a resource attribute, v is the resource whose identifier
      is given by the resource attribute of E
 - Otherwise, if E has parseType="Resource" then v is an anonymous
   resource; if not, v is the empty literal.
If E is NOT the empty element,  then:
 - 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.
"

Modulo container changes, I think that's OK.

Thus

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:random="http://random.ioctl.org/#">

<rdf:Description rdf:about="http://random.ioctl.org/#bar">
  <random:someProperty rdf:resource="http://random.ioctl.org/#foo" />
</rdf:Description>

</rdf:RDF>

should produce the output:

triple("http://random.ioctl.org/#bar", "http://random.ioctl.org/#someProperty", "http://random.ioctl.org/#foo")

whereas

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:random="http://random.ioctl.org/#">

<rdf:Description rdf:about="http://random.ioctl.org/#bar">
  <random:someProperty />
</rdf:Description>

</rdf:RDF>

should produce the output:

triple("http://random.ioctl.org/#bar", "http://random.ioctl.org/#someProperty", literal(""))

and

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:random="http://random.ioctl.org/#">

<rdf:Description rdf:about="http://random.ioctl.org/#bar">
  <random:someProperty rdf:parseType="Literal"/>
</rdf:Description>

</rdf:RDF>

should ALSO produce the output:

triple("http://random.ioctl.org/#bar", "http://random.ioctl.org/#someProperty", literal(""))

The other cases appear to be:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:random="http://random.ioctl.org/#">

<rdf:Description rdf:about="http://random.ioctl.org/#bar">
  <random:someProperty rdf:parseType="Resource" />
</rdf:Description>

</rdf:RDF>

which should produce

triple("http://random.ioctl.org/#bar", "http://random.ioctl.org/#someProperty", anonymous("genid#1"))

Finally,

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:random="http://random.ioctl.org/#">

<rdf:Description rdf:about="http://random.ioctl.org/#bar">
  <random:someProperty rdf:parseType="Literal"
    rdf:resource="http://random.ioctl.org/#foo" />
</rdf:Description>

</rdf:RDF>

Should be flagged as an error.

jan

PS. I can attach these examples separately if people prefer; I've used
the syntax reminiscent of a SiRPAC dump to indicate the triples that
should be output, with the addition of an anonymous(id) syntax to
properly indicate an anonymous resource. With such resources, the ID
itself carries no meaning and serves purely to identify where the same
anonymous resource occurs multiple times in a resulting tripledump.

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287163 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
"My army boots contain everything not in them." - Russell's pair o' Docs.

Received on Thursday, 17 May 2001 04:13:18 UTC