Giter Club home page Giter Club logo

propertygraph.jl's Introduction

PropertyGraph

Build Status

PropertyGraph.jl is a Julia package for creating and querying graph data structures. A Graph consists of Vertices connected by Edges. Vertices and Edges each have properties, an identifier and optionally a reference to any arbitrary object so that existing objects can be organised into graphs.

Documentation

The primary documentation for PropertyGraph.jl is the wiki which contains guidance, instructions and examples.

Inspiration

There are various sources of inspiration for this package, including the Gremlin graph traversal language for the JVM, the Cypher language used by Neo4j and other query languages. However, the structure of queries supported by this package make use of features and syntax peculiar to Julia.

Querying

Querying in PropertyGraph.jl is performed by:

  • building up a query object (::CompositeQuery) that contains a list of graph traversals and operations to be performed.
  • retrieving results from the query (which causes the query to execute when needed)

A query, or portions of a query can be reused to avoid repeat processing of the common traversals.

The simplest way of building a query is to use the query varargs method. This method allows queries to be written as a list of operations in a simple DSL as per the following example.

averagepopulaton = query(graph,
			  (vertices, v-> get(v,"name") == "Queensland" || get(v,"name") == "Victoria"),
			  (outgoing, e->e.typelabel == "IsAdjacent"),
			  head,
			  distinct,
			  (average, v->get(v, "population") # average the value of population property
			 )

# The query above contains the following steps:
	# start with a graph
	# select the vertices that match some condition
	# follow the outgoing edges from these vertices where the edges are of type IsAdjacent
	# move to the vertices at the head of those edges
	# retain only 1 instance of each vertex(as some vertices may have been reached by more than 1 path)
	# average the value of population property

The above example and others are explained in the wiki.

Persistence

This library provides extension points to support persistence of graphs and the loading of portions of graphs on-demand. An implementation of this for a specific database / persistence technology will be provided as a seperate, related package.

The wiki describes how change tracking is implemented. A store of changes is provided and can be used by persistence functionality to determine which vertices and edges have change and need to be persisted or removed.

Loading on demand is supported by extending the GraphLoader type and providing several required method implementations used to load subsets of graph data from a persistence store. An instance of this type can be used as a source for a Query, and the PropertyGraph library will make the appropriate calls to obtain information about edges and vertices as needed to complete the query.

Performance

The focus of the library has initially been on supporting a useful and convenient query syntax.

Further testing is required, particularly against specific persistence implementations, and this is an area where additional effort is likely to be required.

Installation

Although PropertyGraph.jl is written to be compatible with both Julia 0.3 and 0.4, it is, at least initially, be available for Julia 0.4 only. There have been errors encountered during testing on v0.3 due to issues that have already been resolved in Julia 0.4.

Install PropertyGraph.jl with:

Pkg.add("PropertyGraph")

If PropertyGraph.jl is not recognised you may first need to update your package metadata with:

Pkg.update()

PropertyGraph.jl has a dependency on the following 2 packages:

  • the Compat package for Julia 0.3/0.4 compatibility
  • the UUID for generation of unique identifiers

propertygraph.jl's People

Contributors

phillp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.