diff --git a/src/main/resources/c-adapter/asn/asn.js b/src/main/resources/c-adapter/asn/asn.js index 22fd6a837..5b504286b 100644 --- a/src/main/resources/c-adapter/asn/asn.js +++ b/src/main/resources/c-adapter/asn/asn.js @@ -518,7 +518,12 @@ function importJsonLdGraph(graph, context) { objToSave.addOwner(EcPk.fromPem(owner)); if (objToSave["dcterms:language"] == null || objToSave["dcterms:language"] === undefined) { - objToSave["dcterms:language"] = "en"; + if (EcConceptScheme.template["dcterms:language"] != null) { + objToSave["dcterms:language"] = EcConceptScheme.template["dcterms:language"]; + } + else { + objToSave["dcterms:language"] = "en"; + } } else { lang = objToSave["dcterms:language"]; diff --git a/src/main/resources/c-adapter/case/caseIngest.js b/src/main/resources/c-adapter/case/caseIngest.js index 901ef9f2a..e0f4ca345 100644 --- a/src/main/resources/c-adapter/case/caseIngest.js +++ b/src/main/resources/c-adapter/case/caseIngest.js @@ -67,7 +67,7 @@ setDateCreated = function(object) { }; getTimestamp = function(object) { - var timestamp = object["@id"].substring(object["@id"].lastIndexOf("/") + 1); + var timestamp = object["id"].substring(object["id"].lastIndexOf("/") + 1); if (timestamp.matches("[0-9]+")) { return Integer.parseInt(timestamp); } else { @@ -88,10 +88,14 @@ convertCFDocumentToFramework = function (document) { document["@context"] = caseToCassSchema; document = jsonLdExpand(JSON.stringify(document)); document = jsonLdCompact(JSON.stringify(document), cassContext); + f.copyFrom(document); + if ((f["schema:inLanguage"] == null || f["schema:inLanguage"] === undefined) + && EcFramework.template != null && EcFramework.template["schema:inLanguage"] != null) { + f["schema:inLanguage"] = EcFramework.template["schema:inLanguage"]; + } if (EcFramework.template != null && EcFramework.template["schema:dateCreated"] != null) { - setDateCreated(document); + setDateCreated(f); } - f.copyFrom(document); return f; } @@ -129,11 +133,11 @@ convertCFItemIntoCompetency = function (a) { } a = jsonLdExpand(JSON.stringify(a)); a = jsonLdCompact(JSON.stringify(a), cassContext); - if (EcCompetency.template != null && EcCompetency.template["schema:dateCreated"] != null) { - setDateCreated(a); - } var r = new EcCompetency(); r.copyFrom(a); + if (EcCompetency.template != null && EcCompetency.template["schema:dateCreated"] != null) { + setDateCreated(r); + } return r; } diff --git a/src/main/resources/c-adapter/ceasn/ceasn.js b/src/main/resources/c-adapter/ceasn/ceasn.js index fb027c51b..d40b18810 100644 --- a/src/main/resources/c-adapter/ceasn/ceasn.js +++ b/src/main/resources/c-adapter/ceasn/ceasn.js @@ -773,7 +773,12 @@ function importCeFrameworkToCass(frameworkObj, competencyList) { f.addOwner(EcPk.fromPem(owner)); if (f["schema:inLanguage"] == null || f["schema:inLanguage"] === undefined) { - f["schema:inLanguage"] = "en"; + if (EcFramework.template["schema:inLanguage"] != null) { + f["schema:inLanguage"] = EcFramework.template["schema:inLanguage"]; + } + else { + f["schema:inLanguage"] = "en"; + } } if (f["schema:dateCreated"] == null || f["schema:dateCreated"] === undefined) {