w3c / microdata-rdf

Specification of the extraction/transformation of Microdata content to RDF
15 stars 9 forks source link

Section 6.3 (Generate the triples): type extraction is underspecified #22

Open sesuncedu opened 9 years ago

sesuncedu commented 9 years ago
3. For each type returned from element.itemType of the element defining the item.
     1. If type is an absolute URL, generate the following triple:
             subject subject predicate [rdf:type] object type (as a URI reference)

What should happen if the type is not an absolute URL? According to HTML Microdata §5.2 the URL must be absolute.

Must an error be signaled? Must the item be discarded? Is behavior undefined?

The introduction of second level of list (with only one item) makes it look like there might be some lost text.

4. Set type to the first value returned from element.itemType of the element defining the item.
5. Otherwise, set type to current type from evaluation context if not empty.

I assume that 5 only applies if no itemtype property was given (or no valid item type property?)

gkellogg commented 9 years ago

If there were to return something other than an absolute IRI, then the value should be ignored, although there are no tests for this, so you could say that the behavior is undefined. There are no errors that must be signaled; typically processors just eat bad data without emitting triples. Of course, you're free to detect and raise errors. My own processors typically only do this in validation mode.

... makes it look like there might be some lost text.

Yes, something seems to have been lost in editing. You're interpretation is correct. 4) would read "Set type to the first value returned from element.itemType of the element defining the item which is an absolute URL, if any." (or words to that effect.

sesuncedu commented 9 years ago

My default approach would be to resolve the relative URI; however the only defined error behaviorseems to be for cyclic graphs, which require an item to discarded ("microdata error" seems to be reserved for this situation).