- Status changed to Needs review
over 1 year ago 6:10am 12 October 2023 - πΊπΈUnited States jrockowitz Brooklyn, NY
It is very tricky to determine what should and should not be included in a page's JSON-LD. Ideally, only the content displayed should be included.
Currently, if a referenced Schema.org type is mapped to an entity with a public URL (i.e., node), the JSON-LD links to that entity. If a referenced Schema.org type is mapped to an entity without a public URL (i.e., paragraph), the JSON-LD includes all properties about that entity.
One approach would be to add a flag/option to a mapping to determine whether the Schema.org type should be linked via @url or all the Schema.org properties should be included.
BTW, there are a lot of hooks via schemadotorg_jsonld.api.php where you alter the JSON-LD to include and exclude Schema.org types and properties.
- πΊπΈUnited States jrockowitz Brooklyn, NY
Only a node will NOT include the reference entities Schema.org data. The decision/code for returning only an entity reference's node's URL is in \Drupal\schemadotorg_jsonld\SchemaDotOrgJsonLdBuilder::getSchemaPropertyFieldItem.
My only thought or resolution would be to provide a configuration setting for determining which Schema.org types get referenced via URL or include the reference's data. For example, a common sense default would always include https://schema.org/Intangible entity references.
On a related note, SchemaDotOrgJsonLdBuilder::getSchemaPropertyFieldItem is NOT entirely checking view access to the referenced node.
- πΊπΈUnited States jrockowitz Brooklyn, NY
I see three ways/types to include an entity reference view JSON-LD, URL, label, and entity.
Below is an example of what the YAML via
schemadotorg_jsonld.settings.yml
for 'schema_type_entity_references' could look likeIntangible: entity node--Thing: url taxonomy_term: label
- @jrockowitz opened merge request.
-
jrockowitz β
committed 512751e4 on 1.0.x
Issue #3381444: Decide which types get their own node and which ones get...
-
jrockowitz β
committed 512751e4 on 1.0.x
- Status changed to Fixed
about 1 year ago 3:25pm 24 October 2023 Automatically closed - issue fixed for 2 weeks with no activity.