json-schema-org / json-schema-spec

The JSON Schema specification
http://json-schema.org/
Other
3.43k stars 251 forks source link

How do I get the use Json to get the "about" and "mention" property to work with several subjects? #1491

Closed concerro closed 4 months ago

concerro commented 4 months ago

The section of the code I'm having trouble with is starts with "about". I'm not a programmer/developer so I'm sure I'm missing something that's obvious to the rest of you.

<script type="application/ld+json">
  "@context": "https://schema.org",
  "@type": "WebPage",
  "@id": "https://easyflooringnc.com/#webpage",
  "url": "https://easyflooringnc.com/",
  "name": "Easy Flooring NC",
  "isPartOf": "https://easyflooringnc.com/#website",
  "image": "https://easyflooringnc.com/wp-content/uploads/2022/09/Easy-Flooring-NC-Logo-e1700848051187.png",
  "thumbnailUrl": "https://easyflooringnc.com/wp-content/uploads/2022/09/Easy-Flooring-NC-Logo-e1700848051187.png",
  "datePublished": "2023-11-11",
  "dateModified": "2024-01-01",
  "inLanguage": "en-US"
  "mainEntity": {
  "@id": "Flooring Installation"},
  "about": [
        {
        "@id": "Easy Flooring NC"
        }

        {
            "@type": "Thing",
            "name": "Flooring",
            "description": "Flooring is the general term for a permanent covering of a floor or for the work of installing such a floor covering. Floor covering is a term to generically describe any finish material applied over a floor structure to provide a walking surface",
            "SameAs": [
                "https://www.wikidata.org/wiki/Q1433006",
                "http://en.wikipedia.org/wiki/Flooring"
            ]
        },
        {
            "@type": "Thing",
            "name": "Wilmington, North Carolina",
            "description": "Wilmington is a port city in and the county seat of New Hanover County in coastal southeastern North Carolina United States. With a population of 115 451 in the 2020 census it is the eighth-most populous city in the state",
            "SameAs": [
                "https://www.wikidata.org/wiki/Q659400",
                "http://en.wikipedia.org/wiki/Wilmington,_North_Carolina",
                "https://www.google.com/search?kgmid=/m/0yj9v"
            ]
        }
    ],
    "mentions": [
        {
            "@type": "Thing",
            "name": "Flooring",
            "description": "Flooring is the general term for a permanent covering of a floor or for the work of installing such a floor covering. Floor covering is a term to generically describe any finish material applied over a floor structure to provide a walking surface",
            "SameAs": [
                "https://www.wikidata.org/wiki/Q1433006",
                "http://en.wikipedia.org/wiki/Flooring"
            ]
        },
        {
            "@type": "Thing",
            "name": "Carpet",
            "description": "A carpet is a textile floor covering typically consisting of an upper layer of pile attached to a backing. The pile was traditionally made from wool but since the 20th century synthetic fibers such as polypropylene nylon or polyester have often been used as these fibers are less expensive than wool",
            "SameAs": [
                "https://www.wikidata.org/wiki/Q163446",
                "http://en.wikipedia.org/wiki/Carpet"
            ]
        },

            ]
        },
</script>
Era-cell commented 4 months ago

You have missed a comma after {@id} in "about". And where us the JSON Schema for it?

notEthan commented 4 months ago

This is schema.org's JSON-LD, which is unrelated to the JSON Schema specification.

concerro commented 4 months ago

You have missed a comma after {@id} in "about". And where us the JSON Schema for it?

Thanks. The comma removed the error I was getting.

Era-cell commented 4 months ago

You have missed a comma after {@id} in "about". And where us the JSON Schema for it?

Thanks. The comma removed the error I was getting.

Great, 😸