A discovery tool for milli.link

prasoon ed63aa0f6b bulk upload. bug fixes 1 week ago
app ed63aa0f6b bulk upload. bug fixes 1 week ago
conf 3bd4e36701 bulk upload with crosswalk. first pass 1 week ago
gradle d34a0a17a7 initial commit 11 months ago
project 8003927636 auth first-pass. breaking changes 3 weeks ago
public d34a0a17a7 initial commit 11 months ago
test d34a0a17a7 initial commit 11 months ago
.gitignore 3bd4e36701 bulk upload with crosswalk. first pass 1 week ago
LICENSE.md d34a0a17a7 initial commit 11 months ago
README.md e7deab683a readme updated 3 weeks ago
\ be96b628c0 bug fixes 1 month ago
build.gradle d34a0a17a7 initial commit 11 months ago
build.sbt 3bd4e36701 bulk upload with crosswalk. first pass 1 week ago
gradlew d34a0a17a7 initial commit 11 months ago
gradlew.bat d34a0a17a7 initial commit 11 months ago

README.md

niosx

Discovery tool for milli

Archival backend providing core set of APIs and administrative pages.

Running the project locally

Using Docker (recommended for a quick test and/or deployment)

The application needs the JanusGraph backend up and running:

(The docker-compose-test.yaml can be found in /path/to/niosx/conf directory.)

$ docker-compose -f conf/docker-compose-test.yaml up

Tip: Ensure that you set a sufficiently large value for vm.max_map_count in your /etc/sysctl.conf file.

Once the JanusGraph is up and running, pull and run the niosx docker image:

$ docker run --name milli-test -e APPLICATION_SECRET=$APPLICATION_SECRET -p 9000:9000 milliarchives/niosx:1.0-SNAPSHOT

The above command requires you to provide an APPLICATION_SECRET

Using sbt

To run the project locally, you must have sbt installed (version 1.0+). cd into the root of the project and execute sbt run. This would start an sbt shell and run the project on the default port. From here on, you can play with the application using GraphiQL or any other GraphQL compliant application (or by simply using cUrl).

GraphQl API usage

Please explore the graphQl schema for detailed usage. Here are a few sample queries and their responses:

##############
# Example 1. #
##############
mutation {
 addEntity(niosxEntityInput: {
   agencyCode : "Awesome agency!",
   recordId : "http://awesomeness/1",
   unitId : "1",
   title : "Testing entity insert",
   creator : "superglue",
   dateOfCreation : "4-4-2020",
   extent : "4 boxes filled with glue",
   level : "item"
 }){graphId, title, level}
}

###############
# Response 1. #
###############
{
  "data": {
    "addEntity": {
      "graphId": "103e53fc-2fb7-48b0-b5ed-917c5280fba9",
      "agencyCode": "Awesome agency!",
      "title": "Testing entity insert",
      "level": "item",
      "annotations": []
      }
    }
}
##############
# Example 2. #
##############
query {
  findEntity(id : "103e53fc-2fb7-48b0-b5ed-917c5280fba9"){
    graphId, agencyCode, title, level,
    annotations{
      graphId, 
      id,
      body{... on textualBody{value}}
    }
  }
}

###############
# Response 2. #
###############
{
  "data": {
    "findEntity": {
      "graphId": "103e53fc-2fb7-48b0-b5ed-917c5280fba9",
      "agencyCode": "Awesome agency!",
      "title": "Testing entity insert",
      "level": "item",
      "annotations": [
        {
          "graphId": "81be92c1-a370-4ac5-8b72-5a0ba6780efb",
          "id": "https://baseUri/81be92c1-a370-4ac5-8b72-5a0ba6780efb",
          "body": [
            {
              "value": "This is a comment which is just an annotation!"
            }
          ]
        },
        {
          "graphId": "1e71dadb-479c-4aa6-8538-78582c0239b1",
          "id": "https://baseUri/1e71dadb-479c-4aa6-8538-78582c0239b1",
          "body": [
            {
              "value": "Second great comment!"
            }
          ]
        }
      ]
    }
  }
}

The complete schema can be generated by issuing a GET request to the endpoint /graphql-schema.

Contribution | Collaboration

Please reach out to prasoon [at] disroot [dot] org

Caution

This project is under active development and is bound to change rapidly.