@prefix : <http://www.w3.org/2006/03/test-description#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xmls: <http://www.w3.org/2001/XMLSchema#>.

#@@@ 404, but used in http://www.w3.org/2001/tag/fdesc54/classTreeOwl.n3
#bug report to www-tag?
@prefix webarch: <http://www.w3.org/2001/tag/fdesc54/webarch#>.

<> rdfs:seeAlso <http://www.w3.org/TR/2005/NOTE-test-metadata-20050914/>.

:TestCase a owl:Class;
  rdfs:label "A Test Case"@en;
  rdfs:comment "A set of test inputs, execution conditions, and expected results developed for a particular objective, such as to exercise a particular program path or to verify compliance with a specific requirement";
  rdfs:subClassOf 
     [ a owl:Restriction; owl:minCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty dc:title ],
     [ a owl:Restriction;
       owl:maxCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty dc:title ],
     [ a owl:Restriction; owl:minCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty :purpose ],
     [ a owl:Restriction; 
       owl:maxCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty :purpose ],
     [ a owl:Restriction; owl:maxCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty dc:description ],
     [ a owl:Restriction; owl:maxCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty :reviewStatus ],
     [ a owl:Restriction; owl:minCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty dc:contributor ],
       [ a owl:Restriction; owl:minCardinality "1"^^xmls:nonNegativeInteger;
       owl:onProperty dc:rights ]
  .
# This doesn't implement the requirement on having a versioning system
# since that's probably something one need to customize to its own needs
# http://purl.org/dc/terms/ DC Terms have hasVersion

# Grouping would typically be done with subclasses, or new properties
# so doesn't need to be specifically defined by the RDF Schema


# specialized version of test based on specifications (e.g. conformance or interop testing)
# we can make the specification reference mandatory in this case
:SpecificationTestCase rdfs:subClassOf :TestCase; a owl:Class;
  rdfs:label "A Test Case based on a specification"@en;
  rdfs:comment "A test case which relates to a requirement set in a specification";
    rdfs:subClassOf
      [ a owl:Restriction; owl:minCardinality "1"^^xmls:nonNegativeInteger;
        owl:onProperty :specificationReference ]
    .

:purpose a owl:DatatypeProperty;
  rdfs:label "purpose"@en;
  rdfs:domain :TestCase;
  rdfs:range rdfs:Literal.

:reviewStatus a owl:ObjectProperty;
  rdfs:label "status of review"@en;
  rdfs:range :ReviewStatus.

:specificationReference a owl:DatatypeProperty;
  rdfs:label "reference in specification"@en;
  rdfs:comment "a description or a link of what part of which specification lead to the creation of this test case"@en;
  rdfs:domain :TestCase;
  rdfs:range rdfs:Literal.

:preCondition a owl:DatatypeProperty;
  rdfs:label "precondition"@en;
  rdfs:comment "a condition that must be met before the test is executed"@en;
  rdfs:domain :TestCase;
  rdfs:range rdfs:Literal.

:input a rdf:Property;
  rdfs:label "input"@en;
  rdfs:comment "Parameters or data that are needed for the test execution."@en;
  rdfs:domain :TestCase.

:informationResourceInput rdfs:subPropertyOf :input; a owl:ObjectProperty;
  rdfs:label "information resource as input"@en;
  rdfs:range webarch:InformationResource;
  rdfs:comment "Information Resource (e.g. a file) used as input for the test case"@en.

:expectedResults a rdf:Property;
  rdfs:label "expected results"@en;
  rdfs:comment "The results that a conformant implementation is expected to produce when this test is executed";
  rdfs:domain :TestCase.
 
:informationResourceResults rdfs:subPropertyOf :expectedResults; a owl:ObjectProperty;
  rdfs:label "information resource as expected results"@en;
  rdfs:range webarch:InformationResource;
  rdfs:comment "Information Resource (e.g. a file) that contains the expected results for the test case".


:ReviewStatus a owl:Class;
  rdfs:label "Status in a review process"@en;
  rdfs:comment "A particular stage in a review process".


# This illustrates how one would define a review process for the test cases
# (using a subclass of :TestCase whose :reviewStatus property would be restricted
# to :SimpleReviewStatus for instance)
:SimpleReviewStatus a owl:Class; rdfs:subClassOf :ReviewStatus;
  rdfs:label "A status for a simple review process containing 6 possible stages"@en;
  owl:oneOf ( :unreviewed :accepted :assigned :approved :rejected :onhold ).


:unreviewed a :ReviewStatus;
  rdfs:label "unreviewed"@en;
  rdfs:comment "the item has been proposed, but hasn't been reviewed (e.g. for completeness) yet".

:accepted a :ReviewStatus;
  rdfs:label "accepted"@en;
  rdfs:comment "the item has gone through a first review, which shows it as valid for further processing".

:assigned a :ReviewStatus;
  rdfs:label "assigned"@en;
  rdfs:comment "a more specific review of the item has been assigned to someone".

:approved a :ReviewStatus;
  rdfs:label "approved"@en;
  rdfs:comment "the item has gone through the review process and was approved".

:rejected a :ReviewStatus;
  rdfs:label "rejected"@en;
  rdfs:comment "the item has gone through the review process and was rejected".

:onhold a :ReviewStatus;
  rdfs:label "on hold";
  rdfs:comment "the item had already gone through the review process, but the results of the review need to be re-assessed due to new input".

