Index: modules/dnet-openaireplus-workflows/trunk/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/PrepareLodParamJobNode.java
===================================================================
--- modules/dnet-openaireplus-workflows/trunk/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/PrepareLodParamJobNode.java	(nonexistent)
+++ modules/dnet-openaireplus-workflows/trunk/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/PrepareLodParamJobNode.java	(revision 45641)
@@ -0,0 +1,84 @@
+package eu.dnetlib.msro.openaireplus.workflows.nodes;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.googlecode.sarasvati.Arc;
+import com.googlecode.sarasvati.NodeToken;
+import com.mongodb.DBObject;
+import com.mongodb.client.MongoCollection;
+import com.mongodb.client.model.Filters;
+import com.mongodb.client.model.Sorts;
+import eu.dnetlib.common.logging.DnetLogger;
+import eu.dnetlib.common.logging.dao.DnetLoggerMongoDao;
+import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+public class PrepareLodParamJobNode extends SimpleJobNode {
+
+	/**
+	 * logger.
+	 */
+	private static final Log log = LogFactory.getLog(PrepareLodParamJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM
+	private static final String SYSTEM_PROFILE_ID = "system:profileId";
+	private static final String LOG_DATE = "log:date";
+	private static final String IS_COMPLETED_SUCCESSFULLY = "system:isCompletedSuccessfully";
+
+	@Value("${dnet.openaire.lod.jsonrels}")
+	private String lodJsonRels;
+
+	@Value("${dnet.openaire.lod.wfId}")
+	private String lodWfId;
+
+	@Value("${dnet.openaire.lod.default.date}")
+	private String defaultLodDate;
+
+	@Autowired
+	private DnetLogger dnetLogger;
+
+	@Autowired
+	private DnetLoggerMongoDao mongoDao;
+
+	private final SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
+
+	@Override
+	protected String execute(final NodeToken token) throws Exception {
+
+		log.info("prepare LOD update job");
+
+		token.getEnv().setAttribute("lod_jsonRels", lodJsonRels);
+		token.getEnv().setAttribute("lod_lastExecutionDate", getFormattedDate());
+
+		return Arc.DEFAULT_ARC;
+	}
+
+	/**
+	 * Queries the MSRO logger to find the last time the LOD update workflow was successfully executed.
+	 * @return
+	 *  the formatted date
+	 */
+	private String getFormattedDate() {
+		final DBObject dbo = getLoggerDao()
+				.find(Filters.and(Filters.eq(SYSTEM_PROFILE_ID, lodWfId), Filters.eq(IS_COMPLETED_SUCCESSFULLY, "true")))
+				.sort(Sorts.descending(LOG_DATE))
+				.limit(1)
+				.first();
+
+		if (dbo == null || !dbo.containsField(LOG_DATE)) {
+			log.warn(String.format("Cannot find log entry for LOD update workflow, using default date: '%s'", defaultLodDate));
+			return defaultLodDate;
+		}
+
+		final String lastExecutionDate = dateFormat.format(new Date((Long) dbo.get(LOG_DATE)));
+		log.debug(String.format("Last LOD execution date: '%s'", lastExecutionDate));
+		return lastExecutionDate;
+	}
+
+	private MongoCollection<DBObject> getLoggerDao() {
+		return mongoDao.getDb().getCollection(dnetLogger.getName(), DBObject.class);
+	}
+
+}
Index: modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/test/profiles/openaireplus/workflows/provision/lod.update.xml
===================================================================
--- modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/test/profiles/openaireplus/workflows/provision/lod.update.xml	(nonexistent)
+++ modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/test/profiles/openaireplus/workflows/provision/lod.update.xml	(revision 45641)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RESOURCE_PROFILE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<HEADER>
+		<RESOURCE_IDENTIFIER value="42c42eeb-8cf4-4410-bdf5-a20db879d23b_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl"/>
+		<RESOURCE_TYPE value="WorkflowDSResourceType"/>
+		<RESOURCE_KIND value="WorkflowDSResources"/>
+		<RESOURCE_URI value=""/>
+		<DATE_OF_CREATION value="2014-12-12T12:13:51.0Z" />
+	</HEADER>
+	<BODY>
+		<WORKFLOW_NAME>Update LOD</WORKFLOW_NAME>
+		<WORKFLOW_TYPE>Provision</WORKFLOW_TYPE>
+		<WORKFLOW_PRIORITY>30</WORKFLOW_PRIORITY>
+		<CONFIGURATION start="manual">
+			<NODE name="fetchEntityLinks" type="LoadEntityLinksJob" isStart="true">
+				<DESCRIPTION />
+				<PARAMETERS/>
+				<ARCS>
+					<ARC to="updateLod" />
+				</ARCS>
+			</NODE>
+			<NODE name="prepareOozieParams" type="PrepareStatsParams" isStart="true">
+				<DESCRIPTION />
+				<PARAMETERS/>
+				<ARCS>
+					<ARC to="updateLod" />
+				</ARCS>
+			</NODE>
+			<NODE name="prepareLodParams" type="PrepareLodParams" isStart="true">
+				<DESCRIPTION />
+				<PARAMETERS/>
+				<ARCS>
+					<ARC to="updateLod" />
+				</ARCS>
+			</NODE>
+			<NODE name="updateLod" type="SubmitHadoopJob" isJoin="true">
+				<DESCRIPTION>Update stats DB</DESCRIPTION>
+				<PARAMETERS>
+					<PARAM required="true" type="string" name="cluster" managedBy="system">DM</PARAM>
+					<PARAM required="true" type="string" name="hadoopJob" managedBy="system">lodExportJob</PARAM>
+					<PARAM required="true" type="string" name="sysParams" managedBy="system">
+						{
+						'lod_hbase_table' : 'hbase.mapred.datatable'
+						}
+					</PARAM>
+					<PARAM required="true" type="string" name="envParams" managedBy="system">
+						{
+						'nameNode' : 'nameNode',
+						'jobTracker' : 'jobTracker',
+						'isLookupEndpoint' : 'isLookupEndpoint',
+						'lod_indexConf' : 'index.entity.links'.
+						'lod_jsonRels' : 'lod_jsonRels',
+						'lod_lastExecutionDate' : , 'lod_lastExecutionDate'
+						}
+					</PARAM>
+				</PARAMETERS>
+				<ARCS>
+					<ARC to="success" />
+				</ARCS>
+			</NODE>
+		</CONFIGURATION>
+		<STATUS />
+	</BODY>
+</RESOURCE_PROFILE>
+
+
Index: modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/applicationContext-msro-openaireplus.properties
===================================================================
--- modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/applicationContext-msro-openaireplus.properties	(revision 45640)
+++ modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/applicationContext-msro-openaireplus.properties	(revision 45641)
@@ -30,3 +30,7 @@
 dnet.actionmanager.garbage.sets.xupdate=for $x in /RESOURCE_PROFILE[.//RESOURCE_TYPE/@value = 'ActionManagerSetDSResourceType'] let $latest:=$x//LATEST return update replace $x//RAW_SETS with <RAW_SETS>{$latest}</RAW_SETS>
 
 oaf.schema.location = http://www.openaire.eu/schema/0.2/oaf-0.2.xsd
+
+dnet.openaire.lod.jsonrels = { "result": [{ "0": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "1": "http://purl.org/dc/terms/identifier", "2": "http://lod.openaire.eu/vocab/dateOfTransformation", "3": "http://lod.openaire.eu/vocab/dateOfCollection", "4": "http://purl.org/dc/terms/identifier", "5": "http://www.eurocris.org/ontologies/cerif/1.3#name", "6": "http://purl.org/dc/terms/dateAccepted", "7": "http://purl.org/dc/terms/publisher", "8": "http://purl.org/dc/terms/identifier", "9": "http://purl.org/dc/terms/language", "10": "http://purl.org/dc/terms/date", "11": "http://lod.openaire.eu/vocab/resultSubject", "12": "http://lod.openaire.eu/vocab/externalReference", "13": "http://purl.org/dc/terms/source", "14": "http://purl.org/dc/terms/format", "15": "http://lod.openaire.eu/vocab/context", "16": "http://dbpedia.org/ontology/country", "17": "http://purl.org/dc/terms/accessRights", "18": "http://purl.org/dc/terms/description", "19": "http://lsdis.cs.uga.edu/projects/semdis/opus#journal_name", "20": "http://lod.openaire.eu/vocab/dataSourceType", "21": "http://lod.openaire.eu/vocab/device", "22": "http://lod.openaire.eu/vocab/size", "23": "http://lod.openaire.eu/vocab/version", "24": "http://lod.openaire.eu/vocab/lastMetadataUpdate", "25": "http://lod.openaire.eu/vocab/metadataVersion", "26": "http://lod.openaire.eu/vocab/year", "27": "http://lod.openaire.eu/vocab/resultType", "28": "http://lod.openaire.eu/vocab/trust", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://www.eurocris.org/ontologies/cerif/1.3#ResultEntity" }], "person": [{ "0": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "1": "http://purl.org/dc/terms/identifier", "2": "http://lod.openaire.eu/vocab/dateOfTransformation", "3": "http://lod.openaire.eu/vocab/dateOfCollection", "4": "http://purl.org/dc/terms/identifier", "5": "http://xmlns.com/foaf/0.1/firstName", "6": "http://xmlns.com/foaf/spec/lastName", "7": "http://xmlns.com/foaf/0.1/name", "8": "http://schema.org/faxNumber", "9": "http://xmlns.com/foaf/0.1/mbox", "10": "http://xmlns.com/foaf/0.1/phone", "11": "http://schema.org/nationality", "12": "http://purl.org/dc/terms/identifier", "13": "http://lod.openaire.eu/vocab/trust", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http: //xmlns.com/foaf/0.1/Person" }], "datasource": [{ "0": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "1": "http://purl.org/dc/terms/identifier", "2": "http://lod.openaire.eu/vocab/dateOfTransformation", "3": "http://lod.openaire.eu/vocab/dateOfCollection", "4": "http://purl.org/dc/terms/identifier", "5": "http://lod.openaire.eu/vocab/datasourceType", "6": "http://lod.openaire.eu/vocab/openAIRECompatibility", "7": "http://dbpedia.org/ontology/officialName", "8": "http://lod.openaire.eu/vocab/englishName", "9": "http://schema.org/url", "10": "http://xmlns.com/foaf/0.1/logo", "11": "http://xmlns.com/foaf/0.1/mbox", "12": "http://purl.org/vocab/vann/preferredNamespacePrefix", "13": "http://www.w3.org/2003/01/geo/wgs84_pos#lat", "14": "http://www.w3.org/2003/01/geo/wgs84_pos#long", "15": "http://lod.openaire.eu/vocab/dateOfValidity", "16": "http://purl.org/dc/terms/description", "17": "http://lod.openaire.eu/vocab/subjectList", "18": "http://lod.openaire.eu/numberOfItems", "19": "http://purl.org/dc/terms/date", "20": "http://lod.openaire.eu/vocab/policies", "21": "http://lod.openaire.eu/vocab/languages", "22": "http://lod.openaire.eu/vocab/contentType", "23": "http://lod.openaire.eu/vocab/accessInfoPackage", "24": "http://lod.openaire.eu/vocab/releaseStartDate", "25": "http://lod.openaire.eu/vocab/releaseEndDate", "26": "http://lod.openaire.eu/vocab/missionStatementUrl", "27": "http://www.europeana.eu/schemas/edm/dataProvider", "28": "http://lod.openaire.eu/vocab/serviceProvider", "29": "http://lod.openaire.eu/vocab/databaseAccessType", "30": "http://lod.openaire.eu/vocab/dataUploadType", "31": "http://lod.openaire.eu/vocab/dataUploadRestrictions", "32": "http://lod.openaire.eu/vocab/versioning", "33": "http://lod.openaire.eu/vocab/citationGuidelineUrl", "34": "http://lod.openaire.eu/vocab/qualityManagementKind", "35": "http://lod.openaire.eu/vocab/pidSystems", "36": "http://lod.openaire.eu/vocab/certificates", "37": "http://purl.org/dc/terms/accessRights", "38": "http://lod.openaire.eu/vocab/trust", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http: //www.w3.org/ns/prov#Entity" }], "organization": [{ "0": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "1": "http://purl.org/dc/terms/identifier", "2": "http://lod.openaire.eu/vocab/dateOfTransformation", "3": "http://lod.openaire.eu/vocab/dateOfCollection", "4": "http://purl.org/dc/terms/identifier", "5": "http://www.w3.org/2004/02/skos/core#altLabel", "6": "http://www.w3.org/2004/02/skos/core#prefLabel", "7": "http://lod.openaire.eu/vocab/webSiteUrl", "8": "http://xmlns.com/foaf/0.1/logo", "9": "http://dbpedia.org/ontology/country", "10": "http://lod.openaire.eu/vocab/entityType", "11": "http://lod.openaire.eu/vocab/trust", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http: //xmlns.com/foaf/0.1/Organization" }], "project": [{ "0": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "1": "http://purl.org/dc/terms/identifier", "2": "http://lod.openaire.eu/vocab/dateOfTransformation", "3": "http://lod.openaire.eu/vocab/dateOfCollection", "4": "http://purl.org/dc/terms/identifier", "5": "http://lod.openaire.eu/vocab/projectCode", "6": "http://schema.org/url", "7": "http://www.eurocris.org/ontologies/cerif/1.3#acronym", "8": "http://www.eurocris.org/ontologies/cerif/1.3#name", "9": "http://www.eurocris.org/ontologies/cerif/1.3#startDate", "10": "http://www.eurocris.org/ontologies/cerif/1.3#endDate", "11": "http://purl.org/cerif/frapo/hasCallIdentifier", "12": "http://www.eurocris.org/ontologies/cerif/1.3#keyword", "13": "http://www.w3.org/2006/time#hasDurationDescription", "14": "http://lod.openaire.eu/vocab/ec_SC39", "15": "http://lod.openaire.eu/vocab/contractType", "16": "http://lod.openaire.eu/vocab/oaMandatePublications", "17": "http://lod.openaire.eu/vocab/projectSubjects", "18": "http://od.openaire.eu/vocab/ec_article29-3", "19": "http://lod.openaire.eu/vocab/funder", "20": "http://lod.openaire.eu/vocab/fundingLevel0", "21": "http://lod.openaire.eu/vocab/fundingLevel1", "22": "http://lod.openaire.eu/vocab/fundingLevel2", "23": "http://lod.openaire.eu/vocab/fundingLevel3", "24": "http://lod.openaire.eu/vocab/trust", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://www.eurocris.org/ontologies/cerif/1.3#Project" }] }
+dnet.openaire.lod.wfId = 42c42eeb-8cf4-4410-bdf5-a20db879d23b_V29ya2Zsb3dEU1Jlc291cmNlcy9Xb3JrZmxvd0RTUmVzb3VyY2VUeXBl
+dnet.openaire.lod.default.date = 01/01/1970
Index: modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/applicationContext-msro-openaire-nodes.xml
===================================================================
--- modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/applicationContext-msro-openaire-nodes.xml	(revision 45640)
+++ modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/applicationContext-msro-openaire-nodes.xml	(revision 45641)
@@ -130,6 +130,10 @@
           class="eu.dnetlib.msro.openaireplus.workflows.nodes.PrepareStatsParamJobNode"
           scope="prototype"/>
 
+    <bean id="wfNodePrepareLodParams"
+          class="eu.dnetlib.msro.openaireplus.workflows.nodes.PrepareLodParamJobNode"
+          scope="prototype"/>
+
     <bean id="wfNodeFinalizeIndexFeeding"
           class="eu.dnetlib.msro.openaireplus.workflows.nodes.index.FinalizeIndexJobNode"
           scope="prototype"/>
