-
Notifications
You must be signed in to change notification settings - Fork 19
Add reverse property #2
Comments
It doesn't seem that
|
Yeah, it seems there is a bit of chicken and egging here. I believe schema.org doesn't use it in examples because it isn't in the spec. I think there is also a preference among many people behind schema.org for RDFa or JSON-LD since they are "better" than microdata. The point of trying to make a microdata Rec is that the world at large seems to prefer microdata by a significant margin. I agree the value is clear, and with well-defined processing, and no backwards-compatibility problem I can see, it seems reasonable to add this at least while we;re in effective development and see if e.g. schema.org takes it up. |
From a Google perspective, if I remember right... roughly @itemprop-reverse was proposed during the "Microdata or RDFa or both" debates of 2011-13, but then JSON-LD came along and was sufficiently different to both, and added real value in various settings, that most syntax discussions moved towards "hmm JSON-LD is probably the easiest for people to create". I don't believe we can currently parse @itemprop-reverse, I can look into getting that addressed but yes, chicken/egg. This always was a niche case, even when there was only one syntax. @chaals - do you know if Yandex can parse itemprop-reverse already, or would amend its parsers as this spec matures? Re "the world at large seems to prefer microdata by a significant margin", it did have a good head start, but there is a ton of JSON-LD out there too and I consistently hear from publishers that it is less complex in terms of workflow/maintenance. |
Actually, we came up with |
I've edited to add https://www.w3.org/wiki/WebSchemas/InverseProperties to @chaals opening comment here as it has a lot of examples and earlier discussion. |
Hmmm. I think we could leave this Wontfix for now, unless there is great pressure. RDFa and JSON-LD can both do the necessary, so a vocabulary can always just say "use them instead"… |
@chaals @gkellogg has anyone worked out test cases? Here is a normal syntax example, except creatorOf is not an official term at schema.org:
Here is how it might look if we allowed itemprop-reverse:
Here is a bogus example that should fail, because literals can't have outgoing properties (ish):
... so this should fail somehow. Are there other corner cases to enumerate? itemref? Should we note that @itemid can be used instead, with different nesting structure? What should we say about Microdata "1.0" parsers encountering itemprop-reverse -based markup? Perhaps just that publishers adopting the property ought to be aware that older parsers may extract only a subset. For example, consider this:
Currently Google's Microdata parser pulls out the Book section and ignores the Person and creator part. |
As mentioned in an email, the Microdata to RDF test suite includes such tests. See test 0081-0084. Using rdf.greggkellogg.net/distiller, I get the following Turtle output: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
[
a schema:Book;
schema:about [
a schema:Volcano;
schema:name "Eyjafjallajokull"
];
schema:creator [ a schema:Person];
schema:name "Some book name here."
] . This uses a straight-forward implementation as described in Microdata to RDF. |
Let's now try to find ugly corner cases. Can we find a way for @itemref to make this confusing enough for parsers not to agree? /cc @unor who I see on Stackoverflow was quite on top of this stuff a while back. Borrowing an example, ... but using the 'alumniOf' / 'alumni' pair: Plain Microdata @itemref:
Here's that with @itemprop-reverse in the referenced section,
|
Trying those last 2 tests in http://rdf.greggkellogg.net/distiller First the basic @itemref:
And then with itemprop-reverse:
This all seems as it should be. |
Important opensource Microdata parsers? I would consider both the RDF community and the SEO / CMS add on scene here. PythonLooking into Python situation, it is not clear to me which is the most popular addon for rdflib, but back in the day there were parsers from both @iherman and @edsu.
Javascript
|
neither the Google nor Yandex tools seem to pick this up. I doubt Yandex will implement this unless it becomes common, and that in turn probably depends on another search system picking it up. Marked "Maybe Later" (so we can look for closed things we might want to do after all) and closed for now. |
microdata makes it hard to have inverses, unlike RDFa and JSON-LD. This means that any vocabulary which wants to work with all three has to add a whole set of inverse properties to make microdata useful.
A
reverse
property, or similar, as per w3c/microdata-rdf#24 would be useful.See also https://www.w3.org/wiki/WebSchemas/InverseProperties (notes from schema.org discussions a few years ago).
The text was updated successfully, but these errors were encountered: