2017 © Pedro Peláez
 

library sparqllib

Simple library to query SPARQL from PHP

image

byjg/sparqllib

Simple library to query SPARQL from PHP

  • Saturday, March 10, 2018
  • by byjg
  • Repository
  • 1 Watchers
  • 2 Stars
  • 13,578 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 9 Versions
  • 14 % Grown

The README.md

PHP SPARQL Lib

Build Status SensioLabsInsight, (*1)

Copyright 2010,2011,2012 Christopher Gutteridge & University of Southampton Licensed as LGPL, (*2)

Info

  • Forked code by Joao Gilberto Magalhaes.
  • Refactored code to support PHP 5.x namespaces, composer, autoload classes and unit tests;
  • Full documentation: http://graphite.ecs.soton.ac.uk/sparqllib/

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 "

Number of rows: " . $result->numRows() . " results., (*3)

"; print " < table class='example_table'>"; print "<tr>"; foreach( $fields as $field ) { print "<th>$field</th>"; }

Simplified call

$results = new \SparQL\Connection::get( "http://rdf.ecs.soton.ac.uk/sparql/" )
            ->withNamespace( "foaf","http://xmlns.com/foaf/0.1/" )
            ->fetch("SELECT * WHERE { ?person a foaf:Person . ?person foaf:name ?name } LIMIT 5");

foreach ($results as $item) {
    print "<th>" . $item["person"]
}

Run tests

Just type:, (*4)

phpunit

The Versions

10/03 2018

dev-master

9999999-dev

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by jg

10/03 2018

1.0.7

1.0.7.0

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by jg

07/12 2017

1.0.6

1.0.6.0

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

The Requires

 

by jg

04/02 2017

1.0.5

1.0.5.0

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

The Requires

 

by jg

07/06 2016

1.0.4

1.0.4.0

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

The Requires

 

by jg

15/04 2016

1.0.3

1.0.3.0

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

The Requires

 

by jg

18/01 2016

1.0.2

1.0.2.0

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

The Requires

 

by jg

26/07 2015

1.0.1

1.0.1.0

Simple library to query SPARQL from PHP

  Sources   Download

LGPL-3.0

by jg

12/04 2015

1.0.0

1.0.0.0

Simple library to query SPARQL from PHP

  Sources   Download

by jg