I've done some basic views integration for querying data stored as RDF. I'd like to know if anyone else has started something similar, or thought about this at all. The functionality that I'm aiming for in the near team is: Displaying object literals, creation dates, predicates, subject & contexts. Filtering on contexts, predicates, creation dates, subjects & objects. Once this basic functionality is done I'm going to look at creating views that span multiple statements, ie if towns are in provinces and provinces are in countries, so me all the towns in France.

#4 rdf_views_2.patch6.49 KBjmiccolis
#2 rdf_views.patch6.21 KBjmiccolis
Members fund testing for the Drupal project. Drupal Association Learn more


davidseth’s picture

This is cool. Tell me more!!!

jmiccolis’s picture

Status: Active » Needs review
6.21 KB

Attached is a patch which exposes the rdf information in the local datastore to views. It makes the basic fields of each rdf statement available (subject, predicate, object, context, uid, created time) and provides for filtering on created time, predicate and context.

This patch doesn't apply to the alpha3 tarball, so you'll need to use CVS HEAD.

Arto’s picture

Assigned: Unassigned » Arto
jmiccolis’s picture

6.49 KB

This is an update of the previous patch that adds relationship support. This allows you (among other things) to join data in two local rdf repositories.

fago’s picture

really interesting.

What do you think about the idea to use a SPARQL query engine together with views? Imo this would be the best possible way to query rdf data with views, but it's also more difficult to do.. :(
-> First off we would need something like that patch: http://drupal.org/node/293841

jmiccolis’s picture

@fago - I've put a little bit of effort in that direction lately (see http://drupal.org/node/293841 ), and I'm convinced it's possible to provide a query class to views that will generate SPARQL , though it's not straight forward how you'd map the the SQLisms that are baked into views against SPARQL concepts that are somewhat different.

Really though I want it both ways; views having SQL based understanding of my local rdf store, as well as the capacity for generating SPARQL queries that reach out to the larger 'net.

fago’s picture

>it's not straight forward how you'd map the the SQLisms that are baked into views against SPARQL concepts that are somewhat different.

Indeed, that's no easy task. We could automatically parse the schema and generate fields for properties with literal values and relationships else? To allow querying the larger net we would need a way for the user to add some more schemas, I think.

talatnat’s picture


Arto’s picture

Status: Needs review » Fixed
Issue tags: +views

@Jeff: apologies for the delay, but I've now finally committed your patch in changeset [171969].

You did a nice job, and I'm looking forward to more of these.

To ensure I don't become a bottleneck, I've given you CVS access to the project. Feel free to enhance the Views integration etc. by committing directly to CVS at your convenience (however, for any more extensive changes that would e.g. modify the module's existing core code or APIs I'd prefer that you first post a patch in the tracker for review).

Status: Fixed » Closed (fixed)
Issue tags: -views

Automatically closed -- issue fixed for 2 weeks with no activity.