JSON-LD @type property

CoreModels applies this translation to any import type and handles the '@type' property accordingly. '@type' is a special property that determines how a JSON-LD object is imported as either a type, element, or a taxonomy in CoreModels.

This is based on how the schema.org importer is originally designed according to the rdfs definitionarrow-up-right.

If "@type" is set to "rdfs:Class", then it's a type. Here is the code from our sample filearrow-up-right.

{ 
  "@id": "sampleType1",
  "@type": "rdfs:class",
  "rdfs:comment": "This is a sample json-ld object that will be considered 
     a type due to having the rdfs:class value in the @type property",
  "rdfs:label": "Sample Type 1",
  "isrequired": "sms:true"
}

Once CoreModels proceeds the import, the type will be created with its label Sample Type1.

Types Grid - Sample Type 1

If "@type" is set to "rdf:property", then it's an element.

'sampleElement1' is has a 'domainIncludes' relation to 'sampleType1', therefor it'll appear in the Elements grid of 'Sample Type 1'.

Types Grid - Sample Type 1 with Sample Element 1

If "@type" is set to "rdfs:Class" AND "rdfs:subClassOf" has "schema:enumeration", then it's a taxonomy.

Taxonomies Grid - Sample Taxonomy Parent

If "@type" is set to any previous taxonomy, then it's a child of that taxonomy.

CoreModels will automatically establish a relationship between the child taxonomy and 'Sample Taxonomy Parent', thereby creating parent-child relation. Here's how the child taxonomy will look like.

Taxonomies Grid - Parent Child relation

Last updated