Is there a way to represent temporal data in RDFs?
Asked Answered
B

2

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?

Brittbritta answered 23/2, 2012 at 15:47 Comment(0)
K
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.

Kirit answered 23/2, 2012 at 20:17 Comment(0)
S
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

Scholarship answered 25/2, 2012 at 0:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.