rdf

simongray 2022-12-22T09:14:08.998249Z

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?

kotlenik 2022-12-22T10:00:52.896269Z

Maybe these could fit the purpose : https://www.dublincore.org/specifications/dublin-core/dcmi-terms/terms/issued/ , https://www.dublincore.org/specifications/dublin-core/dcmi-terms/terms/modified/ . We use them for tracking resources over time in one of the projects.

simongray 2022-12-22T10:04:57.382539Z

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

👍 1
simongray 2022-12-22T10:08:24.958299Z

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

simongray 2022-12-22T10:08:45.242109Z

leaning towards just using strings…

kotlenik 2022-12-22T10:09:54.285399Z

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.

simongray 2022-12-22T10:10:18.900399Z

Hmmm…

simongray 2022-12-22T10:11:24.122799Z

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.

simongray 2022-12-22T10:13:28.851139Z

Timezones screw everything up

kotlenik 2022-12-22T10:15:26.166119Z

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.

simongray 2022-12-22T10:16:13.727309Z

😕

2022-12-22T11:58:05.304969Z

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

🙏 1
simongray 2022-12-22T12:07:03.285589Z

Oh, I never noticed that

simongray 2022-12-22T12:09:33.408969Z

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

simongray 2022-12-22T12:09:52.151339Z

At least programmatically

2022-12-22T13:30:57.886609Z

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?

2022-12-22T13:46:54.007349Z

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

2022-12-22T14:04:24.460519Z

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

2022-12-22T14:30:11.706529Z

@eric.d.scott: 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
2022-12-22T14:34:15.214819Z

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

simongray 2022-12-22T15:26:40.803649Z

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.

simongray 2022-12-22T15:27:29.294399Z

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

simongray 2022-12-22T15:27:36.656609Z

Makes no sense to me.

2022-12-22T15:42:44.850859Z

still not sure what you mean

simongray 2022-12-22T15:45:11.576539Z

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.

2022-12-22T15:52:31.668579Z

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?!

simongray 2022-12-22T15:53:29.531329Z

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

simongray 2022-12-22T15:54:53.484069Z

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

simongray 2022-12-22T15:55:26.342679Z

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

👍 1
2022-12-22T15:56:49.548309Z

I agree it should really be a static method

2022-12-22T15:57:33.053389Z

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.

simongray 2022-12-22T15:58:31.577569Z

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

2022-12-22T15:58:50.920429Z

Yeah RDF4j has a lot less support on that front