SOQVER 准备来源
简体中文

博客 · 解答 ·

SO4AG 条件如何与客户的请求相匹配?

将 SO4AG 事实与已知的客户信息相匹配,在条件缺失时不作猜测,并确认事实仍然有效且已作陈述。

To match a customer’s request, compare its known details with the conditions on each SO4AG fact. Every specific condition must match, and any covers every value for that condition. If a missing detail could change which answer applies, ask for it. Present a fact’s value as current only if the business states it and its last day has yet to pass.

Match the details each fact depends on

SO4AG (Source Objects for AGents) is an open format for business facts, currently a working draft at version 0.1. A condition limits a fact to a particular country, customer type, item, branch, or other detail.

Compare every condition on a fact with the corresponding detail in the request. A fact for a specific item at a specific branch requires a match on both. A matching item at a different branch fails the branch condition. If the branch is missing, you still need that detail to determine whether the fact applies. See how facts and conditions are represented in the SO4AG 0.1 specification.

Match a business-only price

A price with customer: business satisfies the customer condition only when the request identifies the customer as a business. Apply that test to the request for which you plan to display the price.

Example: Example Plumbing (plumbing.example) states a price of 120.00 USD for a drain inspection for business customers. The table shows how three requests for the same inspection match the customer condition.

Customer detail in the requestMatch result
企业The customer condition matches.
IndividualThe customer condition fails.
Customer type missingThe match is unresolved.

The price table resolves customer type alone. If Example Plumbing also limits that price to a particular branch, check the branch before displaying the amount. The amount and the conditions belong together when your application presents the result. Read more about this in What a price needs before a program can use it.

Apply any to the condition that names it

The explicit value any means that a fact applies to every value of the specified condition. You can satisfy that condition even if the request leaves the corresponding detail open.

In the same example, suppose Example Plumbing states that it accepts card payments with customer: any. The payment fact covers business and individual customers, so you can use it without first asking for the customer type. If the payment fact also names a specific branch, you still need to match that branch. Apply any to its own condition and evaluate the remaining conditions individually.

Ask for a missing detail that changes the answer

Ask for a missing detail when you need it to decide whether a specific fact applies. If the application already knows the detail from the user’s selection, use that selection.

If someone requests the Example Plumbing inspection price and leaves customer type open, ask whether the booking is for a business or an individual before presenting 120.00 USD as their price. Once the customer answers, run the condition check again. If the customer leaves the question unanswered, keep the price match unresolved. You can still present the card payment fact if it applies to the request and is current.

Check the last day and whether the fact is stated

A matching fact is current through its last day. After that day, treat it as history. Before presenting a current value, also check whether the business states the fact.

If the Example Plumbing price lists June 30, 2027 as its last day, you can use that record as current on June 30 for a matching business request. On July 1, the same record is history. See what happens when a SO4AG fact reaches its last day.

When an applicable fact is marked not stated, show that status if it helps the user understand the answer. For a price, say that the business does not state a price for the matching conditions. Keep the status as not stated in your application data so it stays distinct from zero, an empty value, and no limit.

常见问题

Can I use a fact when the request has extra details?

Yes, if the request satisfies every condition on the fact. A request can include the customer’s country even when the fact only specifies customer type.

What if one condition fails and another detail is missing?

A single failed condition rules out the fact for that request. Ask for the missing detail only if it could help you match another relevant fact.

Where do I find the website wording behind a fact?

Each SO4AG fact carries the address of its source page. It may also include the exact wording from that page.

下一步

Use the SOQVER developer guide to start reading published facts. Test your matcher with a business request, an individual request, and a request with no customer type. Then repeat the test with customer: any, a last day that has passed, and a fact marked not stated.

更多文章

回答 ·

如何在发布前于 CI 中验证 SO4AG 文件

安装已固定版本的 SO4AG 验证器,将本地验证设为 CI 的必要步骤,并在部署后检查公开的 so4ag.json URL。

回答 ·

何时需要 FAQ 页面和 SO4AG 文件?

使用 FAQ 说明客户反复提出的问题,使用 SO4AG 文件发布带有条件、日期和来源的具体业务事实。

回答 ·

如何修正两页所述数字不一致

请对照两页上的优惠、受众、地点和日期,再以企业确认的数字更新页面及已发布的事实。

免费网站审核 全部文章