def add_literal_by_email(email,predicate,literal): update = """ PREFIX email: <https://github.com/superphy#hasEmail> PREFIX p: <%s> INSERT{ ?indv p: '%s' } WHERE { ?indv email: '%s' }""" % (predicate,literal,email) endpoint.update(update) return update
def add_literal_by_email(email, predicate, literal): update = """ PREFIX email: <https://github.com/superphy#hasEmail> PREFIX p: <%s> INSERT{ ?indv p: '%s' } WHERE { ?indv email: '%s' }""" % (predicate, literal, email) endpoint.update(update) return update
def insert_user(sparql_id,email): return endpoint.update(""" PREFIX user: <https://github.com/superphy#User> PREFIX owl_NamedIndividual: <http://www.w3.org/2002/07/owl#> PREFIX RDF_type: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> PREFIX indv: <https://github.com/superphy#%s.User> PREFIX email: <https://github.com/superphy#hasEmail> INSERT DATA{ indv: RDF_type: owl_NamedIndividual:. indv: RDF_type: user:. indv: email: '%s' }""" % (sparql_id, email.lower()))
def insert_user(sparql_id, email): return endpoint.update(""" PREFIX user: <https://github.com/superphy#User> PREFIX owl_NamedIndividual: <http://www.w3.org/2002/07/owl#> PREFIX RDF_type: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> PREFIX indv: <https://github.com/superphy#%s.User> PREFIX email: <https://github.com/superphy#hasEmail> INSERT DATA{ indv: RDF_type: owl_NamedIndividual:. indv: RDF_type: user:. indv: email: '%s' }""" % (sparql_id, email.lower()))
def delete_all_triples(): endpoint.update("""DELETE {?s?p?o} WHERE {?s?p?o}""")