Skip to content

Reconstructing a conversion into an RDFa table

Timothy Lebo edited this page Feb 14, 2012 · 9 revisions
csv2rdf4lod-automation is licensed under the [Apache License, Version 2.0](https://github.com/timrdf/csv2rdf4lod-automation/wiki/License)

(Note, this starts to overlap with the vsr project; see https://github.com/timrdf/vsr/wiki/RDFa.)

PREFIX dcterms:    <http://purl.org/dc/terms/>
PREFIX conversion: <http://purl.org/twc/vocab/conversion/>
PREFIX ov:         <http://open.vocab.org/terms/>

SELECT ?row ?col ?s ?p ?o
WHERE {
  GRAPH <http://logd.tw.rpi.edu/source/epa-gov-mcmahon-ethan/dataset/environmental-reports/version/2011-Jan-12>  {
    ?s dcterms:isReferencedBy 
       <http://logd.tw.rpi.edu/source/epa-gov-mcmahon-ethan/dataset/environmental-reports/enviro-reports-and-indicators>;
       ov:csvRow ?row; 
       ?p ?o .
    ?p ov:csvCol ?col .
    optional { ?p conversion:enhancement_layer ?e } filter(!bound(?e))
    filter(?row > 0 and ?row < 50)
  }
} ORDER BY ?row ?col ?s ?p ?o
```

Find the dimensions of the table:
```
PREFIX dcterms:    <http://purl.org/dc/terms/>
PREFIX ov:         <http://open.vocab.org/terms/>

SELECT max(?row) as ?rows max(?col) as ?cols
WHERE {
  {GRAPH <http://logd.tw.rpi.edu/source/epa-gov-mcmahon-ethan/dataset/environmental-reports/version/2011-Jan-12>  {
    ?s dcterms:isReferencedBy 
       <http://logd.tw.rpi.edu/source/epa-gov-mcmahon-ethan/dataset/environmental-reports/enviro-reports-and-indicators>;
       ov:csvRow ?row .
  }}
  union
  {GRAPH <http://logd.tw.rpi.edu/source/epa-gov-mcmahon-ethan/dataset/environmental-reports/version/2011-Jan-12>  {
    ?p ov:csvCol ?col
  }}
}
```

### See also

* <http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes> - the go-to reference for the attributes and what they do.
Clone this wiki locally