Fork me on GitHub
#rdf
<
2022-12-22
>
simongray09:12:08

I have some data that is newly introduced into an existing dataset. What kind of relation/attribute can I use to mark the date it was added?

simongray10:12:57

Thank you @U02QE89BCPR! yes, I think that’ll do. I had found dc:date, but that seemed too general to me.

👍 1
simongray10:12:24

how do you prefer to represent the dates? Just using ISO strings or used XSD Datetime?

simongray10:12:45

leaning towards just using strings…

kotlenik10:12:54

It made us a headaches often, so we stick always to typed literals using XSD datetime. But, if you have single store and fixed usage scenarios, you may use strings. But some day it may hurt you, so to speak.

simongray10:12:24

the issue I have with XSD Datetime is that it is too specific. I really just need a symbolic calendar date. It’s too bad this doesn’t seem to exist for RDF.

simongray10:12:28

Timezones screw everything up

kotlenik10:12:26

It is hard almost in every storage, because of a lot of formats people all over the world use. Not only timezones, but also the historic way people note dates. Eventually, you end up with wrapper around your store for data import making sure you have at your side unified approach. This is important if you have data coming from i.e. Asia, EU and US. It may differ significantly and is worth of effort to unify.

rickmoynihan11:12:05

There is xsd:date too, we tend to use this and xsd:dateTime for time literals

🙏 1
simongray12:12:03

Oh, I never noticed that

simongray12:12:33

Hmmm…. Jena seems to have a weird model-dependent relationship with datatypes https://jena.apache.org/documentation/notes/typed-literals.html

simongray12:12:52

At least programmatically

Eric Scott13:12:57

I keep thinking about a reification scheme like this:

gregorian:2022\/12\/22 a gregorian:Date;
  rdfs:label "2022-12-22"^xsd:date;
  gregorian:duringYear gregorian:2022;
  gregorian:duringMonth gregorian:2022\/12;
  gregorian:weeklyRecurrenceOf gregorian:DayOfWeek\/Thursday;
  gregorian:monthyRecurrenceOf gregorian:DayOfMonth\/22;
  gregorian:annualRecurrenceOf gregorian:DayOfYear\/12\/22;
...
.
Wouldn't be that hard to publish. Would that make anyone's life easier? Has something like this already been published somewhere?

Eric Scott13:12:54

Come to think of it day of week might better be numbered, then labeled with "Thursday"@en

Eric Scott14:12:24

Using '-' instead of '\/' would probably be less hassle.

rickmoynihan14:12:11

@UB3R8UYA1: yes http://reference.data.gov.uk until very recently ran a time uri service, which would generate things like that when dereferenced. It was particularly useful for things like “government years” etc. Unfortunately they sunsetted the service a few months ago, and a bunch of our gov clients use it, we’re hoping they’ll reinstate it on the original domain soon. Regardless the code that used to run it is here: https://github.com/epimorphics/IntervalServer

🙏 1
rickmoynihan14:12:15

> Hmmm…. Jena seems to have a weird model-dependent relationship with datatypes https://jena.apache.org/documentation/notes/typed-literals.html @U4P4NREBY what do you think is weird? The difference between lexical form and its entailment? Or not leaving datatypes open to ontology definition?

simongray15:12:40

I would just have expected that I could do (XSDDate. "2022-12-22") or something similar since it seems perfectly able to independently consume that literal if it’s read in via an RDF dataset file.

simongray15:12:29

So why is it suddenly tied to the model when doing it programmatically?

simongray15:12:36

Makes no sense to me.

rickmoynihan15:12:44

still not sure what you mean

simongray15:12:11

The way I bootstrap my database is by generating a bunch of triples (represented as sets of vectors in Aristotle). I then add these triples to my database graph contained in an Apache Jena Model instance. However, if I want to add triples with XSDDate literals to my model I have to have access to the model in order to create those literals, which suddenly couples the model to those literals. It turns my neat one-way flow of bootstrapping into a directed acyclic graph since the data that is imported into the model (apparently) needs to be created in the model before it can be added to the model. However, if I consume a .ttl file with some XSDDates in it, I don’t need to know the model in advance. They are somehow able to exist independently while the ones I create programmatically are not.

rickmoynihan15:12:31

I’m still not sure I follow 🙂 Though I don’t have as much experience with jena, so I could be missing something… but a model (as I understand it) is just an object / handle onto an in memory graph. createLiteral is essentially just a factory / constructor function for literals (which can presumably include dates). If you don’t want to couple it to the database model; then can you not just make a different one?!

simongray15:12:29

It might just be a case of createLiteral being defined as an instance method when it should really be a static method.

simongray15:12:53

Wait, there is also NodeFactory/createLiteral . Maybe the documtation is just misleading/out of date.

simongray15:12:26

Well, in that case, there’s no issue it seems!

👍 1
rickmoynihan15:12:49

I agree it should really be a static method

rickmoynihan15:12:33

Jena’s api’s are a bit weird in places; I’ve always found RDF4j to be much cleaner… though not quite as fully featured.

simongray15:12:31

I’m deep in OWL land, so Jena was the best fit

rickmoynihan15:12:50

Yeah RDF4j has a lot less support on that front