EKGF Ontologies / Specification by Example Ontology

EKGF Editor's Draft

Specification by Example Ontology

EKGF Editor's Draft

1. Specification by Example Ontology§

1.1 Overview§

Specification by Example Ontology

IdentifierValue
Ontology IRI / Namespacehttps://ekgf.org/ontology/specification-by-example#
Prefixekg-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 predicateValue
rdf:typeowl:Class
rdfs:labelConcept Value
rdfs:labelValor do Conceito
UML class diagram for Concept Value. Diagram labels: «owl:Class»; Concept Value; Value; «owl:Class»; Story Request; Concept Value; Concept Value rdfs:domain Story Request. Concept Value rdfs:range Concept Value. Value rdfs:domain Concept Value.«owl:Class»Concept ValueValue«owl:Class»Story RequestConcept Value
Class neighborhood: Concept Value [1]

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 predicateValue
rdf:typeowl:Class
rdfs:labelGraph
UML class diagram for Graph. Diagram labels: «owl:Class»; dcat:; Dataset; «owl:Class»; Graph; Named Graph : xsd:anyURI; «owl:Class»; State; has Dataset; has Graph; is Graph in State; Is Used In Graph; has Dataset rdfs:domain Graph. has Dataset rdfs:range dcat:Dataset. has Graph rdfs:domain State. has Graph rdfs:range Graph. is Graph in State rdfs:domain Graph. is Graph in State rdfs:range State. Is Used In Graph rdfs:domain dcat:Dataset. Is Used In Graph rdfs:range Graph. Named Graph rdfs:domain Graph. Named Graph rdfs:range xsd:anyURI.«owl:Class»dcat:Dataset«owl:Class»GraphNamed Graph : xsd:anyURI«owl:Class»Statehas Datasethas Graphis Graph in StateIs Used In Graph
Class neighborhood: Graph [1]

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 predicateValue
rdf:typeowl:Class
rdfs:labelScenario
UML class diagram for Scenario. Diagram labels: «owl:Class»; Scenario; ignore : xsd:boolean; «owl:Class»; State; «owl:Class»; Story (ekg-story:Story); follows; Given; Has Scenario; Is Given State Of; follows rdfs:domain Scenario. follows rdfs:range Scenario. Given rdfs:domain Scenario. Given rdfs:range State. Has Scenario rdfs:domain Story (ekg-story:Story). Has Scenario rdfs:range Scenario. ignore rdfs:domain Scenario. ignore rdfs:range xsd:boolean. Is Given State Of rdfs:domain State. Is Given State Of rdfs:range Scenario.«owl:Class»Scenarioignore : xsd:boolean«owl:Class»State«owl:Class»Story (ekg-story:Story)followsGivenHas ScenarioIs Given State Of
Class neighborhood: Scenario [1]

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 predicateValue
rdf:typeowl:Class
rdfs:labelState
UML class diagram for State. Diagram labels: «owl:Class»; dcat:; Dataset; «owl:Class»; Graph; «owl:Class»; Scenario; «owl:Class»; State; Dataset; Given; has Graph; is depended on in state; Is Given State Of; Dataset rdfs:domain State. Dataset rdfs:range dcat:Dataset. Given rdfs:domain Scenario. Given rdfs:range State. has Graph rdfs:domain State. has Graph rdfs:range Graph. is depended on in state rdfs:domain dcat:Dataset. is depended on in state rdfs:range State. Is Given State Of rdfs:domain State. Is Given State Of rdfs:range Scenario.«owl:Class»dcat:Dataset«owl:Class»Graph«owl:Class»Scenario«owl:Class»StateDatasetGivenhas Graphis depended on in stateIs Given State Of
Class neighborhood: State [1]

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 predicateValue
rdf:typeowl:Class
rdfs:labelStory Request
UML class diagram for Story Request. Diagram labels: «owl:Class»; Concept Value; «owl:Class»; Scenario; «owl:Class»; Story Request; Concept Value; When; Concept Value rdfs:domain Story Request. Concept Value rdfs:range Concept Value. When rdfs:domain Scenario. When rdfs:range Story Request.«owl:Class»Concept Value«owl:Class»Scenario«owl:Class»Story RequestConcept ValueWhen
Class neighborhood: Story Request [1]

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 predicateValue
rdf:typerdfs:Datatype
rdfs:labelcapture

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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:StoryRequest
rdfs:labelConcept Value
rdfs:rangeekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:State
rdfs:labelDataset
rdfs:rangedcat:Dataset
owl:inverseOfekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:Scenario
rdfs:labelfollows
rdfs:rangeekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:Scenario
rdfs:labelGiven
rdfs:rangeekg-sbe:State
owl:inverseOfekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:Graph
rdfs:labelhas Dataset
rdfs:rangedcat:Dataset
owl:inverseOfekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:State
rdfs:labelhas Graph
rdfs:rangeekg-sbe:Graph
owl:inverseOfekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-story:Story
rdfs:labelHas Scenario
rdfs:rangeekg-sbe:Scenario
owl:inverseOfekg-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 predicateValue
rdf:typeowl:DatatypeProperty
rdfs:domainekg-sbe:Scenario
rdfs:labelignore
rdfs:rangexsd: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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domaindcat:Dataset
rdfs:labelis depended on in state
rdfs:rangeekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:State
rdfs:labelIs Given State Of
rdfs:rangeekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:Graph
rdfs:labelis Graph in State
rdfs:rangeekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domaindcat:Dataset
rdfs:labelIs Used In Graph
rdfs:rangeekg-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 predicateValue
rdf:typeowl:DatatypeProperty
rdfs:domainekg-sbe:Graph
rdfs:labelNamed Graph
rdfs:rangexsd: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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:State
rdfs:labelStory Parameters For Scenario
rdfs:rangeekg-sbe:Scenario
owl:inverseOfekg-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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:Scenario
rdfs:labelThen
rdfs:rangeekg-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 predicateValue
rdf:typeowl:FunctionalProperty
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:Scenario
rdfs:labelValidates
rdfs:rangeekg-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 predicateValue
rdf:typeowl:DatatypeProperty
rdfs:domainekg-sbe:ConceptValue
rdfs:labelValue

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 predicateValue
rdf:typeowl:ObjectProperty
rdfs:domainekg-sbe:Scenario
rdfs:labelWhen
rdfs:rangeekg-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 predicateValue
rdf:typeowl:NamedIndividual
rdfs:labelany

Document provenance

Search this specification