I think there are two issues behind what you try to achieve:
1. A mechanism for reusing parts of a data structure, similar to a macro.
2. A mechanism for defining variants of an entity.
Historically, GoodRelations and
schema.org have tried to leave out mechanisms for #1 and preferred the materialization of the final data structures. So if a product is available in three sizes, we would create the full data for three products etc. An exception are patterns for opening hours where we had a model for recurring patterns.
A common motivation for a more compact form of markup and a vocabulary for representing *rules* that define variants and repeating entities is that the data will be less verbose.
While this is true in the raw form, it does not hold if you factor in data compression, which is standard in HTTP by now. It makes no difference whether you represent a rule using your vocabulary or whether you use a program to materialize the output of the rule, and then compress it with ZIP or something else. At least in theory, ideal solutions of both will have the same size (because they contain the same information entropy).
On the contrary, production rules in a vocabulary and macro mechanisms in a syntax create a wealth of theoretical and practical problems.
Just a few:
1. Unclear identity criteria
You may be tempted to represent multiple properties using the same data structure which happen to carry the identical value at the moment but have a different path of evolution.
This may sound purely theoretical, but can lead to practical problems. (See the vast amount of discussion on blank nodes in RDF ;-).
2. Circular references and decidability
You can easily create faulty data structures for which the processing will lead to infinite loops or other problems.
3. More cost for the consuming component
What you save at the markup level may lead to much more complicated processing for the consuming client.
For instance, answering a query will require that the query processor will match both materialized objects (e.g. fully specified products) and rules defining a set of variants.
Now, consider that the Web is a vastly distributed, evolving system, with caching, CDNs etc.
In Web development, we see a trend to static site generators, which are basically following the "materialization" paradigm, rather than DB-powered, dynamic Web sites.
Personally, I found itemref interesting, but too complex and error-prone for many developers, and it was mainly needed because of the false popularity of reusing the same literals for visible content and for data markup in the era of RDFa and Microdata. Fortunately, it is now commonly agreed that reusing visible content for data markup is inferior to separate blocks of JSON-LD. While JSON-LD blocks repeat some of the values from the HTML elements for visible content, we are freed from aligning the data markup with the organization of the HTML DOM. Such worked well only for trivial vocabularies and/or if the data model matches the HTML DOM, which is rare as soon as legacy HTML templates kick in.
So in a nutshell, I think we do not need an mechanism like itemref in JSON-LD. You can always use global identifiers so reference sub-structures (albeit the support by search engines is limited), or put the rules for variants or macros in the server-side components in any programming language you want.
Hope that helps!
Best wishes
Martin Hepp
> --
> You received this message because you are subscribed to the Google Groups "Semantic Search Marketing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
semantic-search-ma...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/semantic-search-marketing/3813197f-3f4f-42ed-a833-ae2dcd1f685dn%40googlegroups.com.