Exemplo n.º 1
0
def merge_models(models):
    m = bound_graph()
    for one_model in models:
        if hasattr(one_model, "model"):
            m += one_model.model
        else: m += one_model
    return serialize_rdf(m)
Exemplo n.º 2
0
def user_get(request, user_id, **kwargs):
    print "user_get", user_id, kwargs
    try:
        a = Account.objects.get(email=user_id)
        m = a.to_rdf()
    except: return HttpResponseNotFound()
    
    return utils.x_domain(HttpResponse(utils.serialize_rdf(m), "application/rdf+xml"))
Exemplo n.º 3
0
def merge_models(models):
    m = bound_graph()
    for one_model in models:
        if hasattr(one_model, "model"):
            m += one_model.model
        else:
            m += one_model
    return serialize_rdf(m)
Exemplo n.º 4
0
def user_get(request, user_id, **kwargs):
    print "user_get", user_id, kwargs
    try:
        a = Account.objects.get(email=user_id)
        m = a.to_rdf()
    except:
        return HttpResponseNotFound()

    return utils.x_domain(
        HttpResponse(utils.serialize_rdf(m), "application/rdf+xml"))
Exemplo n.º 5
0
def container_capabilities(request, **kwargs):
    m = bound_graph()
    site = URIRef(settings.SITE_URL_PREFIX)
    print "avail", dir(m)
    m.add((site, rdf['type'], sp['Container']))

    m.add((site, sp['capability'], sporg['capability/SNOMED/lookup']))

    m.add((site, sp['capability'], sporg['capability/SPL/lookup']))

    m.add((site, sp['capability'], sporg['capability/Pillbox/lookup']))

    return utils.x_domain(
        HttpResponse(utils.serialize_rdf(m), "application/rdf+xml"))
Exemplo n.º 6
0
def container_capabilities(request, **kwargs):
    m = bound_graph()
    site = URIRef(settings.SITE_URL_PREFIX)
    print "avail", dir(m)
    m.add((site, rdf['type'], sp['Container']))

    m.add((site, sp['capability'], sporg['capability/SNOMED/lookup']))

    m.add((site, sp['capability'], sporg['capability/SPL/lookup']))

    m.add((site,
             sp['capability'],
             sporg['capability/Pillbox/lookup']))
    
    return utils.x_domain(HttpResponse(utils.serialize_rdf(m), "application/rdf+xml"))
Exemplo n.º 7
0
def user_search(request, **kwargs):
    aa = Account.objects.all()

    m = bound_graph()
    
    f  = request.GET.get("givenName", None)
    l  = request.GET.get("familyName", None)
    d  = request.GET.get("department", None)
    r  = request.GET.get("role", None)
    
    if (f != None): aa = aa.filter(given_name__icontains=f)
    if (l != None): aa = aa.filter(family_name__icontains=l)
    if (d != None): aa = aa.filter(department__icontains=d)
    if (r != None): aa = aa.filter(role__icontains=r)
    
    for a in aa:
        print "Adding ", a.email, a.given_name, a.family_name
        a.to_rdf(m)
    
    return utils.x_domain(HttpResponse(utils.serialize_rdf(m), "application/rdf+xml"))
Exemplo n.º 8
0
def user_search(request, **kwargs):
    aa = Account.objects.all()

    m = bound_graph()

    f = request.GET.get("givenName", None)
    l = request.GET.get("familyName", None)
    d = request.GET.get("department", None)
    r = request.GET.get("role", None)

    if (f != None): aa = aa.filter(given_name__icontains=f)
    if (l != None): aa = aa.filter(family_name__icontains=l)
    if (d != None): aa = aa.filter(department__icontains=d)
    if (r != None): aa = aa.filter(role__icontains=r)

    for a in aa:
        print "Adding ", a.email, a.given_name, a.family_name
        a.to_rdf(m)

    return utils.x_domain(
        HttpResponse(utils.serialize_rdf(m), "application/rdf+xml"))