Blog · Antwort ·
Wie passen SO4AG-Bedingungen zu einer Kundenanfrage?
Gleichen Sie SO4AG-Fakten mit bekannten Kundendaten ab, behandeln Sie fehlende Bedingungen ohne zu raten und prüfen Sie, dass ein Fakt aktuell und angegeben ist.
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 request | Match result |
|---|---|
| Business | The customer condition matches. |
| Individual | The customer condition fails. |
| Customer type missing | The 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.
Häufige Fragen
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.
Nächster Schritt
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.