1

I am using Refine with RDF Extension to produce triples from a CSV. I have imported two vocabularies and am now using them to describe the columns: RDF Schema Alignment

How can I change the nodes to describe resources rather than literals? For example, when I preview the Turtle representation, the triples map to literals, such as geolink:hasDocumentType "datasets": RDF preview Turtle

Can I create empty nodes in Refine to hold the place of resources, such as Document Type? Thanks!

Sara Lafia
  • 135
  • 1
  • 1
  • 8

1 Answers1

2

This is assigned in the dialog for the mapping. See "The cell's content is used ..." and then choose "as a URI".

enter image description here

(sorry for the broken dialog rendering)

Then you choose "Use custom expression" where you can make up your own URI scheme. In this example I simply add the value of the cell to a fix URI pattern:

"http://classifications.data.admin.ch/municipality/"+value

In the preview you can directly see if this is what you need.

If I need to do more complex things I usually create simple key-value like RDF, so technically not really a graph yet. Then I write a bunch of SPARQL CONSTRUCT queries to clean up the data and transform it into a "real" graph. I found that for many things easier and faster. You can see some examples on Github

Adrian Gschwend
  • 664
  • 8
  • 16
  • I noticed in an example that I can set "nodeType" to "cell-as-literal" or "cell-as-resource". How can I configure this in Refine? – Sara Lafia Nov 13 '16 at 02:10
  • Also, is there a way to export the RDF skeleton? – Sara Lafia Nov 13 '16 at 03:04
  • 1
    Where did you find these nodeTypes? Can't remember seeing them. Regarding export, the only way to export a configuration is by copying it from the [undo/redo change history](https://github.com/OpenRefine/OpenRefine/wiki/History) in OpenRefine. You will get a JSON structure with the commands. – Adrian Gschwend Nov 13 '16 at 08:33