Paul Lam
Paul Lam

Reputation: 1819

how to represent a property to a property in RDF

Say I have a triple of user, action type, object like so:

andy visited url1
andy visited url2

How would I encode a timestamp value to these relations so we know andy visited url1 before url2?

Is RDF even the right data model to use or should I be using a property graph?

Upvotes: 2

Views: 138

Answers (1)

Michael
Michael

Reputation: 4886

You could model it by making the visit it's own Resource to which you can attach data:

:Andy :visited [ 
  :url <the_visited_url>; 
  :timestamp "the timestamp"^^xsd:dateTime 
].

Or:

:Visit1 a :Visit; 
  :visitedBy :Andy; 
  :url <the_visited_url>; 
  :timestamp "the timestamp"^^xsd:dateTime.

In either case, the visit itself is a concept, which lets you say whatever you want about it, including when it happened or what URL was visited.

Upvotes: 2

Related Questions