#  Licensed to the Apache Software Foundation (ASF) under one or more
#  contributor license agreements.  See the NOTICE file distributed with
#  this work for additional information regarding copyright ownership.
#  The ASF licenses this file to You under the Apache License, Version 2.0
#  (the "License"); you may not use this file except in compliance with
#  the License.  You may obtain a copy of the License at
# 
#       http://www.apache.org/licenses/LICENSE-2.0
# 
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://www.w3.org/2001/sw/DataAccess/tests/data-r2/expr-equals/manifest#> .
@prefix rdfs:	<http://www.w3.org/2000/01/rdf-schema#> .
@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix qt:     <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
@prefix dawgt:   <http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#> .

<>  rdf:type mf:Manifest ;
    rdfs:comment "Some SPARQL test cases - equality of values" ;
    mf:entries
    ( 
        :eq-1 :eq-2 :eq-3 :eq-4 :eq-5 :eq-2-1 :eq-2-2
        :eq-graph-1 :eq-graph-2 :eq-graph-3 :eq-graph-4 :eq-graph-5
    ).

:eq-1 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-1" ;
         rdfs:comment "= in FILTER expressions is value equality" ;
         mf:action
            [ qt:query  <query-eq-1.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-1.ttl>
      .
:eq-2 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-2" ;
         rdfs:comment "= in FILTER expressions is value equality" ;
         mf:action
            [ qt:query  <query-eq-2.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-2.ttl>
      .
:eq-3 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         rdfs:comment "Numerics are not value-equivalent to plain literals" ;
         mf:name    "Equality 1-3" ;
         mf:action
            [ qt:query  <query-eq-3.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-3.ttl>
      .
:eq-4 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-4" ;
         rdfs:comment "= compares plain literals and unknown types with the same lexical form as false" ;
         mf:action
            [ qt:query  <query-eq-4.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-4.ttl>
      .
:eq-5 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
        rdfs:comment "= on IRI terms" ;
         mf:name    "Equality 1-5" ;
         mf:action
            [ qt:query  <query-eq-5.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-5.ttl>
      .
:eq-2-1 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality - 2 var - test equals" ;
         rdfs:comment "= in FILTER is value equality" ;
         mf:action
            [ qt:query  <query-eq2-1.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq2-1.ttl>
      .

:eq-2-2 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
        rdfs:comment "!= in FILTER is value inequality" ;
         mf:name    "Equality - 2 var - test not equals " ;
         mf:action
            [ qt:query  <query-eq2-1.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq2-1.ttl>
      .

    # Graph versions of the equality tests

      # DAWG tests are graph-equivalence, not value equivalent.
:eq-graph-1 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-1 -- graph" ;
         rdfs:comment "Graph pattern matching matches exact terms, not values" ;
         mf:action
            [ qt:query  <query-eq-graph-1.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-graph-1.ttl>
      .
      # DAWG tests are graph-equivalence, not value equivalent.
:eq-graph-2 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-2 -- graph" ;
         rdfs:comment "Graph pattern matching matches exact terms, not values" ;
         mf:action
            [ qt:query  <query-eq-graph-2.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-graph-2.ttl>
      .
:eq-graph-3 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-3 -- graph" ;
         rdfs:comment "Graph pattern matching matches exact terms, not values" ;
         mf:action
            [ qt:query  <query-eq-graph-3.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-graph-3.ttl>
      .
:eq-graph-4 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-4 -- graph" ;
         rdfs:comment "Graph pattern matching matches exact terms, not values" ;
         mf:action
            [ qt:query  <query-eq-graph-4.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-graph-4.ttl>
      .
:eq-graph-5 a mf:QueryEvaluationTest ;
        dawgt:approval dawgt:Approved ;
        dawgt:approvedBy <http://www.w3.org/2007/06/19-dawg-minutes.html> ;
         mf:name    "Equality 1-5 -- graph" ;
         rdfs:comment "Graph pattern matching matches exact terms, not values" ;
         mf:action
            [ qt:query  <query-eq-graph-5.rq> ;
              qt:data   <data-eq.ttl> ] ;
         mf:result  <result-eq-graph-5.ttl>
      .


