0

What the correct way to implement https://schema.org/GenderType for https://schema.org/Person in JSON-LD.

I Attempted bellow:

{ 
"@context": "http://schema.org",
    "@type": "Person",
    "givenName": "First Name",
    "familyName": "Last name",
    "gender": {
        "@type": "GenderType",
        "gender" "Male"
    } 
  }

The following works:

{ 
"@context": "http://schema.org",
    "@type": "Person",
    "givenName": "First Name",
    "familyName": "Last name",
    "gender": "Male" 
}

Though that would use https://schema.org/Text

An other solution:

{ 
"@context": "http://schema.org",
    "@type": "Person",
    "givenName": "First Name",
    "familyName": "Last name",
    "gender": "https://schema.org/Male" 
}

Seems to be valid at https://search.google.com/structured-data/testing-tool Though not sure if that how it mean to be implemented.

2
  • I went with the last version. It doesn't show any error and seems to look fine. Commented Dec 1, 2020 at 11:32
  • 1
    The second one should also be fine. You don't need to do the full URL if you have already defined it as the @context. Commented Dec 2, 2020 at 22:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.