Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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()))
Exemplo n.º 4
0
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()))
Exemplo n.º 5
0
def delete_all_triples():
    endpoint.update("""DELETE {?s?p?o} WHERE {?s?p?o}""")
Exemplo n.º 6
0
def delete_all_triples():
    endpoint.update("""DELETE {?s?p?o} WHERE {?s?p?o}""")