W3C

Boolean Effective Value

Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, and document use rules apply.


Abstract

Test of boolean expressions

This page describes W3C SPARQL Working Group's SPARQL1.0 test suite.

Contributing Tests

The test manifests and entries are built automatically from manifest.ttl using a Rake task. Tests may be contributed via pull request to https://github.com/w3c/rdf-tests with suitable changes to the manifest.ttl and referenced files.

Distribution

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

Disclaimer

UNDER BOTH MUTUALLY EXCLUSIVE LICENSES, THIS DOCUMENT AND ALL DOCUMENTS, TESTS AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

Test Descriptions

http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest#dawg-boolean-literal: Test literal 'true'
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://lists.w3.org/Archives/Public/public-rdf-dawg/2007JulSep/att-0087/14-dawg-minutes.html
action
query
query-boolean-literal.rq
data
data-1.ttl
result
result-boolean-literal.ttl
http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest#dawg-bev-1: Test 'boolean effective value' - true

Non-zero numerics, non-empty strings, and the true boolean have an EBV of true

type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://lists.w3.org/Archives/Public/public-rdf-dawg/2007AprJun/att-0082/2007-06-12-dawg-minutes.html
action
query
query-bev-1.rq
data
data-1.ttl
result
result-bev-1.ttl
http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest#dawg-bev-2: Test 'boolean effective value' - false

Zero-valued numerics, the empty string, and the false boolean have an EBV of false

type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://lists.w3.org/Archives/Public/public-rdf-dawg/2007AprJun/att-0082/2007-06-12-dawg-minutes.html
action
query
query-bev-2.rq
data
data-1.ttl
result
result-bev-2.ttl
http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest#dawg-bev-3: Test 'boolean effective value' - &&

The && operator takes the EBV of its operands

type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://lists.w3.org/Archives/Public/public-rdf-dawg/2007AprJun/att-0082/2007-06-12-dawg-minutes.html
action
query
query-bev-3.rq
data
data-1.ttl
result
result-bev-3.ttl
http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest#dawg-bev-4: Test 'boolean effective value' - ||

The || operator takes the EBV of its operands

type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://lists.w3.org/Archives/Public/public-rdf-dawg/2007AprJun/att-0082/2007-06-12-dawg-minutes.html
action
query
query-bev-4.rq
data
data-1.ttl
result
result-bev-4.ttl
http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest#dawg-bev-5: Test 'boolean effective value' - optional

The EBV of an unbound value or a literal with an unknown datatype is a type error, which eliminates the solution in question

type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://lists.w3.org/Archives/Public/public-rdf-dawg/2007AprJun/att-0082/2007-06-12-dawg-minutes.html
action
query
query-bev-5.rq
data
data-2.ttl
result
result-bev-5.ttl
http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest#dawg-bev-6: Test 'boolean effective value' - unknown types

Negating a type error is still a type error

type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://lists.w3.org/Archives/Public/public-rdf-dawg/2007AprJun/att-0082/2007-06-12-dawg-minutes.html
action
query
query-bev-6.rq
data
data-2.ttl
result
result-bev-6.ttl