Posted by bdubb on March 11, 2009 at 9:12pm
If I am creating a new site on Drupal 6, how can I better prepare my content for the RDFa features being developed for Drupal 7?
If I am creating a new site on Drupal 6, how can I better prepare my content for the RDFa features being developed for Drupal 7?
Comments
Experiment today
You can install the RDF module and the RDF CCK module and get very similar features today in Drupal 6.
It is unknown what "out of the box" RDFa might look like, but at a guess, I'd want to push for dublin core -- title, author, create date, subject etc. etc.
If we do it right RDFa in
If we do it right RDFa in core will be based on Drupal also understanding and being able to export RDF, so I second suggesting that you look at Stéphane Corlosquet's http://drupal.org/project/rdfcck (which uses http://drupal.org/project/rdf ).
benjamin, Agaric Design Collective
benjamin, agaric
I don't know your use case
I don't know your use case but use CCK wherever you can, it'll be an easier upgrade to Fields in Drupal 7.
structured data
Am I right Brett that you are asking how you can make sure that the metadata in your current website is going to be marked-up without you having to do extra work now.
A bunch of metadata will be automatically exposed just because it's a default Drupal document (e.g. title, author, etc.)
If you have information like events however there is more structured data in there (e.g. location, time, etc.). If you use CCK (that will be core fields in D7) you'll be able to mark up a certain field with a specific RDFa attribute (e.g. a location or a time attribute) (that works now already with Stephane's RDFCCK)
If you have a fluid text you can mark up metadata in the text with RDFa (we are working on a WYSIWYG editor for that).
--
I blog and Tweet
--
Check out more of my writing on our blog and my Twitter account.
RDFa in Drupal 6
I'm new to RDF and have been playing around with the RDF modules for the past week with the same question in mind, "What can I implement in my Drupal sites today to prepare for RDF/RDFa in Drupal 7?" I'm just learning about RDF and RDFa so I apologize in advance if I've garbled any key concepts.
There are a couple nifty things that you can do with RDF in Drupal 6 today. Like the other commenters mentioned, RDF CCK is your best bet for getting started.
1) Creating Your Own RDF Data: RDF CCK module
The RDF CCK module lets you map fields (title, body, cck defined fields, etc.) to RDF properties. For example, you can map dc:title (the Dublin Core title element) to your node title in a content type. With RDF CCK, each node will have a corresponding RDF page such as mysite.com/node/1/rdf.
One thing that might be confusing at first is that RDF and RDFa are different. RDFa is a way to add attributes to XML documents. RDF is a metadata data model where you describe information with a subject, predicate, and object. If you have heard of microformats, RDFa is an alternative.
If you only install RDF CCK, then the XHTML in your nodes will not automatically include RDFa. However, there is a patch that will add RDFa to CCK field output. From what I understand, one of the major advantages of Drupal 7 being RDFa-ready would mean that you could easily add RDFa automatically during theming. If you use Full HTML, then you could also add RDFa during content creation by hand.
2) Pulling in Other RDF Data: SPARQL Module
SPARQL is the query language for RDF. If you've queried MySQL databases with SQL before, SPARQL is the same concept. I hadn't heard of SPARQL before Drupalcon but now I can't believe that everyone isn't talking about it all the time. Simply, SPARQL lets you get any RDF via a query interface.
For example, the following SPARQL query, with the endpoint http://dbpedia.org/sparql, gets all of the shows Tiny Fey starred in.
select DISTINCT ?showswhere
{
?shows <http://dbpedia.org/ontology/starring> <http://dbpedia.org/resource/Tina_Fey> .
?e <http://dbpedia.org/ontology/series> ?series .
}
Using Drupal, you can create a SPARQL query and then save it as a node. I'm sure that there are lots of possibilities for how you can then integrate the data into your site. To create and save SPARQL queries, you'll need the SPARQL module.
Modules to Install
Here are the modules you should install to start testing out creating and pulling RDF data:
SPARQL
RDF
RDF CCK
Evoc
About image definitions
Hi,
I am working on a D6 website project dealing with selling numeric pictures like photographies, paintings, drawings and so on. I often use definitions associated to my images in order to eventually provide a "search by definition" function, throught a faceted search. I will try to use ontologies and RDFa in a near future, and I wonder about the best way to store that kind of data in preparation of D7 & Semantic Web.
You probably know that a definition is a combination of two numbers: the witdh (W) and height (H) of an image (one often mistake definition for resolution but resolution is a different thing). Those numbers are always integers and the common unit used in my case is the amount of pixels (e.g. "1350x1200 pixels").
I have started my job by storing definitions in my content types as taxonomy terms in CCK taxonomy fields, like this: WxH (e.g. "1350x1200"). But I guess this is not a very "Semantic Web compatible" idea. I am afraid I will need to invoke weither the width or the height of an image through a SPARQL query and won't be be able to do this with ease, because my definition is a mix of 2 integers and a letter between them ("x"), the whole in a single field. For instance, I won't be able to do any calculation with such composite data.
Question: How should I structure and store my definitions today in order to use them in a very flexible way in a near future as RDF datas and best "queriable" information?
(I hope I am understandable enough and that I post this question in the right place...)
Image Annotation
Hi ErwanF,
You should check out the W3C guidelines for Image Annotation on the Semantic Web. In it, you'll find some good case studies of using metadata for image storage.
Cheers,
Julia
Thanks...
a lot, Julia, for this answer; I'll look at those guidelines.
[Edit for our followers: here is the latest version of the "Image annotation on the Semantic Web" W3C document. Definitively useful, thanks again.]
how to query local RDF repository ?
It's good to have RDF on a Drupal site.
It's also good to have a SPARQL endpoint on a Drupal site to query datas from dbpedia for instance.
But how to query your own RDF data on your own Drupal site using SPARQL ? I didn't figure this out.
The SPARQL endpoint module that I use on Drupal allows to query data but for each query that you can make the URL of an existing SPARQL endpoint such as dbpedia or others is mandatory. So I didn't find a way to query my local RDF repository that's on my Drupal website.
Thanks anyone if you can help me out to query my local RDF.