Skip to content

Commit

Permalink
Merge branch 'v2docs' into 378-gaffer-documentation-restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
l46978 committed Sep 13, 2023
2 parents 0dcd568 + 45e4b3f commit ef724d0
Show file tree
Hide file tree
Showing 4 changed files with 457 additions and 8 deletions.
11 changes: 6 additions & 5 deletions docs/development-guide/example-deployment/writing-the-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ In Gaffer an element refers to any object in the graph, i.e. your nodes (vertexe
up a graph we need to tell Gaffer what objects are in the graph and the properties they have. The
standard way to do this is a JSON config file in the schema directory. The filename can just be
called something like `elements.json`, the name is not special as all files under the `schema`
directory will be merged into a master schema but its still recommended to use an appropriate name.
directory will be [merged into a master schema](../advanced-guide/schema.md), but we recommended
using an appropriate name.

As covered in the [Getting Started Schema page](../../user-guide/schema.md), to write a schema you can see that there are some
required fields, but largely a schema is highly specific to your input data.

Starting with the `entities` from the example, we can see there will be two distinct types of nodes
in the graph; one representing a `Person` and another for `Software`. These can be added into the
schema to give something like the the following:
schema to give something like the following:

!!! info ""

Expand All @@ -57,7 +58,7 @@ schema to give something like the the following:

From the basic schema you can see that we have added two entity types for the graph. For now, each
`entity` just contains a short description and a type associated to the `vertex` key. The type here
is just a place holder but it has been named appropriately as it's assumed that we will just use the
is just a placeholder, but it has been named appropriately as it's assumed that we will just use the
string representation of the node's id (this will be defined in the `types.json` later in the
guide).

Expand Down Expand Up @@ -146,8 +147,8 @@ extended schema below.

## Types Schema

The other schema that now needs to be written is the types schema. As you have seen in the elements
schema there are some place holder types added as the values for many of the keys. These types work
The other schema that now needs to be written is the types [schema](../advanced-guide/schema.md). As you have seen in the elements
schema there are some placeholder types added as the values for many of the keys. These types work
similarly to if you have ever programmed in a strongly typed language, they are essentially the
wrapper for the value to encapsulate it.

Expand Down
24 changes: 21 additions & 3 deletions docs/development-guide/project-structure/components/graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,41 @@ It provides users with a single point of entry for executing operations on a sto

When you instantiate a `Graph`, this doesn't mean you are creating an entirely new graph with its own data, you are simply creating a connection to a store where some data is held.

See the [Graph Javadoc](https://gchq.github.io/Gaffer/uk/gov/gchq/gaffer/graph/package-summary.html) for further documentation.

## Creating a Graph

To create an instance of `Graph`, we recommend you use the `Graph.Builder` class. This has several helpful methods to create the graph from various different sources.
But, essentially a graph requires just 3 things: some store properties, a schema and some graph specific configuration.
Most of the time, a graph requires just 3 things: some store properties, a schema and some graph specific configuration.

See the [Graph Javadoc](https://gchq.github.io/Gaffer/uk/gov/gchq/gaffer/graph/package-summary.html) for further documentation.
An example of creating a basic `Graph` object:

```java
Graph graph = new Graph.Builder()
.config(new GraphConfig.Builder()
.graphId("uniqueNameOfYourGraph")
.build())
.addSchemas(schemas)
.storeProperties(storeProperties)
.build();
```

Instead of a store properties, a store can be passed in directly. This is the easiest way to configure schema-less stores (Proxy and Federated Stores) using Java. See the [Java section of the Proxy Store reference page for an example](../../reference/stores-guide/proxy.md#using-a-proxystore-from-java). Using a Proxy Store will allow for connecting to an existing remote graph through Java, without needing to use the REST API or JSON directly.

## Store Properties
The store properties tells the graph the type of store to connect to along with any required connection details. See the [Stores](../../../administration-guide/gaffer-stores/store-guide.md) reference page for more information on the different Stores for Gaffer.

## Schema
The schema is passed to the store to instruct the store how to store and process the data. See [Schemas](https://gchq.github.io/gaffer-doc/v1docs/getting-started/developer-guide/schemas.html) for more information - v1 docs, to be updated and added to this documentation in future.
The schema is passed to the store to instruct the store how to store and process the data.
See [Schemas](../../getting-started/advanced-guide/schema.md) for detailed information on schemas and the [Java API section of that page](../../getting-started/advanced-guide/schema.md#java-api) for lower level info.

## Graph Configuration
The graph configuration allows you to apply special customisations to the Graph instance. The only required field is the `graphId`.

To create an instance of `GraphConfig` you can use the `GraphConfig.Builder` class, or create it using a json file.

The `GraphConfig` can be configured with the following:

- `graphId` - The `graphId` is a String field that uniquely identifies a `Graph`. When backed by a Store like Accumulo, this `graphId` is used as the name of the Accumulo table for the `Graph`.
- `description` - a string describing the `Graph`.
- `view` - The `Graph View` allows a graph to be configured to only returned a subset of Elements when any Operation is executed. For example if you want your `Graph` to only show data that has a count more than 10 you could add a View to every operation you execute, or you can use this `Graph View` to apply the filter once and it would be merged into to all Operation Views so users only ever see this particular view of the data.
Expand Down
Empty file added docs/getting-started/basics.md
Empty file.
Loading

0 comments on commit ef724d0

Please sign in to comment.