错误:页面包含属性“查询输入"这不是架构的一部分 [英] Error: Page contains property "query-input" which is not part of the schema

查看:53
本文介绍了错误:页面包含属性“查询输入"这不是架构的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 Google RichSnippets 测试工具收到此错误:

<块引用>

错误:页面包含不属于架构的属性查询输入".

但是我哪里做错了?

HTML:

<input id="ajaxSearch" type="text" value="" name="search_term" itemprop="query-input">按 Enter 搜索

JSON-LD:

文档:改进的搜索搜索结果中的框

解决方案

关于 Actions 的文档中有说明:

<块引用>

通常需要用户或客户提供其他信息才能制定完整的请求.为了促进这个过程,我们需要能够在一个潜在的动作中描述如何构建这些输入.由于我们需要此功能来填充 Action 的任何属性,因此我们使用连字符(-")分隔符引入了属性注释的概念.例如,通过在潜在操作上指定位置输入"属性,我们表明位置"是完成操作所支持的输入.

但由于此属性不存在(即,它未在 SearchAction 上的属性表中定义)),验证器将其报告为错误.

此问题已在 Schema.org 的 GitHub 上讨论过:SearchAction 示例使用查询输入"属性未定义

所以你没有做错什么.除非 Schema.org 决定以不同的方式处理 Actions,否则验证器应该更新并允许 -input-output 后缀.

I get this error from the Google RichSnippets testing tool:

Error: Page contains property "query-input" which is not part of the schema.

But where did I make a mistake?

HTML:

<div id="dkAjaxSearch">
<input id="ajaxSearch" type="text" value="" name="search_term" itemprop="query-input">
Press Enter to search
</div>

JSON-LD:

<script type="application/ld+json">
{
   "@context": "http://schema.org",
   "@type": "WebSite",
   "url": "https://domain.com/",
   "potentialAction": {
     "@type": "SearchAction",
     "target": "http://domain.com/search/{search_term_string}",
     "query-input": "required name=search_term_string"
   }
}
</script>

Documentation: An improved search box within the search results

解决方案

It’s explained in the documentation about Actions:

Additional information is often required from a user or client in order to formulate a complete request. To facilitate this process we need the ability to describe within a potential action how to construct these inputs. Since we need this capability for filling in any property of an Action, we introduce a notion of property annotations using a hypen ("-") delimiter. For example, by specifying a "location-input" property on a potential action we are indicating that "location" is a supported input for completing the action.

But as this property does not exist (i.e., it’s not defined in the property table on SearchAction), validators report it as an error.

This issue already gets discussed on Schema.org’s GitHub: SearchAction example uses "query-input" property that is not defined

So you did not do something wrong. Unless Schema.org decides that Actions should be handled in a different way, validators should probably update and allow -input and -output suffixes.

这篇关于错误:页面包含属性“查询输入"这不是架构的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆