SPARQL Views
Allows users to query SPARQL endpoints on the Web and RDF/RDFa files using Drupal's Views Query Builder. Once the data is in Views, users can use any Views display plugin.
Some examples of what you can do:
- create visualizations with the Google Visualization API
- feed an Exhibit
- map RDF resources to nodes for automated import/update
Users can also use Views plugins for caching, and add and manage filters, sorts, etc to their queries through the Views UI. Also provides a GUI for novice users to create the query graph (under development).
Documentation
The SPARQL Views plugin for Drupal enables the integration of data available at SPARQL end points into Drupal powered Web sites. Because it is a plugin for Drupal, a working installation of Drupal is needed. The plugin is available on GitHub, it requires Drush to be compiled and Git to be downloaded.
Installation procedure:
- Clone the GitHub repository
git clone https://github.com/linclark/sparql_views
- Compile the plugin
drush make --no-core sites/all/modules/sparql_views/sparql_views.make
- In your Drupal Web site, enable SPARQL Views, RDFx, Views, and Views UI. If you want to use the SPARQL Views drag-and-drop interface, enable SPARQL Views UI and it's dependencies.
- Go to the Tools tab in Views and Disable the Views data cache. If you want to use SPARQL Views UI, you unfortunately have to turn off Views JavaScript currently as well.
Usage:
To create a query, and get its associated results as a view, go to the Settings pane in Views, in left hand column under Advanced Settings. Queries can be input in two ways:
- Enter your prefixes and select query directly in the Settings pane. The select query should be in the form
SELECT * WHERE {?s ?p ?o} LIMIT 100. You will want to limit your query if it returns a large result, otherwise you might get the white screen of death because of PHP timeout. - Use the drag-and-drop interface by clicking on 'Build query'. This is currently very limited and can only create conjunctive queries.
After entering the query, any variables used will show up as fields. If you do not see fields, check to ensure your query saved. If it did, ensure that you have the Views data cache turned off.
