首页 > 解决方案 > Google Schema.org 数学求解器为多个字段提供结构化数据

问题描述

尝试为具有两个字段的简单数学求解器操作设置模式标记。比方说加法。

1+1=2

这是谷歌的文档和示例:

{
  "@context": "https://schema.org",
  "@type": ["MathSolver", "LearningResource"],
  "name": "An awesome math solver",
  "url": "https://www.mathdomain.com/",
  "usageInfo": "https://www.mathdomain.com/privacy",
  "inLanguage": "en",
  "potentialAction": [{
    "@type": "SolveMathAction",
    "target": "https://mathdomain.com/solve?q={math_expression_string}",
    "mathExpression-input": "required name=math_expression_string",
    "eduQuestionType": ["Polynomial Equation","Derivative"]
   }],
  "learningResourceType": "Math solver"
}

我们如何为两个数字添加多个变量?

return {
    '@context': 'https://schema.org',
    '@type': ['MathSolver', 'LearningResource'],
    ...
    potentialAction: [
        {
            '@type': 'SolveMathAction',
            target: `domain.com/?num1={num1}&num2={num2}`,
            'mathExpression-input': 'required name=num1 name=num2',
            eduQuestionType: ['addition', 'sum']
        },
    ],
    learningResourceType: 'Math solver'
};

Schema.orgmathExpression(注意:mathExpression-input似乎不存在)但确实属于Thing > Intangible EntryPoint

一个数学表达式(例如'x^2-3x=0'),可以针对> 特定变量求解、简化或转换。这可以采用许多 > 格式,例如 LaTeX、Ascii-Math 或数学,就像您使用 > 键盘编写的一样。

但是,这可以设置为 URL 参数以接受多个字段mathExpression-input而不是单个数学表达式吗?

标签: mathschema.orgjson-ldgoogle-schemas

解决方案


推荐阅读