コード例 #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
ファイル: general.py プロジェクト: superphy/semantic
def delete_all_triples():
    Endpoint.update("""DELETE {?s?p?o} WHERE {?s?p?o}""")