Ad

Is There A Way To Represent Temporal Data In RDFs?

- 1 answer

I have bunch of temporal data which I want to convert to RDF format. Is there any accepted way of doing so?


Example of tabulated data which should be somehow converted into RDF format:

| Name   | Date      | Salary     |
-----------------------------------
| John   | Jan 2012  |      3,244 |
| John   | Feb 2012  |      4,012 |
| John   | Mar 2012  |      3,112 |

Found one way to do it, however it is rather cubersome and introduce very large vocabularies. Assuming syntax (Subject, Predicate, Object)

(JohnJan2012, date, Jan 2012)
(JohnJan2012, name, John)
(JohnJan2012, salary, 3244)

Does anyone know of a better way to do it?

Ad

Answer

You can use bNodes here and do, in Turtle syntax, something like:

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:john :salary [
      :amount "3244.0"^^xsd:decimal;
      :date "2012-01-01T00:00:00"^^xsd:datetime;
] .

:john :salary [
      :amount "4012.0"^^xsd:decimal;
      :date "2012-02-01T00:00:00"^^xsd:datetime;
] .

Here I am creating two records of those examples you gave. the [] syntax creates a blank node that is basically a node without a name (URI). From each of these blank nodes in the example we have two pieces of information date and amount.

Also, make sure you use valid xsd:datetime dates if you want to use SPARQL later on to query your data.

Ad
source: stackoverflow.com
Ad