This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve documentation and tutorials (#4)
* Update tutorial 2 Cleaner more documented tutorial reordered to improve understanding. Additional diagrams. Better visialisation of the results. * Update Tutorial 2 Spelling and grammar corrections * fix typos * fix conflicts * ad matplotlib and fix dependencies * add sparqlwrapper * add networkx * add project root * fix typos * add comment * remove sparqlwrapper are a core dependency * move pip dependencies to environment.yml * Update tutorial 2 fix: iron_max.svg was not included in git * Update README.md * rename Connection.get_session -> Connection._get_session get_session should be privte * Update docstrings for api.Connection and api.GraphHandle * Update docstrings for api.QueryHandle * reconfigure docs directory * PEP8 formatting changes for test_api * whitespace changes * writing documentation * Update README.md * add a logo * move jupyter notebooks to the docs * update docs * new ignored directory docs/_static * Update README.md * Update README.md * Update README.md * Update README.md Use relative links to the tutorials * Update README.md * update notebooks * update notebooks * update notebooks * Update tutorial1 There are 400 unique characters in the dataset * Update README.md * Update README.md * add tox file * Update tutorials use new Connection class first line of nodes.csv was not being read * Update tutorial2 type 'sting' -> 'string' * copyright DigitalCatapult
- Loading branch information
1 parent
e680d78
commit 7cc41ac
Showing
23 changed files
with
2,022 additions
and
907 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
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,80 @@ | ||
.. module:: fornax.api | ||
|
||
API | ||
=== | ||
|
||
.. _fornax-api-introduction: | ||
|
||
Introduction | ||
------------ | ||
|
||
This part of the documentation covers the the interface for creating an searching graphs using the fornax package. | ||
For the full documentation of the module api see :ref:`fornax-api-module`. | ||
|
||
|
||
All of the functionality in :mod:`fornax` can be accessed via the follwoing three classes. | ||
|
||
* :class:`Connection` | ||
* :class:`GraphHandle` | ||
* :class:`QueryHandle` | ||
|
||
:class:`Connection` is used to manage a connection to a SQL database. | ||
:class:`GraphHandle` and :class:`QueryHandle` are used to create, insert | ||
update and delete graphs and queries. | ||
|
||
Connection API | ||
-------------------- | ||
|
||
|
||
Fornax stores and queries graphs using a database via a database connection. | ||
:class:`Connection` manages the lifecycle of this database connection, | ||
the creation of database schema (if required) | ||
and any cleanup once the connection is closed. | ||
|
||
|
||
.. autoclass:: Connection | ||
:members: | ||
:noindex: | ||
|
||
Graph API | ||
-------------------------------- | ||
|
||
Since Graphs are persisted in a database they are not represented | ||
directly by any object. | ||
Rather, graphs are accessed via a graph handle which permits the user | ||
to manipulate graphs via a :class:`Connection` instance. | ||
|
||
.. autoclass:: GraphHandle | ||
:members: | ||
:noindex: | ||
|
||
Query API | ||
------------------------------ | ||
|
||
Like Graphs, queries exist in a database and a accessed via a handle. | ||
Queries are executed using the :func:`QueryHandle.execute` method. | ||
|
||
A query brings together three important concenpts. | ||
|
||
A **target graph** is the graph which is going to be searched. | ||
|
||
A **query graph** is the subgraph that is being seached for in the target graph. | ||
|
||
**matches** are label similarities between nodes in the query graph and target graph | ||
with a weight where :math:`0 \lt weight \lt= 1`. | ||
Users are free to caculate label similarity scores however they like. | ||
Fornax only needs to know about non zero weights between matches. | ||
|
||
Once a query has been created and executed it will return the *n* subgraphs in the | ||
target graph which are most similar to the query graph based on the similarity score | ||
between nodes and their surrounding neighbourhoods. | ||
|
||
.. note:: | ||
Nodes in the target graph will only be returned from a query if they have a | ||
non zero similarity score to at least one node in the query graph. | ||
|
||
|
||
.. autoclass:: QueryHandle | ||
:members: | ||
:noindex: | ||
|
Oops, something went wrong.