Wiki

Clone wiki

lmf / Drupal-Module

LMF Drupal Module

LMF is developing a native Drupal module which provides some basic features to use LMF as backend in Drupal.

http://wiki.lmf.googlecode.com/hg/images/drupal/lmf-drupal.png

This module heavily uses the RDFx module, therefore it'd be interesting to read before how RDF works in Drupal.

<wiki:toc />

Source Code

hg clone https://code.google.com/p/lmf.drupal/

Features

  • Drupal nodes importation and synchronization
  • Easy integration of other services (query, search and so on)

Installation

You just need to copy the module into the sites/all/modules directory of your Drupal installation, and enable it in the modules panel, which will require to install all additional dependent modules:

Usage

Once you have installed the module and configured your RDF mappings, you can let LMF to also manage your nodes data.

First you'd need to provide some data to allow the module access LMF:

http://wiki.lmf.googlecode.com/hg/images/drupal/setup.png

Then you would be able to import your nodes into LMF quite easy:

http://wiki.lmf.googlecode.com/hg/images/drupal/import.png

As you can see, currently we are providing three different options to import data:

  1. Single node importantion using its node id
  2. Import all node of a given content type
  3. Import a whole taxonomy defined in your Drupal vocabularies

Then you'd be able to check what's the current status of the data in LMF:

http://wiki.lmf.googlecode.com/hg/images/drupal/status.png

If any content has been modified after being imported, the modules handles that and allows you to re-import it. For the future we are planning to implement some additional hooks within Drupal for being able to automatically do such refreshing of the data.

It's important to say that neither the user nor the developer of another module need to deal with RDF or the LMF web services: the first part is provided by RDFx, and the other is wrapped by the LMF PHP Client Library.

PHP Documentation

For those who need to use the functionality from other modules in Drupal, the list of public methods which are provided by the module façade (the class LMF):

getStaticPage($name) (STATIC)

__construct($uri, $user, $pass)

getUri()

getUser()

getPass()

getConfiguration()

status()

ping()

getPrefixes()

getResourceUrl($uri)

existsResource($uri)

deleteResource($uri)

importResource($uri)

importNode($nid)

importTaxonomy($vid)

importType($type)

execSparql($query)

execLDPath($program)

addReasoningProgram($name, $program)

createSearchCore($core, $configuration)

deleteSearchCore($core)

getRecommendation($query, $core)

It's usage from other modules actually is quite simple:

$lmf = new LMF();
$lmf->callSomeMethod();

since the default constructor automatically takes the missing arguments from the module within Drupal.

Use cases

LMF is not a CMS and does not pretend to replace Drupal as such. Importing your Drupal data into LMF allows to perform some advanced operations:

  • Mix up and enrich your data with other relevant sources of information (from Social Media or the Linked Open Data cloud, for intance) with [[Module Reasoning|reasoning]] support
  • Do [[Module Semantic Search|Semantic Search]] over it
  • Query your data with a more flexible languages, such as SPARQL or LDPath
  • ...

Acknowledgments

This project have been developed by Salzburg Research as part of Salzburg !NewMediaLab – The Next Generation (SNML-TNG), a K-Project in the Austrian COMET programme; and the myTV project, partially funded by the Federal Ministry for Transport Innovation and Technology (BMVIT) and the Austrian Research Promotion Agency (FFG).

Updated