PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rut: <http://rdfunit.aksw.org/ns/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#Entry> a rdfs:Class .

rut:ResultAnnotation a rdfs:Class ;
  rdfs:label "ResultAnnotation"@en ;
  rdfs:comment "Used to further annotate an ExtendedTestCaseResult."@en .

rut:annotationValue a rdf:Property ;
  rdfs:label "annotationValue"@en ;
  rdfs:domain rut:ResultAnnotation ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:annotationProperty a rdf:Property ;
  rdfs:label "annotationProperty"@en ;
  rdfs:domain rut:ResultAnnotation ;
  rdfs:range rdf:Property .

<http://spinrdf.org/spin#ConstraintViolation> a rdfs:Class .

rut:TestGenerator a rdfs:Class ;
  rdfs:label "TestGenerator"@en .

rut:basedOnPattern a rdf:Property ;
  rdfs:label "basedOnPattern"@en ;
  rdfs:comment "basedOnPattern contains the Data Quality Test Pattern that is instantiated in the described Test."@en ;
  rdfs:range rut:Pattern .

rut:sparqlGenerator a rdf:Property ;
  rdfs:label "sparqlGenerator"@en ;
  rdfs:comment "A SPARQL query used to instantiate test cases based on patterns"@en ;
  rdfs:domain rut:TestGenerator ;
  rdfs:range xsd:string .

rut:TestCase a rdfs:Class ;
  rdfs:label "TestCase"@en ;
  rdfs:comment "A superclass of TestCases. Defines properties all test cases can have but concrete implementation occurs on subclasses."@en .

rut:testCaseLogLevel a rdf:Property ;
  rdfs:label "testCaseLogLevel"@en ;
  rdfs:comment "the rlog:Level this case is associated with."@en ;
  rdfs:domain rut:TestCase ;
  rdfs:range <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#Level> .

rut:source a rdf:Property ;
  rdfs:label "source"@en ;
  rdfs:comment "source is a URI that points to a general Source, which can be a schema, a dataset or an application"@en ;
  rdfs:range <https://w3id.org/linkml/Any> .

<http://purl.org/dc/terms/description> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:references a rdf:Property ;
  rdfs:label "references"@en ;
  rdfs:comment "references specifies the Classes and Properties involved in the described test case."@en ;
  rdfs:domain rut:TestCase ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:appliesTo a rdf:Property ;
  rdfs:label "appliesTo"@en ;
  rdfs:comment "applies to describes the ontology used for terms in the Test."@en ;
  rdfs:domain rut:TestCase ;
  rdfs:range rut:TestAppliesTo .

rut:generated a rdf:Property ;
  rdfs:label "generated"@en ;
  rdfs:comment "generated specifies the way the test was constructed."@en ;
  rdfs:domain rut:TestCase ;
  rdfs:range rut:TestGenerationType .

rut:Result a rdfs:Class .

rut:resultCount a rdf:Property ;
  rdfs:label "resultCount"@en ;
  rdfs:comment "The error results of a test execution. -1 means there was a timeout and -2 an error."@en ;
  rdfs:domain rut:Result ;
  rdfs:range xsd:integer .

rut:resultPrevalence a rdf:Property ;
  rdfs:label "resultPrevalence"@en ;
  rdfs:comment "The prevalence result of a test execution. -1 means there was a timeout and -2 an error."@en ;
  rdfs:domain rut:Result ;
  rdfs:range xsd:integer .

<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#Level> a rdfs:Class .

<http://www.w3.org/2002/07/owl#Ontology> a rdfs:Class .

rut:testSuite a rdf:Property ;
  rdfs:label "testSuite"@en ;
  rdfs:comment "links an ontology to TestSuite for validating data adhering to that ontology"@en ;
  rdfs:domain <http://www.w3.org/2002/07/owl#Ontology> ;
  rdfs:range rut:TestSuite .

rut:Parameter a rdfs:Class ;
  rdfs:label "Parameter"@en .

rut:parameterConstraint a rdf:Property ;
  rdfs:label "parameterConstraint"@en ;
  rdfs:domain rut:Parameter ;
  rdfs:range rut:ParameterConstraint .

rut:constraintPattern a rdf:Property ;
  rdfs:label "constraintPattern"@en ;
  rdfs:domain rut:Parameter ;
  rdfs:range xsd:string .

<http://purl.org/dc/terms/identifier> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:Pattern a rdfs:Class ;
  rdfs:label "Pattern"@en .

rut:sparqlPrevalencePattern a rdf:Property ;
  rdfs:label "sparqlPrevalencePattern"@en ;
  rdfs:comment "A pattern sparql prevalence query, reuses the pattern parameters, maybe not all of them. The prevalence query may be empty"@en ;
  rdfs:domain rut:Pattern ;
  rdfs:range xsd:string .

rut:parameter a rdf:Property ;
  rdfs:label "parameter"@en ;
  rdfs:comment "links a Pattern with a list of pattern parameters"@en ;
  rdfs:range rut:Parameter .

rut:sparqlWherePattern a rdf:Property ;
  rdfs:label "sparqlWherePattern"@en ;
  rdfs:comment "The WHERE part of sparql pattern  query with placeholders (%%XYZ%%) for parameters"@en ;
  rdfs:domain rut:Pattern ;
  rdfs:range xsd:string .

<http://www.w3.org/ns/prov#Collection> a rdfs:Class .

rut:StatusTestCaseResult a rdfs:Class ;
  rdfs:label "StatusTestCaseResult"@en ;
  rdfs:comment "A class that holds the status of a single test execution"@en ;
  rdfs:subClassOf rut:TestCaseResult .

rut:resultStatus a rdf:Property ;
  rdfs:label "resultStatus"@en ;
  rdfs:comment "holds the result type. One of Success, Fail, Timeout, Error"@en ;
  rdfs:range rut:ResultStatus .

rut:testCase a rdf:Property ;
  rdfs:label "testCase"@en ;
  rdfs:comment "points to a test case"@en ;
  rdfs:range rut:TestCase .

<http://www.w3.org/ns/prov#wasGeneratedBy> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:AggregatedTestCaseResult a rdfs:Class ;
  rdfs:label "AggregatedTestCaseResult"@en ;
  rdfs:comment "A class that holds the aggregated results of a single test execution"@en ;
  rdfs:subClassOf rut:StatusTestCaseResult .

rut:Binding a rdfs:Class ;
  rdfs:label "Binding"@en ;
  rdfs:comment "A binding between a pattern parameter and a value"@en .

rut:bindingValue a rdf:Property ;
  rdfs:label "bindingValue"@en ;
  rdfs:comment "the value of a Binding"@en ;
  rdfs:domain rut:Binding ;
  rdfs:range <https://w3id.org/linkml/Any> .

<http://www.w3.org/ns/prov#Activity> a rdfs:Class .

rut:TestSuite a rdfs:Class ;
  rdfs:label "TestSuite"@en ;
  rdfs:comment "A list of test cases. Use prov:hadMember for test case listing"@en ;
  rdfs:subClassOf <http://www.w3.org/ns/prov#Collection> .

<http://www.w3.org/ns/prov#hadMember> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:TestCaseDependency a rdfs:Class ;
  rdfs:label "TestCaseDependency"@en ;
  rdfs:comment "defines a dependency between two test cases"@en .

rut:dependencyFrom a rdf:Property ;
  rdfs:label "dependencyFrom"@en ;
  rdfs:comment "the test case we depends upon"@en ;
  rdfs:domain rut:TestCaseDependency ;
  rdfs:range rut:TestCase .

rut:dependencyTo a rdf:Property ;
  rdfs:label "dependencyTo"@en ;
  rdfs:comment "the test case that depends on another test case"@en ;
  rdfs:domain rut:TestCaseDependency ;
  rdfs:range rut:TestCase .

rut:dependencyExecute a rdf:Property ;
  rdfs:label "dependencyExecute"@en ;
  rdfs:comment "'true' executes the dependecnyTo TestCase while false does not"@en ;
  rdfs:domain rut:TestCaseDependency ;
  rdfs:range xsd:boolean .

rut:dependencyCondition a rdf:Property ;
  rdfs:label "dependencyCondition"@en ;
  rdfs:comment "the rut:ResultStatus of the dependencyFrom result condition that triggers this dependency"@en ;
  rdfs:domain rut:TestCaseDependency ;
  rdfs:range rut:ResultStatus .

rut:PatternBasedTestCase a rdfs:Class ;
  rdfs:label "PatternBasedTestCase"@en ;
  rdfs:comment "A test case that is based on a Pattern"@en ;
  rdfs:subClassOf rut:TestCase .

rut:binding a rdf:Property ;
  rdfs:label "binding"@en ;
  rdfs:comment "defines a binding between a pattern parameter and a value"@en ;
  rdfs:domain rut:PatternBasedTestCase ;
  rdfs:range rut:Binding .

rut:TestCaseResult a rdfs:Class ;
  rdfs:label "TestCaseResult"@en ;
  rdfs:comment "A class that holds a single result of a test execution. Each test case links to the TestCase (rut:testCase) it was originated from and a TestExecution (prov:wasGeneratedBy)"@en .

rut:ExtendedTestCaseResult a rdfs:Class ;
  rdfs:label "ExtendedTestCaseResult"@en ;
  rdfs:subClassOf rut:RLOGTestCaseResult , <http://spinrdf.org/spin#ConstraintViolation> .

rut:errorSource a rdf:Property ;
  rdfs:label "errorSource"@en ;
  rdfs:comment "With this property we point to the error source (if known beforehand)"@en ;
  rdfs:domain rut:ExtendedTestCaseResult ;
  rdfs:range <https://w3id.org/linkml/Any> ;
  rdfs:subPropertyOf <http://purl.org/dc/terms/subject> .

rut:errorType a rdf:Property ;
  rdfs:label "errorType"@en ;
  rdfs:comment "We denote the exact problem of the error"@en ;
  rdfs:domain rut:ExtendedTestCaseResult ;
  rdfs:range <https://w3id.org/linkml/Any> ;
  rdfs:subPropertyOf <http://purl.org/dc/terms/subject> .

<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#resource> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:errorPropertyContext a rdf:Property ;
  rdfs:label "errorPropertyContext"@en ;
  rdfs:comment "Here we attach properties from the resource to provide the error context (i.e. the death date when the error is in the birth date)."@en ;
  rdfs:domain rut:ExtendedTestCaseResult ;
  rdfs:range rdf:Property .

rut:errorClassification a rdf:Property ;
  rdfs:label "errorClassification"@en ;
  rdfs:comment "This property is used to annotate an error with a classification. This classification is meant to be of higher level"@en ;
  rdfs:domain rut:ExtendedTestCaseResult ;
  rdfs:range <https://w3id.org/linkml/Any> ;
  rdfs:subPropertyOf <http://purl.org/dc/terms/subject> .

<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#level> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#message> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

<http://spinrdf.org/spin#violationRoot> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

<https://w3id.org/linkml/Any> a rdfs:Class ;
  rdfs:comment "An unconstrained type or object"@en .

rdf:Property a rdfs:Class .

rut:ManualTestCase a rdfs:Class ;
  rdfs:label "ManualTestCase"@en ;
  rdfs:comment "A test case where the SPARQL is defined manually"@en ;
  rdfs:subClassOf rut:TestCase .

rut:sparqlWhere a rdf:Property ;
  rdfs:label "sparqlWhere"@en ;
  rdfs:comment """The WHERE part of a SPARQL query. Must be enclosed in brackets {} and use the following variables: ?resource, ?message.
        ?resource is URI the constraint violation occurs in and ?message is a logging message."""@en ;
  rdfs:domain rut:ManualTestCase ;
  rdfs:range xsd:string .

rut:sparqlPrevalence a rdf:Property ;
  rdfs:label "sparqlPrevalence"@en ;
  rdfs:comment "A SPARQL query for prevalence"@en ;
  rdfs:domain rut:ManualTestCase ;
  rdfs:range xsd:string .

rut:RLOGTestCaseResult a rdfs:Class ;
  rdfs:label "RLOGTestCaseResult"@en ;
  rdfs:subClassOf rut:TestCaseResult , <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#Entry> .

rut:TestExecution a rdfs:Class ;
  rdfs:label "TestExecution"@en ;
  rdfs:comment "Holds the results of a TestSuite execution against a dataset"@en ;
  rdfs:subClassOf <http://www.w3.org/ns/prov#Activity> .

rut:testsError a rdf:Property ;
  rdfs:label "testsError"@en ;
  rdfs:comment "Total tests that raised an error in a TestExecution"@en ;
  rdfs:domain rut:TestExecution ;
  rdfs:range xsd:nonNegativeInteger .

rut:testsTimeout a rdf:Property ;
  rdfs:label "testsTimeout"@en ;
  rdfs:comment "Total tests that timeout in a TestExecution"@en ;
  rdfs:domain rut:TestExecution ;
  rdfs:range xsd:nonNegativeInteger .

rut:testsRun a rdf:Property ;
  rdfs:label "testsRun"@en ;
  rdfs:comment "Total tests run in a TestExecution"@en ;
  rdfs:domain rut:TestExecution ;
  rdfs:range xsd:nonNegativeInteger .

rut:testsFailed a rdf:Property ;
  rdfs:label "testsFailed"@en ;
  rdfs:comment "Total tests that failed in a TestExecution"@en ;
  rdfs:domain rut:TestExecution ;
  rdfs:range xsd:nonNegativeInteger .

<http://www.w3.org/ns/prov#endedAtTime> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:testsSucceeded a rdf:Property ;
  rdfs:label "testsSucceeded"@en ;
  rdfs:comment "Total tests that succedded in a TestExecution"@en ;
  rdfs:domain rut:TestExecution ;
  rdfs:range xsd:nonNegativeInteger .

<http://www.w3.org/ns/prov#startedAtTime> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

<http://purl.org/dc/terms/subject> a rdf:Property ;
  rdfs:range <https://w3id.org/linkml/Any> .

rut:resultAnnotation a rdf:Property ;
  rdfs:label "resultAnnotation"@en ;
  rdfs:range rut:ResultAnnotation .

rut:ParameterConstraint a rdfs:Class ;
  rdfs:label "ParameterConstraint"@en .

rut:Class a rut:ParameterConstraint ;
  rdfs:label "Class"@en ;
  rdfs:comment "The parameter is restricted to a Class."@en .

rut:None a rut:ParameterConstraint ;
  rdfs:label "None"@en ;
  rdfs:comment "The parameter can be anything, even a free variable (?var)"@en .

rut:Property a rut:ParameterConstraint ;
  rdfs:label "Property"@en ;
  rdfs:comment "The parameter is restricted to a property."@en .

rut:Operator a rut:ParameterConstraint ;
  rdfs:label "Operator"@en ;
  rdfs:comment "The parameter can be an operator."@en .

rut:Resource a rut:ParameterConstraint ;
  rdfs:label "Resource"@en ;
  rdfs:comment "The pattern can be a resource."@en .

rut:ResultStatus a rdfs:Class ;
  rdfs:label "ResultStatus"@en ;
  rdfs:comment "TestCaseResult type"@en .

rut:ResultStatusSuccess a rut:ResultStatus ;
  rdfs:label "ResultStatusSuccess"@en .

rut:ResultStatusTimeout a rut:ResultStatus ;
  rdfs:label "ResultStatusTimeout"@en .

rut:ResultStatusError a rut:ResultStatus ;
  rdfs:label "ResultStatusError"@en .

rut:ResultStatusFail a rut:ResultStatus ;
  rdfs:label "ResultStatusFail"@en .

rut:TestAppliesTo a rdfs:Class ;
  rdfs:label "TestAppliesTo"@en .

rut:EnrichedSchema a rut:TestAppliesTo ;
  rdfs:label "EnrichedSchema"@en ;
  rdfs:comment "EnrichedSchema: When the tests applies to an ontology / vocabulary enriched with external (semi-)automatic approaches"@en .

rut:Dataset a rut:TestAppliesTo ;
  rdfs:label "Dataset"@en ;
  rdfs:comment "Dataset: When the tests applies to a dataset only (i.e. a SPARQL Endpoint)"@en .

rut:Application a rut:TestAppliesTo ;
  rdfs:label "Application"@en ;
  rdfs:comment "Application: When the tests are specific to an application only"@en .

rut:Schema a rut:TestAppliesTo ;
  rdfs:label "Schema"@en .

rut:TestGenerationType a rdfs:Class ;
  rdfs:label "TestGenerationType"@en .

rut:AutoGenerated a rut:TestGenerationType ;
  rdfs:label "AutoGenerated"@en ;
  rdfs:comment "AutoGenerated: This test was created automatically"@en .

rut:ManuallyGenerated a rut:TestGenerationType ;
  rdfs:label "ManuallyGenerated"@en ;
  rdfs:comment "ManuallyGenerated: This test was created manually"@en .
