Quantcast
Viewing all articles
Browse latest Browse all 49202

Freebase Reference Field Module

Based on the comments in http://groups.drupal.org/node/152939 I made a draft implementation of what I was considering as a 'semantic form widget' using Freebase's 'suggest' widget.

Module code is available here: http://github.com/adorsk-whoi/fb_reference

Details

The module defines a 'Freebase Reference' field type which can be used to reference freebase topics via Freebase's suggest widget.

The field stores the label and mid of a Freebase topic. It renders values either as (1) 'Topic Name + mid ('Harold and Maude [mid: /m/03gmw] '), (2) just the topic name ('Harold and Maude'), or (3) just the mid ('/m/03gmw') .

Possible Uses<

One way to use this module is to easily add controlled vocabularies to your site. The terms from these vocabularies would have semantic identifiers which could be referenced on the web.

For example, say I'm making a database of film reviews and I want to identify film names with unique, referenceable identifiers.

I would make a Freebase Reference field and limit its choices to Freebase's '/film/film' type.

When users make data entries and select film names they would see an autocomplete whose choices are films in freebase. When they select a film they would store both a readable film name (e.g. 'Harold and Maude') and a unique ID for the film (e.g. '/m/03gmw').

I could then later use that id to build a referenceable URI (e.g. http://rdf.freebase.com/rdf/m.03gmw ) .

Or I could use the Freebase mid to query Freebase via MQL.

Thoughts

What I like about this is that Freebase's suggest widget is highly usable, that I can easily add new terms to Freebase, and that I don't have to host any vocabularies myself.

I also like that my users can see readable data rather than raw machine-readable ids.

Perhaps the idea of 'Labeled URIs' (LURIs?) could be useful for other linked data tools.

For example, if there was a way to use the results of a SPARQL view as the source for an autocomplete (as linclark suggested in http://groups.drupal.org/node/152939#comment-510434 ) . When something from the autocomplete was selected it would generate a string like 'Human Readable Label [http://myvocab.com#mylabel]'

If this is useful to other people maybe I'll consider developing it as a proper contrib module.

Otherwise I'll plan to leave it on github.

I hope that this helpful. Any feedback is welcome.


Viewing all articles
Browse latest Browse all 49202

Trending Articles