Different properties with same values

12 views
Skip to first unread message

Sergio Redondo

unread,
Feb 20, 2020, 4:32:15 AM2/20/20
to Semantic Search Marketing
Hi all.

When we markup our pages, sometimes we find properties that share the same values, for example if in a post, the author and the publisher is the same entity.
Is there any way to combine both properties so as not to have to repeat the values? I think about something like:

"author" : {
"@type" : "Organization", 
"name" : "ACME"
},
"publisher" : {
"@type" : "Organization",
"name" : "ACME"
},


turn into


["author","publisher"] : {
"@type" : "Organization", 
"name" : "ACME"
},

Thanks in advance.

Richard Wallis

unread,
Feb 20, 2020, 5:33:36 AM2/20/20
to Sergio Redondo, Semantic Search Marketing
The simple answer is no.

However there is another approach to this.  Take a look at this:
{
    "@context": "http://schema.org",
    "@graph": [
        {
            "@type": "Book",
            "name": "A Book",
            "author": {
                "@type": "Organization",
                "@id": "#org"

            },
            "publisher": {
                "@type": "Organization",
                "@id": "#org"
            }
        },
        {
            "@type": "Organization",
            "@id": "#org",
            "name": "An organization"
        }
    ]
}

At first look it looks even more verbose, but when you imagine the organisation description is fully populated with logo, description, address, etc. the reduction in repeated data you are looking for becomes more apparent.

If you dig into the JSON-LD standards TL;DR you will find that the nested syntax, as per your example, is just shorthand for the graph based syntax in my example.

If you put my example through Google's SDTT  you get this:
image.png
Which recreates the nested view to help understanding.  

Note the @id value has been expanded to a full URL by the JSON-LD processor they use.  

This gives a clue to how this approach could be used to connect descriptions across a site and the web in general.
    "publisher": {"@type": "Organization", "@id": "http://mysite.com/MyCompany"}  
Allows you to link to a fuller description elsewhere.  Note however, some consumers of structured data want you to provide at least a basic description of the entity you are referencing within the data of the page the reference occurs.

Hope that helps,

    Richard.


Richard Wallis
Founder, Data Liberate
http://dataliberate.com
Twitter: @rjw



--
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/8d79531a-1c9d-4b99-8f05-ba07dd12836a%40googlegroups.com.

Sergio Redondo

unread,
Feb 20, 2020, 6:04:21 AM2/20/20
to Semantic Search Marketing
Yeah, you're right. Probably, it's the best option we have till now.
Thank you very much.
To unsubscribe from this group and stop receiving emails from it, send an email to semantic-search-marketing+unsub...@googlegroups.com.

Mark van Berkel

unread,
Feb 25, 2020, 9:27:41 AM2/25/20
to Sergio Redondo, Semantic Search Marketing
Hello,

Just a quick observation/suggestion. If you are reusing an item in one page based on its @id then all you need is the @id itself.  You would declare the @id in one place with all its details and only need the @id in the other locations of the graph.  The example of using in the second place provided earlier is:
    "publisher": {"@type": "Organization", "@id": "http://mysite.com/MyCompany"}  
Could be expressed as:
    "publisher": { "@id": "http://mysite.com/MyCompany" }  

Regards,
Mark

To unsubscribe from this group and stop receiving emails from it, send an email to semantic-search-ma...@googlegroups.com.

--
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/82a2a3d6-f9d7-49cd-85d8-bda48e62930f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages