Specification by Example Ontology
EKGF Editor's Draft
1. Specification by Example Ontology§
1.1 Overview§
Specification by Example Ontology
| Identifier | Value |
|---|---|
| Ontology IRI / Namespace | https://ekgf.org/ontology/specification-by-example# |
| Prefix | ekg-sbe |
A vocabulary for executable story scenarios, including initial graph and dataset states, story requests, expected results, chained scenarios, and captured run-time values.
1.2 Classes§
1.2.1 Concept Value§
This is the value for a test concept
ekg-sbe:ConceptValue | |
https://ekgf.org/ontology/specification-by-example#ConceptValue | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:Class |
rdfs:label | Concept Value |
rdfs:label | Valor do Conceito |
1.2.2 Graph§
A Graph in a Scenario State, every Scenario State (either the Given-state or the Then-state) can have one or more Graphs.
ekg-sbe:Graph | |
https://ekgf.org/ontology/specification-by-example#Graph | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:Class |
rdfs:label | Graph |
1.2.3 Scenario§
An executable example specifying the request, initial state, and expected state or results for a story. Scenarios can be chained through follows.
ekg-sbe:Scenario | |
https://ekgf.org/ontology/specification-by-example#Scenario | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:Class |
rdfs:label | Scenario |
1.2.4 State§
A set of graph and dataset conditions used to describe an initial or expected situation in a scenario.
ekg-sbe:State | |
https://ekgf.org/ontology/specification-by-example#State | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:Class |
rdfs:label | State |
1.2.5 Story Request§
The inputs to the story that is being tested in the given Scenario
ekg-sbe:StoryRequest | |
https://ekgf.org/ontology/specification-by-example#StoryRequest | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:Class |
rdfs:label | Story Request |
1.2.6 capture§
A literal of this datatype in an expected cell names a capture: "id"^^sbe:capture binds the actual value on first sight and requires equality everywhere the same name appears in the scenario. For asserting that two cells, or two rows, carry the same run-time value without pinning what it is.
ekg-sbe:capture | |
https://ekgf.org/ontology/specification-by-example#capture | |
| RDF predicate | Value |
|---|---|
rdf:type | rdfs:Datatype |
rdfs:label | capture |
1.3 Properties§
1.3.1 Concept Value§
Relates a story request in a scenario to a value supplied for one of the concepts involved in that request.
ekg-sbe:conceptValue | |
https://ekgf.org/ontology/specification-by-example#conceptValue | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:StoryRequest |
rdfs:label | Concept Value |
rdfs:range | ekg-sbe:ConceptValue |
1.3.2 Dataset§
Identifies a dataset on which a scenario state depends; it is the inverse of isDependedOnInState.
ekg-sbe:dataset | |
https://ekgf.org/ontology/specification-by-example#dataset | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:State |
rdfs:label | Dataset |
rdfs:range | dcat:Dataset |
owl:inverseOf | ekg-sbe:isDependedOnInState |
1.3.3 follows§
This scenario runs after the named scenario, on the same branch, with the predecessor's captures available: a value "id"^^sbe:capture in this scenario's `when` is substituted with what the predecessor's `then` bound to "id". Scenarios linked by `follows` form a chain — one branch prepared once, steps in dependency order — and a red step leaves the remaining steps unrun. A scenario without `follows` is a chain of one.
ekg-sbe:follows | |
https://ekgf.org/ontology/specification-by-example#follows | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:Scenario |
rdfs:label | follows |
rdfs:range | ekg-sbe:Scenario |
1.3.4 Given§
Relates a scenario to its initial state, before the story request is executed.
ekg-sbe:given | |
https://ekgf.org/ontology/specification-by-example#given | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:Scenario |
rdfs:label | Given |
rdfs:range | ekg-sbe:State |
owl:inverseOf | ekg-sbe:isGivenStateOf |
1.3.5 has Dataset§
a State can have one or more Graphs where each Graph can have one or more Datasets
ekg-sbe:hasDataset | |
https://ekgf.org/ontology/specification-by-example#hasDataset | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:Graph |
rdfs:label | has Dataset |
rdfs:range | dcat:Dataset |
owl:inverseOf | ekg-sbe:isUsedInGraph |
1.3.6 has Graph§
Any Scenario State can have one or more Graphs
ekg-sbe:hasGraph | |
https://ekgf.org/ontology/specification-by-example#hasGraph | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:State |
rdfs:label | has Graph |
rdfs:range | ekg-sbe:Graph |
owl:inverseOf | ekg-sbe:isGraphInState |
1.3.7 Has Scenario§
Relates a story to an example scenario that validates its behavior; it is the inverse of validates.
ekg-sbe:hasScenario | |
https://ekgf.org/ontology/specification-by-example#hasScenario | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-story:Story |
rdfs:label | Has Scenario |
rdfs:range | ekg-sbe:Scenario |
owl:inverseOf | ekg-sbe:validates |
1.3.8 ignore§
Skip this scenario. Kept in the model rather than as a runner flag so a scenario can be parked with its reason alongside it, and so the decision travels with the data.
ekg-sbe:ignore | |
https://ekgf.org/ontology/specification-by-example#ignore | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:DatatypeProperty |
rdfs:domain | ekg-sbe:Scenario |
rdfs:label | ignore |
rdfs:range | xsd:boolean |
1.3.9 is depended on in state§
Usually inferred from the inverse `sbe:dataset`
ekg-sbe:isDependedOnInState | |
https://ekgf.org/ontology/specification-by-example#isDependedOnInState | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | dcat:Dataset |
rdfs:label | is depended on in state |
rdfs:range | ekg-sbe:State |
1.3.10 Is Given State Of§
Usually inferred from inverse `sbe:given`
ekg-sbe:isGivenStateOf | |
https://ekgf.org/ontology/specification-by-example#isGivenStateOf | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:State |
rdfs:label | Is Given State Of |
rdfs:range | ekg-sbe:Scenario |
1.3.11 is Graph in State§
Usually inferred, a Graph can be part of one or more States
ekg-sbe:isGraphInState | |
https://ekgf.org/ontology/specification-by-example#isGraphInState | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:Graph |
rdfs:label | is Graph in State |
rdfs:range | ekg-sbe:State |
1.3.12 Is Used In Graph§
Relates a dataset to a scenario graph that uses it; it is the inverse of hasDataset.
ekg-sbe:isUsedInGraph | |
https://ekgf.org/ontology/specification-by-example#isUsedInGraph | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | dcat:Dataset |
rdfs:label | Is Used In Graph |
rdfs:range | ekg-sbe:Graph |
1.3.13 Named Graph§
Records the IRI naming a graph in a scenario state as an xsd:anyURI literal.
ekg-sbe:namedGraph | |
https://ekgf.org/ontology/specification-by-example#namedGraph | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:DatatypeProperty |
rdfs:domain | ekg-sbe:Graph |
rdfs:label | Named Graph |
rdfs:range | xsd:anyURI |
1.3.14 Story Parameters For Scenario§
Usually inferred from inverse `sbe:when`
ekg-sbe:storyParametersForScenario | |
https://ekgf.org/ontology/specification-by-example#storyParametersForScenario | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:State |
rdfs:label | Story Parameters For Scenario |
rdfs:range | ekg-sbe:Scenario |
owl:inverseOf | ekg-sbe:when |
1.3.15 Then§
Relates a scenario to the state or results expected after its story request is executed.
ekg-sbe:then | |
https://ekgf.org/ontology/specification-by-example#then | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:Scenario |
rdfs:label | Then |
rdfs:range | ekg-sbe:State |
1.3.16 Validates§
Identifies the story whose behavior a scenario validates. The functional-property axiom assigns at most one story to a scenario.
ekg-sbe:validates | |
https://ekgf.org/ontology/specification-by-example#validates | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:FunctionalProperty |
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:Scenario |
rdfs:label | Validates |
rdfs:range | ekg-story:Story |
1.3.17 Value§
Contains the literal value represented by a scenario concept-value resource. No literal datatype restriction is declared.
ekg-sbe:value | |
https://ekgf.org/ontology/specification-by-example#value | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:DatatypeProperty |
rdfs:domain | ekg-sbe:ConceptValue |
rdfs:label | Value |
1.3.18 When§
Relates a scenario to the story request that is executed between the initial and expected states.
ekg-sbe:when | |
https://ekgf.org/ontology/specification-by-example#when | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:ObjectProperty |
rdfs:domain | ekg-sbe:Scenario |
rdfs:label | When |
rdfs:range | ekg-sbe:StoryRequest |
1.4 Named Individuals§
1.4.1 any§
As an expected cell's value: any bound value satisfies it. For results a story derives at run time — an IRI minted with UUID(), a NOW() stamp — where the scenario asserts presence, not identity.
ekg-sbe:any | |
https://ekgf.org/ontology/specification-by-example#any | |
| RDF predicate | Value |
|---|---|
rdf:type | owl:NamedIndividual |
rdfs:label | any |