Пример #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
Пример #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
Пример #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()))
Пример #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()))
Пример #5
0
def delete_all_triples():
    endpoint.update("""DELETE {?s?p?o} WHERE {?s?p?o}""")
Пример #6
0
def delete_all_triples():
    endpoint.update("""DELETE {?s?p?o} WHERE {?s?p?o}""")