Last updated February 18, 2008. Created by Arto on February 18, 2008.
Log in to edit this page.
The following examples illustrate SPARQL API usage.
Query builders
<?php
// Does there exist a user by the name john.smith?
sparql_ask()->
where('?user', rdf::type, rdf_curie('drupal:user'))->
where('?user', dc::title, 'john.smith');
// Select the titles of all blog posts promoted to the front page
sparql_select('?title')->
where('?node', rdf::type, rdf_curie('drupal:node'))->
where('?node', 'node:type', 'blog')->
where('?node', 'node:promote', TRUE)->
where('?node', 'node:title', rdf_var('?title'));
?>