# Path: commands/gtaa/gtaa.py
# API_ENDPOINT = "http://data.beeldengeluid.nl/api/"
# SCHEME_ENDPOINT = "http://data.beeldengeluid.nl/gtaa/%s"
# SCHEMES = (
#     "GeografischeNamen",
#     "Geografisch",
#     "Namen",
#     "Persoonsnamen",
#     "OnderwerpenBenG",
#     "Onderwerpen",
#     "Maker",
#     "Makers", # This is a hack, see the code below
#     "Genre"
# )
# def _format_concept(concept):
# def _combined_iterator():
# def lookupcombined(q, qtype):
# def finditems(q, limit):
# def listcombined():
# def lookup(id_):


import util, requests, xmltodict, urllib.request, urllib.parse, urllib.error
from pyquery import PyQuery as pq
from commands.gtaa import gtaa
        else:
            return items

def _parse(item):
    # I <guess> the only useful stuff is in the first node, but then you might
    # never know!
    subject = item["rdf:RDF"]["swivt:Subject"][0]

    data = {
        "functions" : _pluck(subject, "property:HasFuncties", "#text"),
        "fullName" : _pluck(subject, "property:Has_FullName", "#text"),
        "birthDate" : _pluck(subject, "property:Has_Geboortedatum", "#text"),
        "birthPlace" : _pluck(subject, "property:Has_Geboorteplaats", "@rdf:resource"),
        "activePeriode" : _pluck(subject, "property:Has_PeriodeActief", "#text"),
        "activePeriodeEnd" : _pluck(subject, "property:Has_PeriodeActiefEind", "#text"),
        "activePeriodeStart" : _pluck(subject, "property:Has_PeriodeActiefStart", "#text"),
        "url" : _pluck(subject, "property:Has_URL", "@rdf:resource"),
        "knownFrom" : _pluck(subject, "property:IsBekendVan", "@rdf:resource"),
        "worksTogetherWith" : _pluck(subject, "property:WerktSamenMet", "@rdf:resource")
    }

    return data

def _lookuphref(href):
    # This is a little ugly
    href = href.replace("/index.php/", "")

    if "action=edit" in href:
        return False


# Path: commands/gtaa/gtaa.py
# API_ENDPOINT = "http://data.beeldengeluid.nl/api/"
# SCHEME_ENDPOINT = "http://data.beeldengeluid.nl/gtaa/%s"
# SCHEMES = (
#     "GeografischeNamen",
#     "Geografisch",
#     "Namen",
#     "Persoonsnamen",
#     "OnderwerpenBenG",
#     "Onderwerpen",
#     "Maker",
#     "Makers", # This is a hack, see the code below
#     "Genre"
# )
# def _format_concept(concept):
# def _combined_iterator():
# def lookupcombined(q, qtype):
# def finditems(q, limit):
# def listcombined():
# def lookup(id_):


# Path: commands/bengwiki/bengwiki.py
import util, requests, xmltodict, urllib.request, urllib.parse, urllib.error
from pyquery import PyQuery as pq
from commands.gtaa import gtaa

        else:
            return items

def _parse(item):
    # I <guess> the only useful stuff is in the first node, but then you might
    # never know!
    subject = item["rdf:RDF"]["swivt:Subject"][0]

    data = {
        "functions" : _pluck(subject, "property:HasFuncties", "#text"),
        "fullName" : _pluck(subject, "property:Has_FullName", "#text"),
        "birthDate" : _pluck(subject, "property:Has_Geboortedatum", "#text"),
        "birthPlace" : _pluck(subject, "property:Has_Geboorteplaats", "@rdf:resource"),
        "activePeriode" : _pluck(subject, "property:Has_PeriodeActief", "#text"),
        "activePeriodeEnd" : _pluck(subject, "property:Has_PeriodeActiefEind", "#text"),
        "activePeriodeStart" : _pluck(subject, "property:Has_PeriodeActiefStart", "#text"),
        "url" : _pluck(subject, "property:Has_URL", "@rdf:resource"),
        "knownFrom" : _pluck(subject, "property:IsBekendVan", "@rdf:resource"),
        "worksTogetherWith" : _pluck(subject, "property:WerktSamenMet", "@rdf:resource")
    }

    return data

def _lookuphref(href):
    # This is a little ugly
    href = href.replace("/index.php/", "")

    if "action=edit" in href:
        return False


    lookup = gtaa.lookupcombined(href, "bengwiki")