byjg / anydataset-sparql
Anydataset SparQL abstraction. Anydataset is an agnostic data source abstraction layer in PHP.
4.0.1
2021-10-31 05:52 UTC
Requires
- php: >=5.6.0
- byjg/anydataset: 4.0.*
- byjg/sparqllib: 2.0.*
Requires (Dev)
- phpunit/phpunit: 5.7.*|7.4.*
This package is auto-updated.
Last update: 2024-11-15 18:36:38 UTC
README
SparQL abstraction dataset. Anydataset is an agnostic data source abstraction layer in PHP.
See more about Anydataset here.
Examples
Simple Manipulation
<?php $sparqlEndpoint = 'http://dbpedia.org/sparql'; $namespace = [ 'dbo' => 'http://dbpedia.org/ontology/', 'dbp' => 'http://dbpedia.org/property/' ]; $dataset = new \ByJG\AnyDataset\Semantic\SparQLDataset($sparqlEndpoint, $namespace); $iterator = $dataset->getIterator("select distinct ?Concept where {[] a ?Concept} LIMIT 5"); foreach ($iterator as $row) { echo $row->get("Concept"); echo $row->get("Concept.type"); }
Install
Just type:
composer require "byjg/anydataset-sparql=4.0.*"
Running the Unit tests
vendor/bin/phpunit