Example #1
0
def create_ark(creator, title, created, test):
    print("Creating ARK")
    if test:
        print("Using test EZID namespace")
        client = EZIDClient(app.config["TEST_EZID_SERVER"],
                            app.config["TEST_EZID_USERNAME"],
                            app.config["TEST_EZID_PASSWORD"],
                            app.config["TEST_EZID_SCHEME"],
                            app.config["TEST_EZID_SHOULDER"])
    else:
        client = EZIDClient(app.config["EZID_SERVER"],
                            app.config["EZID_USERNAME"],
                            app.config["EZID_PASSWORD"],
                            app.config["EZID_SCHEME"],
                            app.config["EZID_SHOULDER"])

    if title is None:
        title = ""
    #data = {"erc.who" : creator, "erc.what" : title, "erc.when" : str(created)}
    data = {
        "_profile": "datacite",
        "datacite.creator": creator,
        "datacite.title": title,
        "datacite.publicationyear": str(created.year),
        "datacite.publisher": "BD2K Minid"
    }  #, "datacite.resourcetype" : "dataset"}

    response = client.mint_identifier(data)
    print("minted %s" % app.config["HOSTNAME"])
    data["_target"] = "%s/%s" % (app.config["LANDING_PAGE"],
                                 response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]
Example #2
0
def create_ark(creator, title, created, test):
    print "Creating ARK"
    if test:
        print "Using test EZID namespace"
        client = EZIDClient(app.config["TEST_EZID_SERVER"],
            app.config["TEST_EZID_USERNAME"],
            app.config["TEST_EZID_PASSWORD"],
            app.config["TEST_EZID_SCHEME"],
            app.config["TEST_EZID_SHOULDER"])
    else:
        client = EZIDClient(app.config["EZID_SERVER"], 
            app.config["EZID_USERNAME"], 
            app.config["EZID_PASSWORD"], 
            app.config["EZID_SCHEME"], 
            app.config["EZID_SHOULDER"])
   
    if title is None: 
        title = ""
    #data = {"erc.who" : creator, "erc.what" : title, "erc.when" : str(created)} 
    data= {"_profile" : "datacite", "datacite.creator" : creator, "datacite.title" :  title, 
            "datacite.publicationyear" : str(created.year),
            "datacite.publisher": "BD2K Minid"}#, "datacite.resourcetype" : "dataset"}
   
    response = client.mint_identifier(data)
    print "minted %s" % app.config["HOSTNAME"] 
    data ["_target"] = "%s/%s" % (app.config["LANDING_PAGE"], response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]
Example #3
0
def create_ark(creator, created, title):
    print "Creating ARK"
    client = EZIDClient(app.config["EZID_SERVER"], app.config["EZID_USERNAME"],
                        app.config["EZID_PASSWORD"], app.config["EZID_SCHEME"],
                        app.config["EZID_SHOULDER"])

    data = {"erc.who": creator, "erc.what": title, "erc.when": created}

    response = client.mint_identifier(data)
    print "minted %s" % app.config["HOSTNAME"]
    data["_target"] = "%s/%s" % (app.config["LANDING_PAGE"],
                                 response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]
Example #4
0
def create_ark(creator, created, title):
    print "Creating ARK"
    client = EZIDClient(app.config["EZID_SERVER"], 
            app.config["EZID_USERNAME"], 
            app.config["EZID_PASSWORD"], 
            app.config["EZID_SCHEME"], 
            app.config["EZID_SHOULDER"])
    
    data = {"erc.who" : creator, "erc.what" : title, "erc.when" : created }

    response = client.mint_identifier(data)
    print "minted %s" % app.config["HOSTNAME"] 
    data ["_target"] = "%s/%s" % (app.config["LANDING_PAGE"], response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]