PHP Library for accessing SPARQL endpoints
Clone or download
Pull request Compare This branch is 38 commits ahead of cgutteridge:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
src
tests/SparQL
.gitignore
.travis.yml
LICENSE
README.md
composer.json
index.php
phpunit.xml.dist

README.md

PHP SPARQL Lib

Build Status SensioLabsInsight

Copyright 2010,2011,2012 Christopher Gutteridge & University of Southampton Licensed as LGPL

Info

Example:

$db = new \SparQL\Connection( "http://rdf.ecs.soton.ac.uk/sparql/" );
$db->ns( "foaf","http://xmlns.com/foaf/0.1/" );

$sparql = "SELECT * WHERE { ?person a foaf:Person . ?person foaf:name ?name } LIMIT 5";
$result = $db->query( $sparql );

$fields = $result->fieldArray();

print "<p>Number of rows: " . $result->numRows() . " results.</p>";
print "<table class='example_table'>";
print "<tr>";
foreach( $fields as $field )
{
	print "<th>$field</th>";
}

Run tests

Just type:

phpunit