0
votes

This might be a dumb question but I am trying to figure out how to load the actual Person schema as a JSON-LD document from https://schema.org/Person.

For my understanding there should be a script tag that encloses the schema definition as follows:

<script type="application/ld+json">
{

// here would be the schema definition in JSON-LD format

}
<script/>

However, I cannot find any tag like this on this website.

There is another endpoint to download a collection of schemas here https://schema.org/version/latest/schemaorg-current-http.jsonld. In this schema I can find a Person schema with the following search query "@id": "schema:Person". However, this object does not seem to bee complete as it only contains the following information:

    {
      "@id": "schema:Person",
      "@type": "rdfs:Class",
      "http://www.w3.org/2002/07/owl#equivalentClass": {
        "@id": "http://xmlns.com/foaf/0.1/Person"
      },
      "rdfs:comment": "A person (alive, dead, undead, or fictional).",
      "rdfs:label": "Person",
      "rdfs:subClassOf": {
        "@id": "schema:Thing"
      },
      "schema:source": {
        "@id": "http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews"
      }
    }

It also does not seem very efficient to always download the entire json-ld collection if I am only interested in the Person schema. So I guess, I missunderstand something in the process of retrieving a JSON-LD document from schema.org.

Can somebody explain how I am supposed to consume schemas form schema.org?

EDIT: To make it more clear let me add a use case. The following json-ld document which is from here:

{  // external (all terms in this example)
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://w3id.org/citizenship/v1"
  ],
  "type": [
    "VerifiableCredential",
    "PermanentResidentCard"
  ],
  "credentialSubject": {
    "id": "did:example:123",
    "type": [
      "PermanentResident",
      "Person"
    ],
    "givenName": "JOHN",
    "familyName": "SMITH",
    "gender": "Male",
    "image": "data:image/png;base64,iVBORw0KGgo...kJggg==",
    "residentSince": "2015-01-01",
    "lprCategory": "C09",
    "lprNumber": "000-000-204",
    "commuterClassification": "C1",
    "birthCountry": "Bahamas",
    "birthDate": "1958-08-17"
  },
  "issuer": "did:example:456",
  "issuanceDate": "2020-04-22T10:37:22Z",
  "identifier": "83627465",
  "name": "Permanent Resident Card",
  "description": "Government of Example Permanent Resident Card.",
  "proof": {
    "type": "Ed25519Signature2018",
    "created": "2020-04-22T10:37:22Z",
    "proofPurpose": "assertionMethod",
    "verificationMethod": "did:example:456#key-1",
    "jws": "eyJjcml0IjpbImI2NCJdLCJiNjQiOmZhbHNlLCJhbGciOiJFZERTQSJ9..BhWew0x-txcroGjgdtK-yBCqoetg9DD9SgV4245TmXJi-PmqFzux6Cwaph0r-mbqzlE17yLebjfqbRT275U1AA"
  }
}

In this example I can get the schema definitions by following the links https://www.w3.org/2018/credentials/v1 and https://w3id.org/citizenship/v1. With the @type I know that the I should only consider VerifiableCredential for the first context and PermanentResidentCard (although it should be PermanentResident IMO since birthDate is not part of PermanentResidentCard) for the second link. Therefore, I know for example that birthDate can be interpreted as date.

How can I get the same logic with schemas from schema.org?

1
I think you should tell us a bit more about your use case. Also take a look at schema.org/Person which lists properties you might want to use. My feeling is, that you are looking for a schema (like in xml-schema) while there really is only a Json-Ld context ... which is something different. - jschnasse
I added an example which should make it more clear. For my understanding the context provides sort of like the vocabulary such that two parties can serialise the rest of the object and reason about the same things. Therefore, I should somehow be able to retrieve the schema definition form schema.org too. - simibac
In the schemaorg-current-http.jsonld items like properties are defined as their own entities and they all connect together to provide the full picture. E.g. Person is a subClassOf Thing and many properties link to Thing, so Person also has those properties. - Tony McCreath

1 Answers

0
votes

I posted another simpler question that clarifies how the resolution works. See answer here.