# Path: duckpond/apps/jsonld/service.py
# def content_type():
# def jsonld_response(data):
# def json_response(data):
# def api_error_400(error):
# def by_graph(graphs,subjects):
# def any_graph():
# def graph_path(graph):


from flask import Flask, g
from duckpond.apps.jsonld.service import data
import logging, logging.config, os
import argparse
import json
      help="The JSON-LD context to use")
   parser.add_argument(
        '--debug',
        action='store_true',
        default=False,
        help="Enable debugging")
   args = parser.parse_args()

   f = os.environ.get('WEB_CONF')
   if f is not None:
      app.config.from_envvar('WEB_CONF')

   if args.service is not None:
      app.config['SPARQL_ENDPOINT'] = {
         'url' : args.service
      }

   if args.context is not None:
      with open(args.context,'r') as data:
         app.config['LD_CONTEXT'] = json.load(data)
   else:
      if app.config.get('LD_CONTEXT') is None:
         app.config['LD_CONTEXT'] = {}

   if args.auth is not None:
      auth = args.auth.split(':')
      app.config['SPARQL_ENDPOINT']['username'] = auth[0]
      if len(auth)>1:
         app.config['SPARQL_ENDPOINT']['password'] = auth[1]


# Path: duckpond/apps/jsonld/service.py
# def content_type():
# def jsonld_response(data):
# def json_response(data):
# def api_error_400(error):
# def by_graph(graphs,subjects):
# def any_graph():
# def graph_path(graph):


# Path: duckpond/apps/jsonld/__main__.py
from flask import Flask, g
from duckpond.apps.jsonld.service import data
import logging, logging.config, os
import argparse
import json

      help="The JSON-LD context to use")
   parser.add_argument(
        '--debug',
        action='store_true',
        default=False,
        help="Enable debugging")
   args = parser.parse_args()

   f = os.environ.get('WEB_CONF')
   if f is not None:
      app.config.from_envvar('WEB_CONF')

   if args.service is not None:
      app.config['SPARQL_ENDPOINT'] = {
         'url' : args.service
      }

   if args.context is not None:
      with open(args.context,'r') as data:
         app.config['LD_CONTEXT'] = json.load(data)
   else:
      if app.config.get('LD_CONTEXT') is None:
         app.config['LD_CONTEXT'] = {}

   if args.auth is not None:
      auth = args.auth.split(':')
      app.config['SPARQL_ENDPOINT']['username'] = auth[0]
      if len(auth)>1:
         app.config['SPARQL_ENDPOINT']['password'] = auth[1]


   app.config['DEBUG'] = args.debug