6

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?

2 Answers 2

7

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.

Sign up to request clarification or add additional context in comments.

Comments

7

Original 2012 Answer

For a fuller discussion of the different ways you can represent time in RDF see Ian Davis' s excellent blog post Representing Time in RDF series on this topic


2023 Update

Nowadays 4D Ontologies are gaining a lot of traction as a more formal way to model spatial-temporal relationships within knowledge graphs.

Again Ian Davis' has a new blog post series (on his corporate blog) that covers these.

Disclaimer: As of writing this update in 2023 I work for Ian

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.