Skip to content

Instantly share code, notes, and snippets.

@brownish
Last active April 12, 2017 17:30
Show Gist options
  • Save brownish/5c7885184b080a27117ab0a320d8558e to your computer and use it in GitHub Desktop.
Save brownish/5c7885184b080a27117ab0a320d8558e to your computer and use it in GitHub Desktop.
maid infrastructure

MnCHIP: MnCHIP test

Introduction

REPLACEME: Introductory text and domain model image.

5giAsjq

Setup

// ORGANIZATIONS
MERGE (osa:Organization {name: 'OSA'})
MERGE (miac:Organization {name: 'MIAC'})
MERGE (msu:Organization {name: 'MSU'})
MERGE (mnhpo:Organization {name: 'MnHPO'})

// PORTALS
MERGE (mnchip:Portal {name: 'MnCHIP'})
MERGE (maid:Portal {name: 'MAID'})
MERGE (osa_portal:Portal {name: 'OSA Portal'})
MERGE (mnhpo_portal:Portal {name: 'MnHPO Portal'})

//DATABASES
MERGE (maid_db:Database {name: 'MAID Database'})
MERGE (osa_db:Database {name: 'OSA Sites Database'})
MERGE (miac_db:Database {name: 'MIAC Burials Database'})
MERGE (mnhpo_db:Database {name: 'MnHPO Database'})

// ENTITY TYPES
MERGE (sites:Entity_Type {name: 'Sites'})
MERGE (burials:Entity_Type {name: 'Burials'})
MERGE (structures:Entity_Type {name: 'Structures'})
MERGE (artifacts:Entity_Type {name: 'Artifacts'})
MERGE (projects:Entity_Type {name: 'Projects'})
MERGE (provenience_units:Entity_Type {name: 'Provenience Units'})
MERGE (organizations:Entity_Type {name: 'Organizations'})
MERGE (repositories:Entity_Type {name: 'Repositories'})
MERGE (collections:Entity_Type {name: 'Collections'})

// MNCHIP PARTS
MERGE (osa_portal)-[:PART_OF]->(mnchip)
MERGE (mnhpo_portal)-[:PART_OF]->(mnchip)
MERGE (maid)-[:PART_OF]->(mnchip)

// PORTAL DATA
MERGE (osa_portal)-[:RETRIEVES_DATA_FROM]->(osa_db)
MERGE (osa_portal)-[:RETRIEVES_DATA_FROM]->(miac_db)
MERGE (mnhpo_portal)-[:RETRIEVES_DATA_FROM]->(mnhpo_db)
MERGE (maid)-[:RETRIEVES_DATA_FROM]->(maid_db)

// DATABASE CONTROL
MERGE (osa_db)-[:CONTROLLED_BY]->(osa)
MERGE (miac_db)-[:CONTROLLED_BY]->(miac)
MERGE (mnhpo_db)-[:CONTROLLED_BY]->(mnhpo)
MERGE (maid_db)-[:CONTROLLED_BY]->(msu)

// DATABASE CONTENTS
MERGE (osa_db)-[:CONTAINS]->(sites)
MERGE (miac_db)-[:CONTAINS]->(burials)
MERGE (mnhpo_db)-[:CONTAINS]->(structures)
MERGE (maid_db)-[:CONTAINS]->(artifacts)
MERGE (maid_db)-[:CONTAINS]->(projects)
MERGE (maid_db)-[:CONTAINS]->(provenience_units)

// ENTITY TYPE RELATIONS
MERGE (repositories)-[:BELONG_TO]->(organizations)
MERGE (collections)-[:BELONG_TO]->(repositories)
MERGE (artifacts)-[:BELONG_TO]->(collections)
MERGE (projects)-[:CONDUCTED_BY]->(organizations)
MERGE (artifacts)-[:CAN_BELONG_TO]->(provenience_units)
MERGE (provenience_units)-[:RECORDED_DURING]->(projects)
MERGE (provenience_units)-[:UPDATED_DURING]->(projects)

MnCHIP: Infrastructure

MATCH (a)
RETURN a

Interconnected Databases

match (portal:Portal)-[:PART_OF]->(mnchip:Portal)
optional match (portal:Portal)-[:RETRIEVES_DATA_FROM]->(db:Database)-[:CONTROLLED_BY]->(org:Organization)
  return portal, org, db, mnchip

Browser-to-Server Flow

MERGE (maid_db:Database {name: 'MAID Database'})
MERGE (osa_db:Database {name: 'OSA Sites Database'})
MERGE (browser:Browser {name: 'Browser'})
MERGE (osa_api:API {name: 'OSA API'})
MERGE (maid_api:API {name: 'MAID API'})

// website request
MERGE (browser)-[browser_to_osa_api:REQUESTS_DATA_FROM]->(osa_api)
MERGE (osa_api)-[:RETRIEVES_DATA_FROM]->(osa_db)
MERGE (osa_api)-[:REQUESTS_DATA_FROM]->(maid_api)
MERGE (maid_api)-[:RETRIEVES_DATA_FROM]->(maid_db)

MERGE (browser)-[browser_requests_site_from_osa:REQUESTS_21GD0003]->(osa_api)
MERGE (osa_api)-[osa_api_retrieves_site_from_osa_db:RETRIEVES_21GD0003_FROM]->(osa_db)
MERGE (osa_api)-[osa_api_requests_artifacts_from_maid_api:REQUESTS_21GD0003_ARTIFACTS]->(maid_api)
MERGE (maid_api)-[maid_api_retrieves_artifacts_from_maid_db:RETRIEVES_21GD0003_ARTIFACTS_FROM]->(maid_db)
return browser, osa_api, osa_db, maid_api, maid_db,
  browser_requests_site_from_osa, osa_api_retrieves_site_from_osa_db,
  osa_api_requests_artifacts_from_maid_api, maid_api_retrieves_artifacts_from_maid_db

Conclusions

REPLACEME: Offer a conclusion

Resources

REPLACEME: Link to resorces like data sources, further discussions,


Created by Andrew Brown - Twitter | Blog | LinkedIn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment