fix Semantic Web syntax and add some doctests