[
https://issues.apache.org/jira/browse/OAK-1067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13785486#comment-13785486
]
Alexander Klimetschek commented on OAK-1067:
--------------------------------------------
Right, {{not(@prop)}} is meant to select non existent properties. It has no
special meaning on boolean properties.
The query {{@prop='false' and not(@prop)}} is what you need when an application
uses boolean properties and expects a missing boolean property to have the same
meaning as "false".
> XPath query fails on negated boolean properties
> ------------------------------------------------
>
> Key: OAK-1067
> URL: https://issues.apache.org/jira/browse/OAK-1067
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core, query
> Reporter: Alex Parvulescu
> Assignee: Thomas Mueller
> Attachments: OAK-1067-test.patch
>
>
> The issue can be seen when running an xpath query for nodes that have a
> boolean property set to false:
> bq. //*[(child/@prop = 'false' or not(child/@prop))]
> this translates into
> bq. select [jcr:path], [jcr:score], * from [nt:base] as a where [child/prop]
> = false or [child/prop] is null
> the second _or_ part is wrong and selects more than it should: 'or
> [child/prop] is null'
--
This message was sent by Atlassian JIRA
(v6.1#6144)