nodestream-plugin-meta


Namenodestream-plugin-meta JSON
Version 0.13.0 PyPI version JSON
download
home_pagehttps://github.com/nodestream-proj/nodestream
SummaryA plugin to nodestream for building a graph of the schema of the graph.
upload_time2024-11-19 14:12:28
maintainerNone
docs_urlNone
authorZach Probst
requires_python<4.0,>=3.10
licenseApache 2.0
keywords etl neo4j declarative data kafka ingest nodestream
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Nodestream Meta Plugin

This plugin allows you to build a Graph of your Graph's Schema.

## Installation

```bash
pip install nodestream-plugin-meta
```

## Meta-Schema

The schema of the graph schema is as follows:

![Meta Schema](meta.png)

For extra meta characteristics, the schema of the schema schema is also added to the projects schema like any other pipeline.
In other words, the types `NodeType`, `Property`, and so on are added to the schema of the graph. 

## Getting Started

Unlike other schema plugins, this plugin uses the ingestion system to build the metagraph in your graph. 
That means that you need to build a pipeline to do the ingestion.
For the simple case, you can build a single step pipeline that looks like this:

```yaml
- implementation: nodestream_plugin_meta:SchemaRenderer
```

This will locate the project file located inside the current working directory (or its parent directories) and 
render the schema to the graph. You can also specify the path to the project file:

```yaml
- implementation: nodestream_plugin_meta:SchemaRenderer
  parameters:
    project_path: /path/to/nodestream.yaml
```

You may also specify an overrides file to enrich the inferred schema:

```yaml
- implementation: nodestream_plugin_meta:SchemaRenderer
  parameters:
    project_path: /path/to/nodestream.yaml
    overrides_path: /path/to/overrides.yaml
```

The overrides file should look like this:

```yaml
nodes:
  - name: Person
    properties:
      is_cool:
        type: BOOLEAN
relations:
  - name: Knows
    properties:
      since:
        type: DATE
```

The file is merged with the inferred schema, so you can add new nodes, relations, or properties, or override parts of existing ones.

## Querying the Meta Graph

The meta graph can be queried like any other graph data. 
For example, to get all the node types in the graph:

```cypher
MATCH (n:NodeType) RETURN n.name
```

Or to get all the properties of a node type:

```cypher
MATCH (n:NodeType {name: 'Person'})-[:HAS_PROPERTY]->(p:Property) RETURN p.name, p.type, p.is_key
```

Same goes for relations and their properties:

```cypher
MATCH (r:RelationshipType {name: 'Knows'})-[:HAS_PROPERTY]->(p:Property) RETURN p.name, p.type, p.is_key
```

Also you can get the adjacencies the graph schema:

```cypher
MATCH (a:NodeType)<-[:TO|FROM]-(adj:Adjacency)-[:TO|FROM]->(b:NodeType)
MATCH (adj)-[:THROUGH]->(r:RelationshipType)
RETURN a.name, r.name, b.name
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nodestream-proj/nodestream",
    "name": "nodestream-plugin-meta",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "etl, neo4j, declarative, data, kafka, ingest, nodestream",
    "author": "Zach Probst",
    "author_email": "Zach_Probst@intuit.com",
    "download_url": "https://files.pythonhosted.org/packages/34/61/9e37d1d3277102aa0d9c48c9c4989582b7f25e50095672de58103d5e5cb1/nodestream_plugin_meta-0.13.0.tar.gz",
    "platform": null,
    "description": "# Nodestream Meta Plugin\n\nThis plugin allows you to build a Graph of your Graph's Schema.\n\n## Installation\n\n```bash\npip install nodestream-plugin-meta\n```\n\n## Meta-Schema\n\nThe schema of the graph schema is as follows:\n\n![Meta Schema](meta.png)\n\nFor extra meta characteristics, the schema of the schema schema is also added to the projects schema like any other pipeline.\nIn other words, the types `NodeType`, `Property`, and so on are added to the schema of the graph. \n\n## Getting Started\n\nUnlike other schema plugins, this plugin uses the ingestion system to build the metagraph in your graph. \nThat means that you need to build a pipeline to do the ingestion.\nFor the simple case, you can build a single step pipeline that looks like this:\n\n```yaml\n- implementation: nodestream_plugin_meta:SchemaRenderer\n```\n\nThis will locate the project file located inside the current working directory (or its parent directories) and \nrender the schema to the graph. You can also specify the path to the project file:\n\n```yaml\n- implementation: nodestream_plugin_meta:SchemaRenderer\n  parameters:\n    project_path: /path/to/nodestream.yaml\n```\n\nYou may also specify an overrides file to enrich the inferred schema:\n\n```yaml\n- implementation: nodestream_plugin_meta:SchemaRenderer\n  parameters:\n    project_path: /path/to/nodestream.yaml\n    overrides_path: /path/to/overrides.yaml\n```\n\nThe overrides file should look like this:\n\n```yaml\nnodes:\n  - name: Person\n    properties:\n      is_cool:\n        type: BOOLEAN\nrelations:\n  - name: Knows\n    properties:\n      since:\n        type: DATE\n```\n\nThe file is merged with the inferred schema, so you can add new nodes, relations, or properties, or override parts of existing ones.\n\n## Querying the Meta Graph\n\nThe meta graph can be queried like any other graph data. \nFor example, to get all the node types in the graph:\n\n```cypher\nMATCH (n:NodeType) RETURN n.name\n```\n\nOr to get all the properties of a node type:\n\n```cypher\nMATCH (n:NodeType {name: 'Person'})-[:HAS_PROPERTY]->(p:Property) RETURN p.name, p.type, p.is_key\n```\n\nSame goes for relations and their properties:\n\n```cypher\nMATCH (r:RelationshipType {name: 'Knows'})-[:HAS_PROPERTY]->(p:Property) RETURN p.name, p.type, p.is_key\n```\n\nAlso you can get the adjacencies the graph schema:\n\n```cypher\nMATCH (a:NodeType)<-[:TO|FROM]-(adj:Adjacency)-[:TO|FROM]->(b:NodeType)\nMATCH (adj)-[:THROUGH]->(r:RelationshipType)\nRETURN a.name, r.name, b.name\n```\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "A plugin to nodestream for building a graph of the schema of the graph.",
    "version": "0.13.0",
    "project_urls": {
        "Documentation": "https://nodestream-proj.github.io/nodestream-plugin-meta",
        "Homepage": "https://github.com/nodestream-proj/nodestream",
        "Repository": "https://github.com/nodestream-proj/nodestream-plugin-meta"
    },
    "split_keywords": [
        "etl",
        " neo4j",
        " declarative",
        " data",
        " kafka",
        " ingest",
        " nodestream"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ddc5ab66917a05ee6f023643ce2ab287ef98ca80ace1034493ca44ed97be1561",
                "md5": "e46f315a6d648d1157614adaa0940dc8",
                "sha256": "85a53efd2dd26d69278712b36a2013644f5b7dcfcc81ab95dada454bd3cb4edf"
            },
            "downloads": -1,
            "filename": "nodestream_plugin_meta-0.13.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e46f315a6d648d1157614adaa0940dc8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 8445,
            "upload_time": "2024-11-19T14:12:26",
            "upload_time_iso_8601": "2024-11-19T14:12:26.827278Z",
            "url": "https://files.pythonhosted.org/packages/dd/c5/ab66917a05ee6f023643ce2ab287ef98ca80ace1034493ca44ed97be1561/nodestream_plugin_meta-0.13.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34619e37d1d3277102aa0d9c48c9c4989582b7f25e50095672de58103d5e5cb1",
                "md5": "f1185f1f2ac5474b10e0cd187270efd4",
                "sha256": "c31f17857e2cfebcfe6353d73ebcd3562110787b6be79459ce9dc9a740daf375"
            },
            "downloads": -1,
            "filename": "nodestream_plugin_meta-0.13.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f1185f1f2ac5474b10e0cd187270efd4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 7516,
            "upload_time": "2024-11-19T14:12:28",
            "upload_time_iso_8601": "2024-11-19T14:12:28.360181Z",
            "url": "https://files.pythonhosted.org/packages/34/61/9e37d1d3277102aa0d9c48c9c4989582b7f25e50095672de58103d5e5cb1/nodestream_plugin_meta-0.13.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-19 14:12:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nodestream-proj",
    "github_project": "nodestream",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "nodestream-plugin-meta"
}
        
Elapsed time: 0.45387s