PHPackages                             labxxi/phpsesame - 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. [API Development](/categories/api)
4. /
5. labxxi/phpsesame

ActiveLibrary[API Development](/categories/api)

labxxi/phpsesame
================

Php sesame interface

v2.0.0(11y ago)23251[1 issues](https://github.com/labxxi/phpsesame/issues)W3CPHPPHP &gt;=5.3.0

Since Apr 17Pushed 11y ago1 watchersCompare

[ Source](https://github.com/labxxi/phpsesame)[ Packagist](https://packagist.org/packages/labxxi/phpsesame)[ RSS](/packages/labxxi-phpsesame/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

========= phpsesame
===================

[](#phpsesame)

Fork of the alex latchford sesame interface . Inspired by the work of Julian Klotz , and Andreas Thalhammer

Requirements
============

[](#requirements)

- `PHP 5+ `\_ - (There shouldn't be any subversion dependencies, but I haven't checked thoroughly)
- `HTTP_Request2 `\_
- `semsol/ARC2 ` library, available here on github, is strongly recommended to parse results or generate rdf.

Examples
========

[](#examples)

I am assuming at this point you have installed and configured Sesame, have a repository set up and the REST API functioning correctly. If not then please consult the `Sesame documentation `\_.

Using the Library
-----------------

[](#using-the-library)

To get the library up and running all you need is::

```
require_once "path/to/phpSesame/phpSesame.php";

$sesame = array('url' => 'http://localhost:8080/openrdf-sesame', 'repository' => 'exampleRepo', 'charset' => 'UTF-8');
$store = new phpSesame($sesame['url'], $sesame['repository'],  $sesame['charset']);

```

You can change the repository you are working on at any time by calling::

```
$store->setRepository("newRepo");

```

Charset param is used for both content type and accept headers params. You can set them specifically by calling::

```
    $store->setAcceptCharset();
    $store->setContentCharset();

```

Querying a Store
----------------

[](#querying-a-store)

The simplest way to query a store is::

```
$sparql = "PREFIX foaf:
SELECT ?s ?o WHERE { ?s foaf:name ?o } LIMIT 100";
$resultFormat = phpSesame::SPARQL_XML; // The expected return type, will return a phpSesame_SparqlRes object (Optional)
$lang = "sparql"; // Can also choose SeRQL (Optional)
$infer = true; // Can also choose to explicitly disallow inference. (Optional)

$result = $store->query($sparql, $resultFormat, $lang, $infer);

```

Using ARC2 for results::

```
    $parser = ARC2::getSPARQLXMLResultParser();
    $parser->parse('', $result);
    foreach($parser->getRows() as $row) {
            echo "Subject: " . $row['s'] . ", Object: " . $row['o'] . ".";
    }

```

Documentation will be updated with new features examples soon.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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 ~39 days

Total

2

Last Release

4366d ago

Major Versions

v1.0.0 → v2.0.02014-05-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/bbdbdf9db7fe6080c80144d5b7ffc0ca85bcc1eacaf60ead1af547194f2cb6e7?d=identicon)[labxxi](/maintainers/labxxi)

---

Tags

RDFsparqlsesame

### Embed Badge

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

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

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[easyrdf/easyrdf

EasyRdf is a PHP library designed to make it easy to consume and produce RDF.

62231.5M42](/packages/easyrdf-easyrdf)[semsol/arc2

ARC2 is a PHP library for working with RDF. It also provides a MySQL-based triplestore with SPARQL support.

334250.0k15](/packages/semsol-arc2)[sweetrdf/easyrdf

EasyRdf is a PHP library designed to make it easy to consume and produce RDF.

261.3M11](/packages/sweetrdf-easyrdf)[bordercloud/sparql

Lib PHP very easy for SPARQL 1.1

27100.4k](/packages/bordercloud-sparql)

PHPackages © 2026

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