-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sub-Graph Packs: data model extensibility
Related to: #2 #4 Signed-off-by: Matt Young <[email protected]>
- Loading branch information
1 parent
afb0977
commit 4dccc8b
Showing
23 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,116 @@ | ||
# Graph Data Model | ||
|
||
## Core Data Model | ||
|
||
![core-png](core/generated/landscape-graph-core.png) | ||
|
||
### Entities | ||
|
||
ctx->allTheThings.ToMarkdown(); | ||
|
||
## Sub-Graph Packs (SGP) | ||
|
||
Each pack will have the following: | ||
|
||
* GraphQL Schema, deriving from the base type. | ||
* png, svg, .json (arrows.app :)) | ||
* Description / Documentation covering entities | ||
|
||
```shell | ||
. | ||
├── blogs | ||
│ └── sgp-blogcncf | ||
├── boards | ||
│ ├── sgp-ghdiscuss | ||
│ └── sgp-stackoverflow | ||
├── core | ||
│ └── generated | ||
├── corp | ||
│ ├── sgp-crunchbase | ||
│ └── sgp-yahoofinance | ||
├── packages | ||
│ ├── sgp-brew | ||
│ ├── sgp-choco | ||
│ ├── sgp-crate | ||
│ ├── sgp-deb | ||
│ ├── sgp-deno | ||
│ ├── sgp-go | ||
│ ├── sgp-maven | ||
│ ├── sgp-npm | ||
│ ├── sgp-pip | ||
│ └── sgp-rpm | ||
├── rtc | ||
│ ├── sgp-discord | ||
│ └── sgp-slack | ||
├── social | ||
│ ├── sgp-linkedin | ||
│ └── sgp-twitter | ||
├── threats | ||
│ └── sgp-nist | ||
└── videos | ||
└── sgp-youtube | ||
|
||
``` | ||
|
||
## How Interfaces Work | ||
|
||
https://neo4j.com/docs/graphql-manual/current/type-definitions/interfaces/#_directive_inheritance | ||
|
||
> Any directives present on an interface or its fields will be "inherited" by any object types implementing it. For example, the type definitions above could be refactored to have the @relationship directive on the actors field in the Production interface instead of on each implementing type as it is currently: | ||
```graphql | ||
interface Production { | ||
title: String! | ||
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") | ||
} | ||
|
||
type Movie implements Production { | ||
title: String! | ||
actors: [Actor!]! | ||
runtime: Int! | ||
} | ||
|
||
type Series implements Production { | ||
title: String! | ||
actors: [Actor!]! | ||
episodes: Int! | ||
} | ||
|
||
interface ActedIn @relationshipProperties { | ||
role: String! | ||
} | ||
|
||
type Actor { | ||
name: String! | ||
actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") | ||
} | ||
``` | ||
|
||
<https://neo4j.com/docs/graphql-manual/current/type-definitions/interfaces/#_overriding> | ||
|
||
> In addition to inheritance, directives can be overridden on a per-implementation basis. Say you had an interface defining some Content, with some basic authorization rules: | ||
|
||
```graphql | ||
interface Content | ||
@auth(rules: [{ operations: [CREATE, UPDATE, DELETE], allow: { author: { username: "$jwt.sub" } } }]) { | ||
title: String! | ||
author: [Author!]! @relationship(type: "HAS_CONTENT", direction: IN) | ||
} | ||
|
||
type User { | ||
username: String! | ||
content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT) | ||
} | ||
|
||
type PublicContent implements Content { | ||
title: String! | ||
author: [Author!]! | ||
} | ||
|
||
type PrivateContent implements Content | ||
@auth(rules: [{ operations: [CREATE, READ, UPDATE, DELETE], allow: { author: { username: "$jwt.sub" } } }]) { | ||
title: String! | ||
author: [Author!]! | ||
} | ||
``` |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sgp-discord |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sgp-slack |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Sub-Graph Pack: sgp-nist | ||
|
||
https://www.cve.org | ||
https://github.com/CVEProject/cve-schema | ||
https://www.cve.org/ResourcesSupport/Glossary?activeTerm=glossaryRecord | ||
https://www.cve.org/About/Process#CVERecordLifecycle | ||
|
||
|
||
https://nvd.nist.gov/products/nvd | ||
https://nvd.nist.gov/products/cpe | ||
https://nvd.nist.gov/vuln/vulnerability-detail-pages | ||
https://nvd.nist.gov/vuln/vulnerability-status | ||
https://www.cvedetails.com/ | ||
|
||
https://www.cve.org/Media/News/item/news/2022/01/11/Changes-Coming-to-CVE-Record | ||
https://www.cve.org/Media/News/item/podcast/2021/07/13/How-the-New-CVE-Record | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# sgp-youtube |