# Path: duckpond/apps/jsonld/endpoint.py
# def get_ld(graphs=[],subjects=[],connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    ld = connection.get(graphs,subjects)
#    return jsonld.compact(ld,connection.context)
# 
# def query_ld(q,limit=None,connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    ld = connection.query(q,limit=limit)
#    return ld if ld.get('names') is not None and ld.get('values') is not None else jsonld.compact(ld,connection.context)
# 
# def update_ld(data,graph=None,subjects=[],connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    return connection.replace(data,graph,subjects)
# 
# def delete_ld(graphs=[],subjects=[],connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    connection.delete(graphs,subjects)
# 
# def append_ld(data,graph=None,connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    return connection.append(data,graph)


from flask import Blueprint, request, abort, make_response, jsonify, current_app
from duckpond.apps.jsonld.endpoint import get_ld, query_ld, update_ld, delete_ld, append_ld
import logging
import requests
import json
         charset = param[1].strip()
   return (parts[0],charset)

def jsonld_response(data):
   if data is None:
      data = {}
   if type(data)==dict or type(data)==list:
      data = json.dumps(data)
   response = make_response(data)
   response.headers['Content-Type'] = "application/ld+json; charset=utf-8"
   return response

def json_response(data):
   if data is None:
      data = {}
   if type(data)==dict or type(data)==list:
      data = json.dumps(data)
   response = make_response(data)
   response.headers['Content-Type'] = "application/json; charset=utf-8"
   return response

@data.errorhandler(400)
def api_error_400(error):
   response = jsonify({'message': error.description,'status' : 400})
   response.status_code = 400
   response.headers['Content-Type'] = "application/json; charset=utf-8"
   return response

def by_graph(graphs,subjects):
   if request.method=='GET':

# Path: duckpond/apps/jsonld/endpoint.py
# def get_ld(graphs=[],subjects=[],connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    ld = connection.get(graphs,subjects)
#    return jsonld.compact(ld,connection.context)
# 
# def query_ld(q,limit=None,connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    ld = connection.query(q,limit=limit)
#    return ld if ld.get('names') is not None and ld.get('values') is not None else jsonld.compact(ld,connection.context)
# 
# def update_ld(data,graph=None,subjects=[],connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    return connection.replace(data,graph,subjects)
# 
# def delete_ld(graphs=[],subjects=[],connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    connection.delete(graphs,subjects)
# 
# def append_ld(data,graph=None,connection=None):
#    if connection is None:
#       connection = get_connection()
# 
#    return connection.append(data,graph)


# Path: duckpond/apps/jsonld/service.py
from flask import Blueprint, request, abort, make_response, jsonify, current_app
from duckpond.apps.jsonld.endpoint import get_ld, query_ld, update_ld, delete_ld, append_ld
import logging
import requests
import json

         charset = param[1].strip()
   return (parts[0],charset)

def jsonld_response(data):
   if data is None:
      data = {}
   if type(data)==dict or type(data)==list:
      data = json.dumps(data)
   response = make_response(data)
   response.headers['Content-Type'] = "application/ld+json; charset=utf-8"
   return response

def json_response(data):
   if data is None:
      data = {}
   if type(data)==dict or type(data)==list:
      data = json.dumps(data)
   response = make_response(data)
   response.headers['Content-Type'] = "application/json; charset=utf-8"
   return response

@data.errorhandler(400)
def api_error_400(error):
   response = jsonify({'message': error.description,'status' : 400})
   response.status_code = 400
   response.headers['Content-Type'] = "application/json; charset=utf-8"
   return response

def by_graph(graphs,subjects):
   if request.method=='GET':

      ld = get_ld(graphs,subjects)