Competency Question Ontology version 0.1.0
The versioned semantic artifact targeted by the checked-in self-application corpus.
An ontology maintainer evaluates whether the Competency Question Ontology still describes and tests its own competency-question contract after a change.
A tool discovers a competency question, explains why it exists, executes its formalization over a fixture, and reports the result without treating query or SHACL text as ontology axioms.
A reviewer distinguishes accepted, in-review, and deprecated questions and traces each accepted question to requirements, stakeholders, and coverage claims.
A natural-language phrase that denotes a resource or resource kind.
A natural-language phrase that denotes a relation or supporting evidence.
Which [resources] are connected by [relation or evidence]?
Which
are connected by
How is [resource] represented or evaluated without [prohibited shortcut]?
How is
represented or evaluated without
Does [artifact] satisfy [testable condition]?
Does [artifact] describe [artifact] consistently?
Does
satisfy
describe
consistently?
the template realization contract
exact ordered reconstruction
the Competency Question Ontology
Competency questions must have stable resource identity independent of their formulations.
Each accepted question must trace to a requirement, use case, and stakeholder.
A question must identify its target semantic artifact and, when evaluated against a release, its target version.
Questions must distinguish expected answers and answer constraints from observed execution results.
Executable formalizations must identify query language, query text, fixture, concrete execution, result, and status.
Question lifecycle and review state must be independently representable.
Question kinds and reusable natural-language templates must remain distinct from executable formal queries.
A template must expose ordered fixed-text and slot occurrences without requiring consumers to parse its human-readable rendering.
A qualified template instantiation must connect one question, template, and formulation, bind each resource-identified parameter once, and expose deterministic ordered rendering fragments.
The ontology's own question corpus must executable-test the recursive contract and public-term coverage.
Self-description must disclose the minimal seed representation and must not be presented as circular logical justification.
Machine-checkable answer constraints must be compared with observed execution results through qualified expectation assessments.
A passing execution must identify the target semantic-artifact version it actually used so stale evidence can be detected.
The self-application contract must demonstrate multiple executable formalizations for one competency question and detect disagreement on a shared semantic fixture.
Which first-class competency questions define the Competency Question Ontology, and what natural-language formulations express them?
Which ontology requirement, use case, and stakeholder motivate each self-defining competency question?
Which ontology module and version does each self-defining competency question target?
Which expected answer or answer constraint is connected to each self-defining competency question?
Which formal query, fixture, execution, result, and status provide executable evidence for the self-application corpus?
What lifecycle and review states apply to each self-defining competency question?
Which CQ kinds classify the self-defining questions, and which reusable natural-language templates remain independent of their formal queries?
Which ordered fixed-text and slot occurrences constitute each self-application template, including repeated uses of one logical parameter?
Does the template realization contract satisfy exact ordered reconstruction?
Which declared public classes and properties lack qualified coverage, and which seeded mutations escape detection by the recursive acceptance contract?
Does the Competency Question Ontology describe the Competency Question Ontology consistently?
Which resources constitute the minimal seed representation that exists before the ontology describes and executes tests over its own competency questions?
Which machine-checkable answer constraints are satisfied by observed execution results, and how is an executed empty result distinguished from an unknown or not-run result?
Which passing executions used a target ontology version different from the version currently targeted by their evaluated competency questions?
Where one competency question has multiple formal queries, do their executions agree with the declared expected outcome over the shared semantic fixture?
Fourteen stable competency-question resources are members of the self-application corpus, each with an independent formulation resource.
Every self-defining question links to at least one requirement, use case, and stakeholder agent.
Every self-defining question targets the module IRI and its 0.1.0 version IRI, which identifies the module with dcterms:isVersionOf.
Every self-defining question has a reviewable ExpectedAnswer resource distinct from its execution result.
The SPARQL 1.1 acceptance query executes over this fixture plus the ontology and returns zero regression rows.
Every self-defining question is accepted, approved, and independently marked for design and regression use.
Two scope-setting questions have the QuO/ROCQS scoping kind and twelve answerable self-checks have the validation kind. No resource-link lookup is mislabeled as a relationship kind, and bootstrap is not mislabeled as foundational. Four CLaRO-informed templates remain independent resources.
Four templates expose twenty ordered element occurrences and seven resource-identified parameters. Two occurrences in the repeated-slot template use the same artifact parameter.
Two qualified instantiations each return five ordered fragments that reconstruct their linked formulation exactly; the repeated template uses one binding at two slot positions.
Every public class and property has a CoveredStatus assertion, and removing required recursive links or coverage makes the acceptance query return a regression.
The seed is RDF/Turtle plus stable vocabulary IRIs, explicit instances, and executable query text. The ontology describes that seed after it exists; it does not derive or logically justify its own vocabulary.
Every passing self-application execution records the 0.1.0 target version with prov:used; changing a question target without a matching execution produces a stale-evidence regression.
The row-producing and boolean SPARQL formalizations both pass the complete fixture, and both expose the seeded public-term coverage mutation.
Competency Question Ontology self-application corpus
PREFIX : <https://ontology.inferal.com/modules/competency-question/> SELECT ?template ?element ?index ?elementKind ?value ?parameter ?parameterRole WHERE { ?template a :QuestionTemplate ; :hasTemplateElement ?element . ?element :elementIndex ?index . { ?element a :TemplateTextSegment ; :segmentText ?value . BIND(:TemplateTextSegment AS ?elementKind) } UNION { ?element a :TemplateSlot ; :usesParameter ?parameter . ?parameter :parameterName ?value . BIND(:TemplateSlot AS ?elementKind) OPTIONAL { ?parameter :parameterRole ?parameterRole . } } } ORDER BY ?template ?index
Ordered template-element extraction query
PREFIX : <https://ontology.inferal.com/modules/competency-question/> SELECT ?instantiation ?formulation ?index ?elementKind ?fragment ?parameter ?boundResource ?boundLiteral WHERE { ?instantiation a :TemplateInstantiation ; :usesTemplate ?template ; :realizesFormulation ?formulation . ?template :hasTemplateElement ?element . ?element :elementIndex ?index . { ?element a :TemplateTextSegment ; :segmentText ?fragment . BIND(:TemplateTextSegment AS ?elementKind) } UNION { ?element a :TemplateSlot ; :usesParameter ?parameter . ?instantiation :hasTemplateBinding ?binding . ?binding :bindsParameter ?parameter ; :bindingText ?fragment . OPTIONAL { ?binding :boundResource ?boundResource . } OPTIONAL { ?binding :boundLiteral ?boundLiteral . } BIND(:TemplateSlot AS ?elementKind) } } ORDER BY ?instantiation ?index
PREFIX : <https://ontology.inferal.com/modules/competency-question/> PREFIX ex: <https://example.com/inferal/cqo-self-application/> PREFIX dcat: <http://www.w3.org/ns/dcat#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX mod: <https://w3id.org/mod#> PREFIX prov: <http://www.w3.org/ns/prov#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT DISTINCT ?check ?subject ?detail WHERE { { ?subject a :CompetencyQuestion . VALUES (?predicate ?check) { (:hasFormulation "missing formulation") (:addressesRequirement "missing requirement") (:supportsUseCase "missing use case") (:hasStakeholder "missing stakeholder") (:questionKind "missing question kind") (:questionPurpose "missing question purpose") (:targetsArtifact "missing target artifact") (:targetsVersion "missing target version") (:hasAnswerExpectation "missing answer expectation") (:hasFormalQuery "missing formal query") (:lifecycleState "missing lifecycle state") (:reviewState "missing review state") } FILTER NOT EXISTS { ?subject ?predicate ?value . } BIND(STR(?predicate) AS ?detail) } UNION { VALUES (?subject ?expectedKind) { (ex:cq-first-class :ScopingQuestion) (ex:cq-traceability :ValidationQuestion) (ex:cq-target :ValidationQuestion) (ex:cq-expectation :ValidationQuestion) (ex:cq-execution :ValidationQuestion) (ex:cq-governance :ValidationQuestion) (ex:cq-patterns :ValidationQuestion) (ex:cq-template-elements :ValidationQuestion) (ex:cq-template-instantiation :ValidationQuestion) (ex:cq-recursion :ValidationQuestion) (ex:cq-bootstrap :ScopingQuestion) (ex:cq-satisfaction :ValidationQuestion) (ex:cq-current-evidence :ValidationQuestion) (ex:cq-coformalization :ValidationQuestion) } FILTER NOT EXISTS { ?subject :questionKind ?expectedKind . } BIND("unexpected self-application question kind" AS ?check) BIND(STR(?expectedKind) AS ?detail) } UNION { ?subject a :CompetencyQuestion ; :targetsArtifact ?artifact ; :targetsVersion ?version . FILTER NOT EXISTS { ?version dcterms:isVersionOf ?artifact . } BIND("version does not identify target artifact" AS ?check) BIND(STR(?version) AS ?detail) } UNION { ?subject a :CompetencyQuestion ; :hasFormalQuery ?query . FILTER NOT EXISTS { ?query a :FormalQuery ; :queryText ?queryText ; :queryLanguage ?queryLanguage ; :usesFixture ?fixture ; dcat:downloadURL ?queryLocation . ?fixture a :TestFixture ; dcat:downloadURL ?fixtureLocation . } BIND("incomplete formal query artifact" AS ?check) BIND(STR(?query) AS ?detail) } UNION { ?subject a :CompetencyQuestion ; :hasFormalQuery ?query . FILTER NOT EXISTS { ?execution a :QueryExecution ; :executionOf ?query ; :evaluatesQuestion ?subject ; :usesFixture ?fixture ; :hasExecutionResult ?result . ?query :usesFixture ?fixture . ?result a :ExecutionResult ; :executionStatus :PassedStatus ; prov:wasGeneratedBy ?execution . } BIND("missing passed execution evidence" AS ?check) BIND(STR(?query) AS ?detail) } UNION { ?execution a :QueryExecution ; :evaluatesQuestion ?subject ; :hasExecutionResult ?result . ?subject :targetsVersion ?version . ?result :executionStatus :PassedStatus . FILTER NOT EXISTS { ?execution prov:used ?version . } BIND("passed execution did not use current target version" AS ?check) BIND(STR(?version) AS ?detail) } UNION { ?subject a :ExecutionResult ; :executionStatus ?status . VALUES ?status { :PassedStatus :FailedStatus } FILTER NOT EXISTS { ?subject (:resultCardinality|:resultBoolean) ?observation . } BIND("completed result lacks machine observation" AS ?check) BIND(STR(?status) AS ?detail) } UNION { ?subject a :ExecutionResult ; :executionStatus ?status ; (:resultCardinality|:resultBoolean) ?observation . VALUES ?status { :NotRunStatus :ErrorStatus } BIND("non-completed result claims machine observation" AS ?check) BIND(STR(?observation) AS ?detail) } UNION { ?execution a :QueryExecution ; :evaluatesQuestion ?subject ; :hasExecutionResult ?result . ?subject :hasAnswerExpectation ?expectation . ?expectation a :AnswerConstraint . FILTER NOT EXISTS { ?assessment a :ExpectationAssessment ; :assessesResult ?result ; :assessesExpectation ?expectation ; :expectationSatisfied true . } BIND("machine-checkable expectation lacks satisfied assessment" AS ?check) BIND(STR(?expectation) AS ?detail) } UNION { ?subject a :ExpectationAssessment ; :assessesResult ?result ; :assessesExpectation ?expectation ; :expectationSatisfied ?stated . ?result :resultCardinality ?observed . ?expectation :constraintLanguage :ResultCardinalityConstraintLanguage ; :constraintExpression ?expression . BIND(xsd:integer(?expression) AS ?expected) BIND(?observed = ?expected AS ?computed) FILTER(?stated != ?computed) BIND("expectation assessment disagrees with result cardinality" AS ?check) BIND(CONCAT(STR(?observed), " observed; ", STR(?expected), " expected") AS ?detail) } UNION { ?subject a :QuestionTemplate . FILTER NOT EXISTS { ?subject :templateText ?templateText ; :hasTemplateElement ?element . } BIND("template lacks extractable element structure" AS ?check) BIND(STR(?subject) AS ?detail) } UNION { ?subject a ?templateElementKind . VALUES ?templateElementKind { :TemplateElement :TemplateTextSegment :TemplateSlot } FILTER NOT EXISTS { ?template :hasTemplateElement ?subject . ?subject :elementIndex ?index . { ?subject a :TemplateTextSegment ; :segmentText ?value . } UNION { ?subject a :TemplateSlot ; :usesParameter ?value . } } BIND("incomplete template element" AS ?check) BIND(STR(?subject) AS ?detail) } UNION { ?subject a :QuestionTemplate . { ?subject :hasTemplateElement ?left, ?right . ?left :elementIndex ?index . ?right :elementIndex ?index . FILTER(?left != ?right) BIND(CONCAT("duplicate index ", STR(?index)) AS ?detail) } UNION { ?subject :hasTemplateElement ?element . ?element :elementIndex ?index . FILTER(?index > 0) FILTER NOT EXISTS { ?subject :hasTemplateElement ?previous . ?previous :elementIndex ?previousIndex . FILTER(?previousIndex = ?index - 1) } BIND(CONCAT("missing index before ", STR(?index)) AS ?detail) } BIND("template element sequence is not contiguous" AS ?check) } UNION { ?subject a :TemplateParameter . FILTER NOT EXISTS { ?template :hasTemplateParameter ?subject ; :hasTemplateElement ?slot . ?subject :parameterName ?parameterName . ?slot a :TemplateSlot ; :usesParameter ?subject . } BIND("incomplete or unused template parameter" AS ?check) BIND(STR(?subject) AS ?detail) } UNION { ?subject a :TemplateSlot ; :usesParameter ?parameter . ?template :hasTemplateElement ?subject . FILTER NOT EXISTS { ?template :hasTemplateParameter ?parameter . } BIND("slot uses parameter from another template" AS ?check) BIND(STR(?parameter) AS ?detail) } UNION { ?subject a :QuestionTemplate ; :hasTemplateParameter ?left, ?right . ?left :parameterName ?parameterName . ?right :parameterName ?parameterName . FILTER(?left != ?right) BIND("template parameter names are not unique" AS ?check) BIND(STR(?parameterName) AS ?detail) } UNION { ?subject a :TemplateInstantiation . FILTER NOT EXISTS { ?question :hasTemplateInstantiation ?subject ; :hasFormulation ?formulation . ?subject :usesTemplate ?template ; :realizesFormulation ?formulation . } BIND("incomplete template instantiation" AS ?check) BIND(STR(?subject) AS ?detail) } UNION { ?subject a :TemplateInstantiation ; :usesTemplate ?template . { ?template :hasTemplateParameter ?parameter . FILTER NOT EXISTS { ?subject :hasTemplateBinding ?binding . ?binding :bindsParameter ?parameter . } BIND("missing parameter binding" AS ?check) } UNION { ?subject :hasTemplateBinding ?binding . ?binding :bindsParameter ?parameter . FILTER NOT EXISTS { ?template :hasTemplateParameter ?parameter . } BIND("binding targets undeclared parameter" AS ?check) } UNION { ?subject :hasTemplateBinding ?left, ?right . ?left :bindsParameter ?parameter . ?right :bindsParameter ?parameter . FILTER(?left != ?right) BIND("parameter has duplicate bindings" AS ?check) } BIND(STR(?parameter) AS ?detail) } UNION { ?subject a :TemplateBinding . { FILTER NOT EXISTS { ?instantiation :hasTemplateBinding ?subject . } } UNION { FILTER NOT EXISTS { ?subject :bindsParameter ?parameter . } } UNION { FILTER NOT EXISTS { ?subject :bindingText ?bindingText . } } UNION { FILTER NOT EXISTS { ?subject (:boundResource|:boundLiteral) ?boundValue . } } UNION { ?subject :boundResource ?boundResource ; :boundLiteral ?boundLiteral . } BIND("incomplete or ambiguous template binding" AS ?check) BIND(STR(?subject) AS ?detail) } UNION { ?subject a :QuestionSet ; :containsQuestion ?question . FILTER NOT EXISTS { ?question a :CompetencyQuestion ; :questionPurpose :RegressionPurpose . } BIND("corpus member is not a regression question" AS ?check) BIND(STR(?question) AS ?detail) } UNION { ?subject ?termKind ?kind . VALUES ?termKind { rdf:type } VALUES ?kind { rdfs:Class rdf:Property } FILTER(STRSTARTS(STR(?subject), STR(:))) FILTER(?subject != :) FILTER NOT EXISTS { ?coverage a :CoverageAssertion ; :coveredResource ?subject ; :coverageStatus :CoveredStatus . } BIND("public term lacks covered assertion" AS ?check) BIND(STR(?kind) AS ?detail) } } ORDER BY ?check ?subject
Self-application recursive acceptance query
PREFIX : <https://ontology.inferal.com/modules/competency-question/> PREFIX ex: <https://example.com/inferal/cqo-self-application/> PREFIX prov: <http://www.w3.org/ns/prov#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> ASK WHERE { FILTER NOT EXISTS { ?question a :CompetencyQuestion . VALUES ?predicate { :hasFormulation :addressesRequirement :supportsUseCase :hasStakeholder :questionKind :questionPurpose :targetsArtifact :targetsVersion :hasAnswerExpectation :hasFormalQuery :lifecycleState :reviewState } FILTER NOT EXISTS { ?question ?predicate ?value . } } FILTER NOT EXISTS { VALUES (?question ?expectedKind) { (ex:cq-first-class :ScopingQuestion) (ex:cq-traceability :ValidationQuestion) (ex:cq-target :ValidationQuestion) (ex:cq-expectation :ValidationQuestion) (ex:cq-execution :ValidationQuestion) (ex:cq-governance :ValidationQuestion) (ex:cq-patterns :ValidationQuestion) (ex:cq-template-elements :ValidationQuestion) (ex:cq-template-instantiation :ValidationQuestion) (ex:cq-recursion :ValidationQuestion) (ex:cq-bootstrap :ScopingQuestion) (ex:cq-satisfaction :ValidationQuestion) (ex:cq-current-evidence :ValidationQuestion) (ex:cq-coformalization :ValidationQuestion) } FILTER NOT EXISTS { ?question :questionKind ?expectedKind . } } FILTER NOT EXISTS { ?execution a :QueryExecution ; :evaluatesQuestion ?question ; :hasExecutionResult ?result . ?question :targetsVersion ?version . ?result :executionStatus :PassedStatus . FILTER NOT EXISTS { ?execution prov:used ?version . } } FILTER NOT EXISTS { ?execution a :QueryExecution ; :evaluatesQuestion ?question ; :hasExecutionResult ?result . ?question :hasAnswerExpectation ?expectation . ?expectation a :AnswerConstraint . FILTER NOT EXISTS { ?assessment a :ExpectationAssessment ; :assessesResult ?result ; :assessesExpectation ?expectation ; :expectationSatisfied true . } } FILTER NOT EXISTS { ?template a :QuestionTemplate . FILTER NOT EXISTS { ?template :templateText ?templateText ; :hasTemplateElement ?element . } } FILTER NOT EXISTS { ?element a ?templateElementKind . VALUES ?templateElementKind { :TemplateElement :TemplateTextSegment :TemplateSlot } FILTER NOT EXISTS { ?template :hasTemplateElement ?element . ?element :elementIndex ?index . { ?element a :TemplateTextSegment ; :segmentText ?value . } UNION { ?element a :TemplateSlot ; :usesParameter ?value . } } } FILTER NOT EXISTS { ?template a :QuestionTemplate ; :hasTemplateElement ?left, ?right . ?left :elementIndex ?index . ?right :elementIndex ?index . FILTER(?left != ?right) } FILTER NOT EXISTS { ?template a :QuestionTemplate ; :hasTemplateElement ?element . ?element :elementIndex ?index . FILTER(?index > 0) FILTER NOT EXISTS { ?template :hasTemplateElement ?previous . ?previous :elementIndex ?previousIndex . FILTER(?previousIndex = ?index - 1) } } FILTER NOT EXISTS { ?parameter a :TemplateParameter . FILTER NOT EXISTS { ?template :hasTemplateParameter ?parameter ; :hasTemplateElement ?slot . ?parameter :parameterName ?parameterName . ?slot a :TemplateSlot ; :usesParameter ?parameter . } } FILTER NOT EXISTS { ?slot a :TemplateSlot ; :usesParameter ?parameter . ?template :hasTemplateElement ?slot . FILTER NOT EXISTS { ?template :hasTemplateParameter ?parameter . } } FILTER NOT EXISTS { ?template a :QuestionTemplate ; :hasTemplateParameter ?left, ?right . ?left :parameterName ?parameterName . ?right :parameterName ?parameterName . FILTER(?left != ?right) } FILTER NOT EXISTS { ?instantiation a :TemplateInstantiation . FILTER NOT EXISTS { ?question :hasTemplateInstantiation ?instantiation ; :hasFormulation ?formulation . ?instantiation :usesTemplate ?template ; :realizesFormulation ?formulation . } } FILTER NOT EXISTS { ?instantiation a :TemplateInstantiation ; :usesTemplate ?template . ?template :hasTemplateParameter ?parameter . FILTER NOT EXISTS { ?instantiation :hasTemplateBinding ?binding . ?binding :bindsParameter ?parameter . } } FILTER NOT EXISTS { ?instantiation a :TemplateInstantiation ; :usesTemplate ?template ; :hasTemplateBinding ?binding . ?binding :bindsParameter ?parameter . FILTER NOT EXISTS { ?template :hasTemplateParameter ?parameter . } } FILTER NOT EXISTS { ?instantiation a :TemplateInstantiation ; :hasTemplateBinding ?left, ?right . ?left :bindsParameter ?parameter . ?right :bindsParameter ?parameter . FILTER(?left != ?right) } FILTER NOT EXISTS { ?binding a :TemplateBinding . { FILTER NOT EXISTS { ?instantiation :hasTemplateBinding ?binding . } } UNION { FILTER NOT EXISTS { ?binding :bindsParameter ?parameter . } } UNION { FILTER NOT EXISTS { ?binding :bindingText ?bindingText . } } UNION { FILTER NOT EXISTS { ?binding (:boundResource|:boundLiteral) ?boundValue . } } UNION { ?binding :boundResource ?boundResource ; :boundLiteral ?boundLiteral . } } FILTER NOT EXISTS { ?term a ?kind . VALUES ?kind { rdfs:Class rdf:Property } FILTER(STRSTARTS(STR(?term), STR(:))) FILTER(?term != :) FILTER NOT EXISTS { ?coverage a :CoverageAssertion ; :coveredResource ?term ; :coverageStatus :CoveredStatus . } } }
Self-application boolean conformance query
The checked-in acceptance query returned zero regression rows when run over the base ontology and this fixture.
The extraction query returned all twenty ordered elements from four self-application templates without parsing templateText.
The realization query returned ten ordered fragments whose two concatenated sequences exactly match their linked formulations.
The alternate ASK formalization returned true over the same self-application graph.