Question about semantics in Drupal

Events happening in the community are now at Drupal community events on www.drupal.org.
Nasreddine's picture

Hello,
I want to create a website which use Semantic web technologies.
So I want to know how semantics is implemented in Drupal to get some ideas. Here some questions :

  1. I will use RDFa to annotate my pages, can I access them using ARC2 RDFa parser even the pages are with .php extension, or I have to redirect pages using Apache redirection rules to change the extension to .html ?
  2. After annotate content by RDFa I want to create a SPARQL endpoint and store triples grabbed from annotated pages to get the ability to perform SPARQL queries ? Or the is an other idea to store rdf triples ?
  3. ARC2 documentation is a little bit summarized, is there any other rich documentation ?

Thank you.

Comments

The RDF Mapping API, which is

linclark.research's picture

The RDF Mapping API, which is a part of Drupal 7 core, enables you to create mappings between Entity types and RDF types, and between fields and RDF predicates. When a page is displayed, it takes these abstract mappings and inserts them into the HTML as RDFa. It can also be used to output RDF/XML and other RDF serializations or to populate a SPARQL endpoint.

In the way it is implemented, RDF is simply a layer on top of Drupal to provide data interoperability with other sites and applications that use RDF. In core, this mapping is used to publish the data so that it can be reused by others. In contrib, it is used by modules like SPARQL Views to consume data from other sites. (Please post if there are other modules that use it in contrib)

I recently wrote something for IBM's developerWorks that talks more about this, https://www.ibm.com/developerworks/web/library/wa-rdf/

Here are some big name uses of RDF:
http://drupal.org/node/1089804

If anyone has ideas for a good place in the handbook for this, post it here. Unfortunately, it's hard to figure out where to put this. There is some documentation in the Site Builders guide and some documentation in the Contributed Modules section. Where do people look first?

Sorry, in the email I

linclark.research's picture

Sorry, in the email I received from groups.drupal.org, the text of your post was different.

To clarify what you are asking:

  1. Do you want to map your fields to RDF terms and have it output proper RDFa automatically... or do you want to handcode RDFa in a textarea and have that hand-coded RDFa populate your SPARQL Endpoint?
  2. If you want to do the first one, the SPARQL Endpoint module should work for you. It's in dev and I haven't tried it out recently. We are currently consolidating SPARQL related functionality and scor is moving the module to SPARQL module really soon, so we'll be working on it.

    However, SPARQL Endpoint does not currently index hand-coded RDFa... the work in Drupal core was meant to automate RDFa, not support the production of manual RDFa input. But I think it would be possible to do something that indexes the hand-coded RDFa in textareas and adds that to the endpoint. It is on my list of things to do, but pretty low on the list in terms of priority. If someone else is interested, I'd be happy to collaborate and chip in the thoughts I have so far.

  3. If you use SPARQL Endpoint, you shouldn't need to use the ARC2 documentation. I don't think there is any documentation other than what is on semsol

Thank you Linclark for

Nasreddine's picture

Thank you Linclark for replaying.
1. I want to map my fields with rdf terms to generate them automatically. Whant about .php extension ?
2. I will try to consume RDFa from xhtml pages and store them in the Sparql endpoint.

If you are using Drupal,

linclark.research's picture
  1. If you are using Drupal, there isn't a .php extension
  2. If you are trying to expose the RDF in your Drupal site in the SPARQL Endpoint, you don't need to scrape the xhtml. The data is generated from the database and transformed into triples based on the RDF mapping.

Thank you very much

Nasreddine's picture

Thank you very much linclark.
1. I'm not using Drupal, I am developing my own application. Have I use Apache rewrite rules to force redirect links to SEO links ? for example : user.php?id=1 to user/1/ .
2. I think that I will use ARC2 to grab triples from html pages. Then store them to the RDF endpoint Store.

Semantic Web

Group organizers

Group notifications

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