prefix ex: prefix in: select ?x (datatype(?l) as ?dt) where { ?x ex:p ?y . optional {?x ex:q ?l} }