Giter Site home page Giter Site logo

golr-loader's Introduction

Build Status

golr-loader

Convert SciGraph query results into JSON that can be loaded by a Golr instance.

Example

golr-loader applies conventions to a Cypher execution result and produces Golr loadable JSON facilitating the creation of "Golr quads":

  • node ID
  • node ID closure
  • node rdfs:label
  • node rdfs:label closure

Processing resolves around the Cypher RETURN clause.

  • Literals are mapped directly to JSON literals with the same name as the Cypher projection
  • Nodes are mapped to Golr quads with the same root name as the Cypher projection
  • Relationships are resolved to their object property nodes and mapped to Golr quads
  • Paths are combined with any property container above to produce "evidence" which is then stored as a Golr quad and materialized as a JSON graph

By default golr-load traverses rdf:type and rdf:subClassOf when calculating closures.

The executable JAR produced by mvn package takes the following arguments:

  • The location of SciGraph YAML file
  • The location of a golr-loader query YAML file
  • An optional location to save the generated JSON
  • An optional Solr server to POST the generated JSON

Here's an example configuration:

query: |
        MATCH path = (subject:gene)-[relation:RO_HOM0000001!]-(object:gene) 
        RETURN path, 
        subject, object, relation, 
        'gene' AS subject_category, 'gene' AS object_category, 'direct' AS qualifier
  

which results in the following JSON structure:

[
    {
        "evidence": [
            "MONARCH:b0246c04ec0245c5c32e88f79dea1b8b"
        ],
        "evidence_closure": [
            "MONARCH:b0246c04ec0245c5c32e88f79dea1b8b",
            "Annotation:"
        ],
        "evidence_closure_label": [
            "MONARCH:b0246c04ec0245c5c32e88f79dea1b8b",
            "Annotation:"
        ],
        "evidence_graph": "", // Omitted for brevity
        "evidence_label": [
            ""
        ],
        "object": "ENSEMBL:ENSG00000183304",
        "object_category": "gene",
        "object_closure": [
            "ENSEMBL:ENSG00000183304"
        ],
        "object_closure_label": [
            "ENSEMBL:ENSG00000183304"
        ],
        "object_label": "",
        "qualifier": "direct",
        "relation": "RO:HOM0000017",
        "relation_closure": [
            "RO:HOM0000017",
            "RO:HOM0000007",
            "RO:HOM0000001",
            "RO:HOM0000000",
            "RO:0002158",
            "RO:0002320"
        ],
        "relation_closure_label": [
            "in orthology relationship with",
            "in historical homology relationship with",
            "in homology relationship with",
            "in similarity relationship with",
            "shares ancestor with",
            "evolutionarily related to"
        ],
        "relation_label": "in orthology relationship with",
        "subject": "ENSEMBL:ENSMUSG00000096881",
        "subject_category": "gene",
        "subject_closure": [
            "ENSEMBL:ENSMUSG00000096881"
        ],
        "subject_closure_label": [
            "ENSEMBL:ENSMUSG00000096881"
        ],
        "subject_label": ""
    }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.