schema.org LD+JSON decision tree example #2

by Krzysztof Tomasz Zembrowski

HTML

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "Tree",
    "text": "Title",
    "content": {
        "question": {
            "@type": "Question",
            "@id": "q1",
            "text": "First question"
        },
        "question": {
            "@type": "Question",
            "@id": "q2",
            "text": "Second question"
        },
        "choice": {
            "@type": "Choice",
            "@id": "c1_1",
            "text": "Yes"
        },
        "choice": {
            "@type": "Choice",
            "@id": "c1_2",
            "text": "No"
        },
        "choice": {
            "@type": "Choice",
            "@id": "c2_1",
            "text": "Yes"
        },
        "choice": {
            "@type": "Choice",
            "@id": "c2_2",
            "text": "No"
        },
        "answer": {
            "@type": "Answer",
            "@id": "a1",
            "text": "Answer 1"
        },
        "answer": {
            "@type": "Answer",
            "@id": "a2",
            "text": "Answer 2"
        },
        "answer": {
            "@type": "Answer",
            "@id": "a3",
            "text": "Answer 3"
        }
    },
    "relation": {
        "start": {
            "@type": "Question",
            "id": "q1"
        },
        "child": {
            "@type": "Relation",
            "@parent": "q1",
            "child": "c1_1"
        },
        "child": {
            "@type": "Relation",
            "@parent": "q2",
            "child": "c1_2"
        }
        [...]
    }
}
</script>