web-dev-qa-db-ja.com

多くのJobPostingアイテムを同じファイルに配置できますか?

これはSchema.orgのJobPostingにJSON-LDをコーディングする良い方法ですか?

同じファイルにいくつかのJobPostingアイテムを配置します。これは正常に機能していますか?これは正しい方法ですか?

<script type="application/ld+json"> {
            "@context" : "http://schema.org/",
            "@type" : "JobPosting",
            "title" : "Job1",
            "description" : "",
            "datePosted" : "2018-10-26",
            "validThrough" : "2018-11-02",
            "hiringOrganization": {
                 ...
            },
        "jobLocation": {
        "@type": "Place",
        "address": {
                    ...
          }
        },                    
    }
</script>


<script type="application/ld+json"> {
                        "@context" : "http://schema.org/",
                        "@type" : "JobPosting",
                        "title" : "Job2",
                        "description" : "",
                        "datePosted" : "2018-10-26",
                        "validThrough" : "2018-11-02",
                        "hiringOrganization": {
                             ...
                        },
                    "jobLocation": {
                    "@type": "Place",
                    "address": {
                                ...
                      }
                    },                    
                }
</script>
<script type="application/ld+json"> {
                    "@context" : "http://schema.org/",
                    "@type" : "JobPosting",
                    "title" : "Job3",
                    "description" : "",
                    "datePosted" : "2018-10-26",
                    "validThrough" : "2018-11-02",
                    "hiringOrganization": {
                         ...
                    },
                "jobLocation": {
                "@type": "Place",
                "address": {
                            ...
                  }
                },                    
            }
</script>
    .
    .
    .
    .
    .
<script type="application/ld+json"> {
                    "@context" : "http://schema.org/",
                    "@type" : "JobPosting",
                    "title" : "job - n",
                    "description" : "",
                    "datePosted" : "2018-10-26",
                    "validThrough" : "2018-11-02",
                    "hiringOrganization": {
                         ...
                    },
                "jobLocation": {
                "@type": "Place",
                "address": {
                            ...
                  }
                },                    
            }
</script>
1
Sammu Sundar

それは正しいことですが、配列を使用することもできます:

<script type="application/ld+json">
[{
    "@context": "http://schema.org/",
    "@type": "JobPosting",
    "title": "Job1",
    "description": "",
    "datePosted": "2018-10-26",
    "validThrough": "2018-11-02",
    "hiringOrganization": {
        ...
    }
    ,
    "jobLocation": {
        "@type": "Place",
        "address": {
            ...
        }
    }
},
{
    "@context": "http://schema.org/",
    "@type": "JobPosting",
    "title": "Job2",
    "description": "",
    "datePosted": "2018-10-26",
    "validThrough": "2018-11-02",
    "hiringOrganization": {
        ...
    }
    ,
    "jobLocation": {
        "@type": "Place",
        "address": {
            ...
        }
    }
}]
</script>

詳細: https://stackoverflow.com/questions/30723531/best-json-ld-practices-using-multiple-script-elements