This query will lead to a NullPointerException most of the time:
SELECT ?person ?age WHERE { ?person wdt:P31 wd:Q5; wdt:P569 ?dateOfBirth; wdt:P570 ?dateOfDeath. BIND(?dateOfDeath - ?dateOfBirth AS ?age). }
The bottom of the stack trace is:
Caused by: java.lang.NullPointerException at org.wikidata.query.rdf.blazegraph.inline.literal.WikibaseDateExtension.canInvokeMathOp(WikibaseDateExtension.java:133) at com.bigdata.rdf.internal.constraints.MathBOp.get(MathBOp.java:167) at com.bigdata.rdf.internal.constraints.MathBOp.get(MathBOp.java:56) at com.bigdata.rdf.internal.constraints.ConditionalBind.get(ConditionalBind.java:133) at com.bigdata.rdf.internal.constraints.ProjectedConstraint.accept(ProjectedConstraint.java:77) at com.bigdata.rdf.internal.constraints.TryBeforeMaterializationConstraint.accept(TryBeforeMaterializationConstraint.java:103) ... 12 more
I suspect this happens whenever one of the variables is *no value* or *unknown value*.
No known workaround.