ckanvirtuosoopenlink-virtuoso

How can I automate CKAN data exportation to Virtuoso Open Source Edition?


I'm developing an open data portal with Drupal and CKAN. But now client wants to add Virtuoso Open Source service as a SPARQL endpoint and linked data tool.

The system architecture is similar to the following image of datos.gob.es (Spanish government's open data portal).

datos.gob.es system architecture

I'm having difficulty understanding the data loading dynamics from CKAN to Virtuoso, and official documentation doesn't help at all.

By now I have found next options but do not satisfy my actual problem.

Perfect scenario would be a kind of bypass connection that when you upload new dataset to CKAN automatically upload its rdf file to Virtuoso.

I don't know if i am totally lost with Virtuoso functionality. But is there a way to connect CKAN to Virtuoso so that it gets the .rdf or .ttl files automatically? Thanks.


Solution

  • One way might be to develop a small cKan extension with a custom plugin that executes when a resource is added, gets the dataset rdf from cKan, and makes and http put request to put the resource in virtuoso. It looks like virtuoso supports http/put.

    http://vos.openlinksw.com/owiki/wiki/VOS/VirtRDFInsert#HTTP%20PUT

    $ curl -T kidehen.n3 http://cname/DAV/home/demo/MyData/ -u demo:demo
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <HTML>
        <HEAD>
          <TITLE>201 Created</TITLE>
        </HEAD>
        <BODY>
          <H1>Created</H1>Resource /DAV/home/demo/MyData/kidehen.n3 has been created.
        </BODY>
      </HTML>
    

    Here's the documentation example on creating a plugin. https://seanh-ckan.readthedocs.io/en/latest/plugins/