Skip to content

Commit

Permalink
Added type to dateTimeValue
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinovg committed Feb 13, 2025
1 parent a6f8546 commit d8d7313
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import static edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary.Precision.DAY;
import static edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary.Precision.MONTH;
import static edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary.Precision.YEAR;
import static org.apache.jena.datatypes.xsd.XSDDatatype.XSDdateTime;
import static org.apache.jena.rdf.model.ResourceFactory.createTypedLiteral;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -1232,7 +1234,7 @@ protected boolean addDateToResource(VitroRequest vreq, Resource work, ResourceMo
}

Resource dateResource = model.createResource(getUnusedUri(vreq)).addProperty(RDF.type, model.getResource("http://vivoweb.org/ontology/core#DateTimeValue"));
dateResource.addProperty(model.createProperty(VIVO_DATETIME), formattedDate);
dateResource.addProperty(model.createProperty(VIVO_DATETIME), createTypedLiteral(formattedDate, XSDdateTime));
dateResource.addProperty(model.createProperty(VIVO_DATETIMEPRECISION), model.createResource(precision));

work.addProperty(model.createProperty(VIVO_DATETIMEVALUE), dateResource);
Expand Down

0 comments on commit d8d7313

Please sign in to comment.