示例#1
0
文件: user.py 项目: superphy/semantic
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
文件: user.py 项目: superphy/semantic
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}""")