acorbi / PHP-SPARQL-Lib

PHP Library for accessing SPARQL endpoints

Home Page:http://graphite.ecs.soton.ac.uk/sparqllib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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->field_array();

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

Run tests

Just type:

phpunit

About

PHP Library for accessing SPARQL endpoints

http://graphite.ecs.soton.ac.uk/sparqllib/

License:Other


Languages

Language:PHP 100.0%