Data Mapping

By default, we perform steps to help map Schema-related data into their conventional types. Given the wide range of data sources and generation methods, these mappings help establish a minimal baseline to make other, application-specific assumptions. The following steps are performed on a best-effort basis, and any unrecognized syntax, types, and values will remain unchanged.

Canonicalize IRIs

The Schema.org ontology is often used with one of several base IRIs. Within our tools, we use the original, insecure apex recommendation, by default, but your data may use whichever format meets your requirements. Predicates, object IRIs, and literal datatypes, which use the following, will be converted to http://schema.org/.

Alternate Base IRI
https://schema.org/
http://www.schema.org/
https://www.schema.org/

Extension domains, such as pending.schema.org, are currently ignored.

Resolve URLs

Properties which accept a URL datatype, such as contentUrl, will be resolved against a base URL, if known. The following table shows some examples of how objects will be evaluated.

InputBehaviorNote
"/path"<http://example.com/path>String primitive
"/path"^^schema:Text"/path"^^schema:TextExplicit datatype, no change
"http://example.com/path"<http://example.com/path>String, absolute
"/path"^^ex:Type"/path"^^ex:TypeUnrelated datatype, no change

For URLs in properties that support both Text and URL datatypes, heuristics are used to determine the intended datatypes. For best results, use encoded IRIs, or use literals with an absolute or root-relative form.

Drop Empty Literals

By convention, empty literal statements will be dropped from the graph if:

  1. The datatype is Schema-related or an XSD primitive; and
  2. The lexical form is empty after collapsing any white space.

The following table shows some examples of how objects will be evaluated.

InputBehaviorNote
""Dropped
" \t "DroppedOnly white space
""^^schema:TextDropped
""^^ex:TypeNo changeUnrelated datatype
"0"No changeNot empty
<>No changeIRI, non-literal
ex:No changePrefixed name IRI, non-literal

This has the notable effect that a Schema-related resource cannot have an empty-valued property. However, this helps handle the common practice of publishers including empty property values simply because it's the easier method to generate templated, structured data.

Map Enumerations

All properties which support an object enumeration will be evaluated to prefer its canonical IRI form. The following table shows examples of evaluating the object of the availability property.

InputOutputNote
"InStock"schema:InStock
" InStock"schema:InStockString (collapse) to IRI
"https://schema.org/InStock"schema:InStockString to IRI
"http://www.schema.org/InStock"schema:InStockString with Alternate Base IRI to IRI
"ExampleUnknown""ExampleUnknown"Unknown enumeration path, no change
"http://example.com/InStock""http://example.com/InStock"Unknown enumeration, no change
schema:InStockschema:InStockIRI, no change
schema:Falseschema:FalseIRI, no change
schema:ExampleUnknownschema:ExampleUnknownIRI, no change

Cast Data Types

All objects of Schema properties will be evaluated against their expected data types and updated to their Schema-specific data type. Refer to the Data Types section for each type's supported syntax and behaviors.