PHPackages                             graphcommons/graphcommons - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. graphcommons/graphcommons

ActiveLibrary[HTTP &amp; Networking](/categories/http)

graphcommons/graphcommons
=========================

PHP Wrapper for Graph Commons API

3.0.1(7y ago)38MITPHPPHP &gt;=7.2

Since Nov 27Pushed 7y ago2 watchersCompare

[ Source](https://github.com/graphcommons/graphcommons-php)[ Packagist](https://packagist.org/packages/graphcommons/graphcommons)[ Docs](http://github.com/graphcommons/graphcommons-php)[ RSS](/packages/graphcommons-graphcommons/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Graph Commons is a collaborative 'network mapping' platform and a knowledge base of relationships. You can map relationships at scale and unfold the mystery about complex issues that impact you and your community.

See more about [here](//graphcommons.com/about).

Before Beginning
----------------

[](#before-beginning)

- Set autoloader properly or use [Composer](//getcomposer.org).
- Use PHP &gt;= 7.2 (or see others [PHP &lt; 7.2](//github.com/graphcommons/graphcommons-php/releases/tag/2.0.0), [PHP &lt; 7.1](//github.com/graphcommons/graphcommons-php7-archive), [PHP &lt; 7.0](//github.com/graphcommons/graphcommons-php-archive)).
- Run each call in `try/catch` blocks.
- On README, `dump` means `var_dump()`, besides `?` means optional for function arguments and nullable for function returns.

Notice: See Graph Commons's official documents [here](//graphcommons.github.io/api-v1/) before using this library.

Installation
------------

[](#installation)

```
// manual
require '/src/Autoload.php';

use GraphCommons\Autoload;

Autoload::register();
```

```
composer require graphcommons/graphcommons
```

```
// composer.json
{"require": {"graphcommons/graphcommons": "~3.0"}}
```

Configuration
-------------

[](#configuration)

Configuration is optional but you can provide all these;

```
// Dumps all Request and Response stuff (usefull while dev stage). (@default)
bool $debug = false;

// Sets cURL options. (@default)
array $clientOptions = [
    'redir'          => true, // follow location
    'redirMax'       => 3,    // follow location max
    'timeout'        => 5,    // read timeout
    'timeoutConnect' => 3,    // connect timeout
];
```

Usage
-----

[](#usage)

Notice: If any error, all (caller) methods below will throw `GraphCommons\ClientException` due to using `GraphCommons\Client::send()` method that makes call to Graph Commons API and throws exception when an error occurres through. So please, use `try/catch` blocks while making your calls, not regarding this usage examples.

### API Object

[](#api-object)

```
use GraphCommons\Api;

$api = new Api('' ?bool $debug = false, ?array $clientOptions = []);
```

#### API - Status

[](#api---status)

```
// GET /status
dump $api->status(); // => ?object
```

#### API - Search

[](#api---search)

```
// GET /search
dump $api->search('' ?array $uriParams = []); // => array
```

### Graph Object

[](#graph-object)

```
use GraphCommons\Thing\Graph;

$graph = new Graph($api);
```

#### Graph - Check

[](#graph---check)

```
// HEAD /graphs/:id
dump $graph->check(''); // => bool
```

#### Graph - Get

[](#graph---get)

```
// GET /graphs/:id
dump $graph->get(''); // => ?object
```

#### Graph - Create

[](#graph---create)

```
// POST /graphs
dump $graph->create([
    'name'        => 'Test',
    'description' => '',
    'status'      => Graph::STATUS_DRAFT,
    'signals'     => [
        ['action'    => Graph::SIGNAL_CREATE_EDGE,
         'from_name' => 'Ahmet',
         'from_type' => 'Person',
         'to_name'   => 'Burak',
         'to_type'   => 'Person',
         'name'      => 'COLLABORATED',
         'weight'    => 2]
    ]
]); // => ?object
```

#### Graph - Update

[](#graph---update)

```
// PUT /graphs/:id
dump $graph->update('', [
    'name'        => 'Test',
    'description' => 'Test description.',
    'subtitle'    => 'Test subtitle.',
]); // => ?object
```

#### Graph - Clear

[](#graph---clear)

```
// PUT /graphs/:id/clear
dump $graph->clear(''); // => ?object
```

#### Graph - Create Signal

[](#graph---create-signal)

```
// PUT /graphs/:id/add
dump $graph->createSignal('', [
    ['action'    => Graph::SIGNAL_CREATE_EDGE,
     'from_name' => 'Ahmet',
     'from_type' => 'Person',
     'to_name'   => 'Fatih',
     'to_type'   => 'Person',
     'name'      => 'COLLABORATED',
     'weight'    => 2]
]); // => ?object
```

#### Graph - Get Types

[](#graph---get-types)

```
// GET /graphs/:id/types
dump $graph->getTypes(''); // => ?object
```

#### Graph - Get Edges

[](#graph---get-edges)

```
// GET /graphs/:id/edges
dump $graph->getEdges('', array $uriParams); // => ?object
```

#### Graph - Get Paths

[](#graph---get-paths)

```
// GET /graphs/:id/paths
dump $graph->getPaths('', array $uriParams); // => ?object
```

#### Graph - Get Collab Filter

[](#graph---get-collab-filter)

```
// GET /graphs/:id/collab_filter
dump $graph->getCollabFilter('', array $uriParams); // => ?object
```

#### Graph - Search

[](#graph---search)

```
// GET /graphs/search
dump $api->search('' ?array $uriParams = []); // => array
```

#### Graph - Delete

[](#graph---delete)

```
// DELETE /graphs/:id
dump $api->delete(''); // => ?object
```

### Node Object

[](#node-object)

```
use GraphCommons\Thing\Node;

$node = new Node($api);
```

#### Node - Get

[](#node---get)

```
// GET /nodes/:id
dump $node->get(''); // => ?object
```

#### Node - Search

[](#node---search)

```
// GET /nodes/search
dump $node->search('' ?array $uriParams = []); // => array
```

### Hub Object

[](#hub-object)

```
use GraphCommons\Thing\Hub;

$hub = new Hub($api);
```

#### Hub - Get

[](#hub---get)

```
// GET /hubs/:id
dump $hub->get(''); // => ?object
```

#### Hub - Get Types

[](#hub---get-types)

```
// GET /hubs/:id/types
dump $hub->getTypes(''); // => ?object
```

#### Hub - Get Paths

[](#hub---get-paths)

```
// GET /hubs/:id/paths
dump $hub->getPaths('', array $uriParams); // => ?object
```

#### Hub - Get Collab Filter

[](#hub---get-collab-filter)

```
// GET /hubs/:id/collab_filter
dump $hub->getCollabFilter('', array $uriParams); // => ?object
```

#### Hub - Search Graphs

[](#hub---search-graphs)

```
// GET /graphs/search (alias, with Hub ID)
dump $hub->searchGraphs('', '', ?array $uriParams = []); // => array
```

#### Hub - Search Nodes

[](#hub---search-nodes)

```
// GET /nodes/search (alias, with Hub ID)
dump $hub->searchNodes('', '', ?array $uriParams = []); // => array
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~182 days

Total

3

Last Release

2727d ago

Major Versions

2.0.0 → 3.0.02018-11-15

PHP version history (2 changes)2.0.0PHP &gt;=7.1

3.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/70f9bcd96f92716abf051f22448ab55da368441dbc3e1d96bcebd70e132dcc59?d=identicon)[krmgns](/maintainers/krmgns)

---

Tags

graphgraphcommonsphpphprestgraphcommonsgraph commons

### Embed Badge

![Health badge](/badges/graphcommons-graphcommons/health.svg)

```
[![Health](https://phpackages.com/badges/graphcommons-graphcommons/health.svg)](https://phpackages.com/packages/graphcommons-graphcommons)
```

###  Alternatives

[abantecart/ups-php

UPS PHP SDK based on OAuth

1815.3k](/packages/abantecart-ups-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
