Cool URIs with Drupal 7 and RDFx?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
rogerhyam's picture

I am trying to port a bespoke system we have running to Drupal 7.

We publish stable URIs using the Cool URIs 'specification' http://www.w3.org/TR/cooluris/

An example of a URI that works on the same principle (not the system I am porting) is this:

http://data.rbge.org.uk/herb/E00421503

Call it with a browser and you get a 303 redirect to a human readable resource. Call it with curl -L and you get RDF.

You can check it on the Vapour validator

http://validator.linkeddata.org/

The important thing for me is that this differentiates between the URI for the physical object (in this case a plant specimen) and the URI for the information resource (the document containing the data).

When you think about the semantics of something like dc:created you can see the importance of having two URIs to make assertions about. Is it the created date of the specimen or the created date of the document about the specimen?

I want to replicate this with Drupal 7.

I've been looking at RDFx and am very impressed especially by the ability of an admin to do the RDF mappings. But I can't see a way of replicating true cool URIs. The data in the node is about a physical object yet the RDF produced by Drupal puts the subject of the triples as being the node URI and I can't see a way to change this or preferably to add another subject URI to the output that the fields are predicates of.

I can't find a Drupal based URI that passes the Vapour validator.

Am I missing something big here? Is it that I have just missed some obvious document? If so I'd be most grateful if someone could point me in the right direction.

I am perfectly happy to write a module that will enable this behaviour (I thought I was going to have to do that anyhow) so suggestions as to how to implement such a module would be great.

One possibility is having another box in the RDF field mappings which permitted the setting of a separate subject for that triple. This could even be based on using a #foobar for the physical object the page is talking about.

Many thanks for your thoughts on a very long post.

Roger

Comments

First, the possibility of a

linclark's picture

First, the possibility of a general solution....

Drupal does not conform to httprange-14, and I don't think that there is much interest from the people implementing RDF based modules in Drupal to do so. If you want to support this in a generalized way, it will probably require replacing the core RDF module with something else. Unfortunately, we simply do not have enough contributing developers who understand the basics of RDF, much less the additional complexity that httprange-14 brings, for this to be worthwhile as a community effort.

Related to this, one of the authors of the Cool URIs document has since publicly expressed that he doesn't find it a worthwhile distinction, and others such as TAG member Jeni T have chimed in on the discussion. As she notes, it is a permathread and one that I personally try to avoid since it can be a major timesink.

Second, your use case....

Just brainstorming, a potential simple solution could be to set up a custom entity that represents the real world thing. Since it isn't a node, it won't default to having document-specific mappings such dc:created, etc. You can then set up an entity reference from the custom entity to a node which describes it. You would probably have to write your own content negotiation handling.

I've been there

rogerhyam's picture

Thanks for your response. I have sat through so many discussions on identifiers and even the complete lifecycle of a new urn schema. I am so bored of it.

I did preach the 303 redirect and still think it is a really neat solution followed closely by the #thing. You really do need two URIs to express even the simplest semantics. But if people won't do it then we are stuck. We will never know what was dc:created when.

I fall back to looking at the psychology of why people find this so difficult to accept and think it comes down to notions of our own identity. We like to fudge the fact that it is all a bit arbitrary. (http://en.wikipedia.org/wiki/Anatta). But I digress...

I'll take a look at your suggestion but as I have to work with an established Drupal team I don't know I suspect I'll have to do a hack.

The important thing for me is

scor's picture

The important thing for me is that this differentiates between the URI for the physical object (in this case a plant specimen) and the URI for the information resource (the document containing the data).

You haven't missed anything, there is no module that I know of that can easily distinguish between the URI denoting a real object and the URI of the document describing it. I like your idea of offering a mapping for the information resource and the non-information resource. Maybe the default mapping would be for the information resource (like it is now), and optionally you could display another mapping field for the non-information resource in advanced mode. I'd encourage you to take a look at the proposal I wrote for revamping the RDF layer in Drupal, and would love to hear your feedback. It's doesn't completely address your use case, but it has a concept of 'rdf resource' for specifying a custom URI using tokens.

Semantic Web

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: