Skip to content

Commit

Permalink
Merge pull request #752 from mandy-chessell/dev-dojo
Browse files Browse the repository at this point in the history
Add descriptions of JanusGrpah storage backends
  • Loading branch information
mandy-chessell authored May 2, 2023
2 parents 6633f00 + 58d8bc9 commit 19fce03
Showing 1 changed file with 14 additions and 32 deletions.
46 changes: 14 additions & 32 deletions site/docs/connectors/repository/janus-graph/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,31 @@
- Jar File Name: `graph-repository-connector.jar`
- ConnectorProviderClassName: `org.odpi.openmetadata.adapters.repositoryservices.graphrepository.repositoryconnector/GraphOMRSRepositoryConnectorProvider.java`

The Graph Repository provides a local repository that uses a graph store as its persistence store.
The Graph Repository provides a local repository for a [Metadata Access Store](/concepts/metadata-access-store) that uses JanusGraph as its persistence store.

## Configuration
To configure a [Metadata Access Store](/concepts/metadata-access-store) to use the Graph Repository, set the repository-mode to 'local-graph-repository'. For example:

To configure a Metadata Access Store to use the Graph Repository, set the repository-mode to 'local-graph-repository'. For example:

```
POST <serverURLRoot>/open-metadata/admin-services/users/<userName>/servers/<serverName>/local-repository/mode/local-graph-repository
POST {platformURLRoot}/open-metadata/admin-services/users/{userName}/servers/{serverName}/local-repository/mode/local-graph-repository
```

Replace the <serverURLRoot>, <userName> and <serverName> with the values appropriate for the server you are configuring.

## Using the Graph Repository
The interface to the graph repository is the OMRS MetadataCollection API. The graph repository supports almost all of the MetadataCollection API apart from historical queries and undo.

## Using the find methods
The find methods (listed below) use regular expression (regexp) syntax. They are intended for retrieval of specific entities or relationships and the regexp is always matched to the whole of the property value or classification name.
* findEntitiesByProperty()
* findRelationshipsByProperty()
* findEntitiesByPropertyValue()
* findRelationshipsByPropertyValue()
* findEntitiesByClassification()

The first two methods accept a map of property names and values that acts as a filter.
The next pair of methods accept a string that is matched against the values of any string properties.
The last method accepts a string that is matched against the names of classifications associated with an entity.

In all cases the string value(s) provided are treated as a regular expression that is matched against the whole property value or classification name.

To find entities with property values of "coco-asset-123", "coco-asset-456", "coco-asset-789" you could specify a regexp e.g. "coco-asset-.*"

To find an entity or relationship with a property value of "coco-asset-123" you need to specify a regexp that will match the whole string value, e.g. "coco-asset-.*", a substring is not sufficient. If you were to only specify a regexp of "coco-asset", it would not match the entity or relationship.

Similarly, to find an entity with a classification with name "coco-classification-abc" you would need to to specify a regexp that will match the whole string value, e.g. "coco-classification-.*"
Replace the *{serverURLRoot}*, *{userName}* and *{serverName}* with the values appropriate for the server you are configuring.

The request body is optional and set to a map of property names to property values that specify the storage properties that JanusGraph is to use. If the storage properties are null, the following properties are used:

## Under the hood
Internally, the Graph Repository uses JanusGraph to create a graph database. The JanusGraph graph database and graph are automatically created and the graph schema and search indexes are automatically configured.
| Property name | Property value |
|------------------------|----------------------------------------------------------|
| storage.backend | berkeleyje |
| storage.directory | ./data/servers/{serverName}/repository/graph/berkeley |
| index.search.backend | lucene |
| index.search.directory | ./data/servers/{serverName}/repository/graph/searchindex |

The Graph Repository configures JanusGraph to use the berkeley embedded database and Lucene search indexes.
This stores the graph store in a file called `./data/servers/{serverName}/repository/graph/berkeley` where the server name is inserted into *{serverName}*. The search index is stored in [Apache Lucene](https://lucene.apache.org/).

The supported interface for using the Graph Repository is the MetadataCollection API, and access should only be performed through this interface. In contrast, the schema and indexing used internally by the Graph Repository are subject to change as a result of future improvements to Egeria and should not be relied upon directly.
Details of the other supported storage backends and how to specify them are found in the [JanusGraph documentation](https://docs.janusgraph.org/storage-backend/).

The repository uses the repository helper for parameter and type validation.


--8<-- "snippets/abbr.md"
Expand Down

0 comments on commit 19fce03

Please sign in to comment.