GithubHelp home page GithubHelp logo

camh's Introduction

Sample KO with FNO function metadata

Developed as part of the CAMH knowledge graph project

Overview

A KO is a digital package containing one of more computable readable files and/or executable functions along with other information. Here we will focus on KOs containing individual pure functions. Each pure function has inputs (a.k.a. parameters) and outputs (a.k.a. computed results). Each pure function also has one or more concrete implementations. Clients execute a function by sending inputs/parameters and receiving outputs/computed results.

Initially, the KGrid used only functions with implementations intended to be exposed as a RESTful API. Each function was described by an OpenAPI doc (we called them endpoints) and mapped to an implementation in YAML for deployment in a particulat runtime environment (via deployment.yaml).

The Function Ontology (FNO) is capable of describing functions at a higher level and is particularly suited for knowledge engineering. The Provenance Ontology provides a similar capability when describing processes in which agents perform activities which transform entities. Both ontologies are useful in modeling the behavior and results of knowledge objects deployed in the Knowledge Grid or elsewhere.

This repo contains a sample KO with an FNO representation of its functions and results, and instructions for using it in one or more RDF/graph systems.

Description of the KO jsonld document

This sample uses a JSON-LD document in flattened form (a top-level anonymous node containing an @context element and an @graph element whose value is an array of nodes.) We think it will work with an expanded or compacted forms but have not tested.

The @context element is something like this:

{
  "@context": {
    "dc": "http://purl.org/dc/elements/1.1/",
    "fno": "https://w3id.org/function/ontology#",
    "koio": "http://kgrid.org/koio#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "sdo": "http://www.schema.org/",
    "prov": "http://www.w3.org/ns/prov#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#"
  },
  "@graph": [{...}, ...]
}

The "@graph" elements defines the nodes in this sub-graph. It has this shape:

{
  "@context": {...},
  "@graph": [
    { "@type":  "fno:Function", ...},
    { "@type":  "fno:Execution", ...},
    { "@type":  "fno:Output", ...},
    { "@type":  "fno:Implementation", ...},
    { "@type":  "fno:Mapping", ...}
  ]
}

Deploying the KO graph

Adding the nodes represented by the JSON-LD document in this KO is somewhat platform dependent. Conult your platform documentation. Here's what worked for us in the following systems.

Inserting the KO subgraph into Blue Brain Nexus

Inserting the KO subgraph into Fedora Commons

Inserting the KO subgraph into neo4j

Adding sample data and querying

camh's People

Contributors

ajflynn avatar shreyakapoor26 avatar mradamgbeck avatar pboisver avatar

Watchers

James Cloos avatar  avatar Greg Farris avatar

Forkers

adeel-ansari

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.