Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Don't Plot Preexisting Graph Elements #107

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --incompatible_disable_deprecated_attr_params=false
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ commands:

install-bazel-linux-rbe:
steps:
- run: curl -OL https://raw.githubusercontent.com/graknlabs/build-tools/04c69fbe5277bf2ed9e2baf5e9a53ac3c9ebee80/ci/install-bazel-linux.sh
- run: curl -OL https://raw.githubusercontent.com/graknlabs/build-tools/master/ci/install-bazel-linux.sh
- run: bash ./install-bazel-linux.sh && rm ./install-bazel-linux.sh
- run: curl -OL https://raw.githubusercontent.com/graknlabs/build-tools/04c69fbe5277bf2ed9e2baf5e9a53ac3c9ebee80/ci/install-bazel-rbe.sh
- run: curl -OL https://raw.githubusercontent.com/graknlabs/build-tools/master/ci/install-bazel-rbe.sh
- run: bash ./install-bazel-rbe.sh && rm ./install-bazel-rbe.sh

run-grakn-server:
Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
[![Stack Overflow](https://img.shields.io/badge/stackoverflow-grakn-796de3.svg)](https://stackoverflow.com/questions/tagged/grakn)
[![Stack Overflow](https://img.shields.io/badge/stackoverflow-graql-3dce8c.svg)](https://stackoverflow.com/questions/tagged/graql)

[Grakn](https://github.com/graknlabs/grakn) lets us create Knowledge Graphs from our data. But what challenges do we encounter where querying alone wont cut it? What library can address these challenges?
[Grakn](https://github.com/graknlabs/grakn) lets us create Knowledge Graphs from our data. But what challenges do we encounter where querying alone won't cut it? What library can address these challenges?

To respond to these scenarios, KGLIB is the centre of all research projects conducted at Grakn Labs. In particular, its focus is on the integration of machine learning with the Grakn Knowledge Graph. More on this below, in [*Knowledge Graph Tasks*](https://github.com/graknlabs/kglib#knowledge-graph-tasks).

At present this repo contains one project: [*Knowledge Graph Convolutional Networks* (KGCNs)](https://github.com/graknlabs/kglib/tree/master/kglib/kgcn). Go there for more info on getting started with a working example.

## Quickstart
## Installation
### Installing with Pip

**Requirements**

- Python >= 3.6
Expand All @@ -24,7 +26,9 @@ At present this repo contains one project: [*Knowledge Graph Convolutional Netwo
**Run**
Take a look at [*Knowledge Graph Convolutional Networks* (KGCNs)](https://github.com/graknlabs/kglib/tree/master/kglib/kgcn) to see a walkthrough of how to use the library.

**Building from source**
### Building from source

For typical usage you should not need to build from source and should install with pip. In the case that you need to modify KGLIB and create a pip distribution with your own changes then follow these steps.

Clone KGLIB:

Expand All @@ -38,7 +42,7 @@ git clone git@github.com:graknlabs/kglib.git
cd kglib
```

To build all targets can be built:
To build all targets:

```
bazel build //...
Expand Down Expand Up @@ -77,7 +81,7 @@ Below is a set of tasks to be conducted over Knowledge Graphs (KGs) that we have

We describe these tasks in more detail below. Where a solution is readily available in KGLIB, it is listed against the relevant task(s).

We openly invite collaboration to solve these problems! All contributions are welcome  — code, issues, ideas, discussions, pointers to existing tools, and relevant datasets will all help this project evolve!
We openly invite collaboration to solve these problems! All contributions are welcome - code, issues, ideas, discussions, pointers to existing tools, and relevant datasets will all help this project evolve!

If you wish to discuss your ideas more conversationally, and to follow the development conversation, please join the [Grakn Slack](https://grakn.ai/slack), and join the #kglib channel. Alternatively, start a new topic on the [Grakn Discussion Forum](https://discuss.grakn.ai).

Expand Down Expand Up @@ -122,8 +126,8 @@ We can extend N-ary Relation and Attribute prediction to include Entity predicti
#### Building Concept Embeddings

Embeddings of Things and/or Types are universally useful for performing other downstream machine learning or data science tasks. Their usefulness comes in storing the context of a Concept in the graph as a numerical vector.
These vectors are easy to ingest into other ML pipelines.
The benefit of building general-purpose embeddings is therefore to make use of them in multiple other pipelines. This reduces the expense of traversing the Knowledge Graph, since this task can be performed once and the output re-used more than once.

These vectors are easy to ingest into other ML pipelines. The benefit of building general-purpose embeddings is therefore to make use of them in multiple pipelines. This reduces the expense of traversing the Knowledge Graph, since this task can be performed once and the output re-used more than once.

***In KGLIB*** [*Knowledge Graph Convolutional Networks* (KGCNs)](https://github.com/graknlabs/kglib/tree/master/kglib/kgcn) can be used to build general-purpose embeddings. This requires additional functionality, since a generic loss function is required in order to train the model in an unsupervised fashion. At its simplest, this can be achieved by measuring the shortest distance across the KG between two Things. This can be achieved trivially in Grakn using [`compute path`](https://dev.grakn.ai/docs/query/compute-query#compute-the-shortest-path).

Expand Down Expand Up @@ -153,7 +157,7 @@ Grakn's highly flexible knowledge representation features means that this isn't

The challenge here is to find a mapping between the structure of the two KGs. If Types or Things (Type instances) overlap between the two KGs, then they need to be merged.

This decomposes the problem to that of matching between the two KGs. Grakn's schema helps with this task, since we can use this to perform matching between the structures of the two KGs, and thereby find a mapping between them. Matching of data can be framed as either link prediction, or a comparison of graph embeddings.
This decomposes the problem to that of matching between the two KGs. Grakn's schema helps with this task, since we can use this to perform matching between the structures of the two KGs, and thereby find a mapping between them. Matching of data could be framed as either link prediction, or a comparison of graph embeddings.

#### Automated Knowledge Graph Creation

Expand Down
6 changes: 3 additions & 3 deletions dependencies/graknlabs/dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ def graknlabs_build_tools():
git_repository(
name = "graknlabs_build_tools",
remote = "https://github.com/graknlabs/build-tools",
commit = "a898bbb0d88932409addbba2a18846ddaaf18f91", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_build_tools
commit = "2917a6d9348d67b036d762f521e6a8680101ea51", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_build_tools
)


def graknlabs_grakn_core():
git_repository(
name = "graknlabs_grakn_core",
remote = "https://github.com/graknlabs/grakn",
commit = "b806830d57e3492ad899fd1505583abf6aa61a58" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_grakn_core
commit = "874f8c7ae14e2f267a88e481b8e207b38d5eded9" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_grakn_core
)

def graknlabs_client_python():
git_repository(
name = "graknlabs_client_python",
remote = "https://github.com/graknlabs/client-python",
commit = "c8de80149803fe1e7474c490ad9b07540639516b" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_client_python
commit = "57bc412856a755254d44aabc1d6eab4ea560154f" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_client_python
)
Binary file added kglib/kgcn/.images/edge_update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed kglib/kgcn/.images/learning.png
Binary file not shown.
Binary file added kglib/kgcn/.images/learning_pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions kglib/kgcn/.images/learning_pipeline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added kglib/kgcn/.images/message_passing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added kglib/kgcn/.images/node_update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed kglib/kgcn/.images/queried_subgraph.png
Binary file not shown.
Binary file added kglib/kgcn/.images/subgraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions kglib/kgcn/.images/subgraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions kglib/kgcn/.images/subgraph_with_predictions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading