prefix : prefix rdf: select ?X ?C ?A ?T from where {{ ?X :name "John" . ?X a ?C } UNION {?X :age ?A} UNION {?T a :12YOPerson}}