Skip to content

Instantly share code, notes, and snippets.

View raprasad's full-sized avatar

Raman Prasad raprasad

View GitHub Profile
@raprasad
raprasad / gist:fbea82705b999b7a6328254cb31de9cf
Last active April 6, 2016 21:17
Metadata Updates in Dataverse

Purpose

In preparing to add File Level metadata to Dataverse these are notes on several places where experience has shown that the API could be improved.

Adding an Email value to a Dataset's Metadata

Expected code (java)

@raprasad
raprasad / brd_fits_reference.md
Last active April 7, 2016 15:11
Dataverse "metadata" from a FITS file is currently stored in a general description field.

FITS file level metadata

  • Current (4/2016) handling of FITS metadata includes:

    • Extra information in the file description field which shows up on the cards
    • The addition of a FITS file tag
  • Reference document for the File level metadata BRD

Example FITS file

@raprasad
raprasad / test_unmanaged_models.md
Last active November 1, 2023 00:04
Ignoring migrations during Django testing (unmanaged databases, legacy databases, etc)

Scenario

  • Django 1.9 application with two databases:
    • Legacy database with readonly access via unmanaged models. Both Django models (models.py) and related migrations have "managed" set to False
      • 'managed': False
    • Default database holding django specific tables (e.g. auth_user, django_content_type, etc)

Testing Woes

@raprasad
raprasad / split_2290.md
Last active October 13, 2016 15:30
Splitting Ticket 2290 into API and UI sections

Notes for IQSS/dataverse#2290

File Replace

A. Remaining API tasks

1. Include ability to add a file description

  • In another release: add categories, tags, and/or restrictions
@raprasad
raprasad / add_installation.md
Last active October 12, 2016 20:21
Steps for adding a Dataverse installation to Dataverse.org
@raprasad
raprasad / potential_ingest_improvement.md
Last active October 18, 2016 16:09
Potential Ingest Improvement

@leonid_andreev :

Ingest thoughts for another release.

Current Scenario: User uploads files to dataset (before save)

Tracking lots of non-persisted objects

  • We currently create non-persisted DataFile and FileMetadata objects linked to a non-persisted DatasetVersion

glassfish

  • unpack glassfish 4.1 into new “dv_goodfish” directory
cd ~/Documents/dv_glassfish/
unzip glassfish-4.1.zip  
mv glassfish4 dv_goodfish2
@raprasad
raprasad / gson_to_json_bleh.md
Created October 26, 2016 20:10
GSON to JsonObjectBuilder
  • Go from a gsonObject object -> String -> jsonObjectBuilder
    public static JsonObjectBuilder convertGsonObjectToJsonObjectBuilder(String successMsg, JsonObject gsonObject) {
        JsonObjectBuilder jsonObjectBuilder = Json.createObjectBuilder();
        jsonObjectBuilder.add("message", successMsg);
        JsonReader jsonReader = Json.createReader(new StringReader(gsonObject.toString()));
        javax.json.JsonObject object = jsonReader.readObject();
 jsonObjectBuilder.add("files", object.get("files"));
@raprasad
raprasad / dv_to_map.md
Created November 1, 2016 17:07
Configure Dataverse for Mapping
INSERT into setting VALUES (':GeoconnectCreateEditMaps', 'true');
INSERT into setting VALUES (':GeoconnectViewMaps', 'true');
INSERT into setting VALUES (':GeoconnectDebug', 'true');
@raprasad
raprasad / json-2-schema-2-yaml.md
Last active December 7, 2016 19:35
JSON -> JSON Schema -> YAML