def get_canonical_property(self, prop, tail):
    """Returns true if the prop and tail are canonical WikiData properties."""
    if not isinstance(prop, sling.Frame) or not isinstance(tail, sling.Frame):
      return None
    prop_id = self.get_frame_id(prop)
    tail_id = self.get_frame_id(tail)
    if prop_id is None:
      return None
    if tail_id is None:
      return None
    if not prop_id.startswith("P") or not tail_id.startswith("Q"):
      return None
    return (prop_id, tail_id)
Returns true if the prop and tail are canonical WikiData properties.
language/labs/drkit/wikidata/preprocessing/distantly_supervise.py