You may have arrived here from an RDF or JSON-LD document.
http://sarif.info/Result is the term URI that
schema.org uses for the SARIF result
object: schema.org's JSON-LD context declares the prefix
sarif: http://sarif.info/, and its Error class is defined as
rdfs:subClassOf sarif:Result. A machine-readable description of this term is
available at /Result.jsonld, and is served from this URL
directly under content negotiation for application/ld+json.
A result is a single finding produced by an analysis tool: one problem,
at one place, attributable to one rule. It is the payload of the whole format. A
run carries an array of them, and everything else in a SARIF file — the
tool description, the rule metadata, the artifact inventory — exists to give results
somewhere to point.
The normative definition is §3.27 of the OASIS specification.
The minimum
Exactly one property is required: message. A result with nothing but a
message is valid SARIF.
{ "message": { "text": "Something is wrong here." } }
That is rarely useful, so in practice a result carries at least a rule identifier, a severity and a location:
{
"ruleId": "CA2100",
"ruleIndex": 3,
"kind": "fail",
"level": "error",
"message": {
"text": "The query string is built by concatenating user input."
},
"locations": [
{
"physicalLocation": {
"artifactLocation": { "uri": "src/db/Query.cs" },
"region": { "startLine": 118, "startColumn": 21, "endColumn": 64 }
}
}
],
"partialFingerprints": {
"primaryLocationLineHash": "39fa2ee980eb94b0:1"
},
"baselineState": "new"
}
kind and level
These two properties are often confused. kind says what happened when
the rule was evaluated; level says how bad it is.
kind — evaluation state (§3.27.9)
notApplicablepassfailreviewopeninformational
"fail" means the rule was evaluated and a problem was found;
"pass" means it was evaluated and none was. "open" is for
proof-based tools that could neither prove nor disprove a violation,
"notApplicable" means the rule did not apply to the target at all, and
"review" asks a human to decide. If kind is absent it defaults to
"fail".
level — severity (§3.27.10)
nonenotewarningerror
Severity only has meaning for a failure. The specification requires that when
kind is anything other than "fail", level is either
absent or "none" — a passing result cannot be an error.
Identity across runs
Three properties answer “is this the same finding I saw yesterday?”, and they
are not interchangeable. guid identifies this result in
this run. correlationGuid identifies the equivalence class of
logically identical results across runs. fingerprints and
partialFingerprints let the tool contribute strings that survive the code
moving around — a partial fingerprint is expected to change when the surrounding code
changes, a full fingerprint is not. baselineState
(new, unchanged, updated, absent)
then records how the result compares to a baseline run.
All properties
Every property the specification defines on a result object, in the order a
reader tends to need them. Types are the schema's own; section numbers refer to the
OASIS text.
| Property | Type | Description |
|---|---|---|
| messagerequired | message | A message that describes the result. §3.27.11 |
| ruleId | string | The stable, unique identifier of the rule, if any, to which this result is relevant. §3.27.5 |
| ruleIndex | integer | The index within the tool component rules array of the rule object associated with this result. §3.27.6 |
| rule | reportingDescriptorReference | A reference used to locate the rule descriptor relevant to this result. §3.27.7 |
| kind | string | A value that categorizes results by evaluation state. §3.27.9 |
| level | string | A value specifying the severity level of the result. §3.27.10 |
| locations | location[] | The set of locations where the result was detected. §3.27.12 |
| analysisTarget | artifactLocation | Identifies the artifact that the analysis tool was instructed to scan. §3.27.13 |
| guid | string | A stable, unique identifier for the result in the form of a GUID. §3.27.3 |
| correlationGuid | string | A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID. §3.27.4 |
| fingerprints | object | A set of strings each of which individually defines a stable, unique identity for the result. §3.27.16 |
| partialFingerprints | object | A set of strings that contribute to the stable, unique identity of the result. §3.27.17 |
| relatedLocations | location[] | A set of locations relevant to this result. §3.27.22 |
| codeFlows | codeFlow[] | An array of 'codeFlow' objects relevant to the result. §3.27.18 |
| graphs | graph[] | An array of zero or more unique graph objects associated with the result. §3.27.19 |
| graphTraversals | graphTraversal[] | An array of one or more unique 'graphTraversal' objects. §3.27.20 |
| stacks | stack[] | An array of 'stack' objects relevant to the result. §3.27.21 |
| webRequest | webRequest | A web request associated with this result. §3.27.14 |
| webResponse | webResponse | A web response associated with this result. §3.27.15 |
| taxa | reportingDescriptorReference[] | An array of references to taxonomy reporting descriptors that are applicable to the result. §3.27.8 |
| suppressions | suppression[] | A set of suppressions relevant to this result. §3.27.23 |
| baselineState | string | The state of a result relative to a baseline of a previous run. §3.27.24 |
| rank | number | A number representing the priority or importance of the result. §3.27.25 |
| occurrenceCount | integer | A positive integer specifying the number of times this logically unique result was observed in this run. §3.27.31 |
| provenance | resultProvenance | Information about how and when the result was detected. §3.27.29 |
| fixes | fix[] | An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result. §3.27.30 |
| attachments | attachment[] | A set of artifacts relevant to the result. §3.27.26 |
| workItemUris | string[] | The URIs of the work items associated with this result. §3.27.27 |
| hostedViewerUri | string | An absolute URI at which the result can be viewed. §3.27.28 |
| properties | propertyBag | Key/value pairs that provide additional information about the result. §3.8 |
The schema.org relationship
schema.org's Error type is declared as a subclass of this term. In the
published schema.org vocabulary:
{
"@id": "schema:Error",
"@type": "rdfs:Class",
"rdfs:label": "Error",
"rdfs:comment": "Representation of an Error.",
"rdfs:subClassOf": [
{ "@id": "sarif:Result" },
{ "@id": "schema:InstantaneousEvent" }
]
}
with "sarif": "http://sarif.info/" declared in the vocabulary's context.
That is why RDF prefix resolvers, ontology registries and generated API documentation link
to this URL. The description served here is maintained independently and is
not a normative OASIS artifact; it exists so that the term dereferences to
something meaningful rather than to a parked domain.