Example #1
0
    function (req, res) {
  console.say("elycite API - Ontology - Export");
  var params = restf.requireParams(req, res, "ontology");
  if(params === null) { return; }
  var store = stores.requireExists(res, params.ontology);
  if(store === null) { return; }
  var args = restf.requireArgs(req, res, "filename", "fields[]");
  if(args === null) { return; }
  //var fields = restf.optional(args, 'fields', []);

  concepts.exportConcepts(res, store, args["fields[]"], args.filename);

});
Example #2
0
               function (req, res) {
  console.say("elycite API - Concept/Search");
  var params = restf.requireParams(req, res, "ontology", "cid");
  if(params === null) { return; }
  var store = stores.requireExists(res, params.ontology);
  if(store === null) { return; }
  var conceptId = restf.requireInt(res, "conceptId", params.cid);
  if(conceptId === null) { return; }
  var concept = stores.requireRecord(res, store, "concept", conceptId);
  if(concept === null) { return; }
  concept = restf.requireNotDeleted(concept, "concept");
  if(concept === null) { return; }
  var args = restf.requireArgs(req, res, "query");
  if(args === null) { return; }

  concepts.getConceptSuggestionFromQuery(res, concept, store, args.query);
});
Example #3
0
               function (req, res) {
  console.say("elycite API - Concept GET suggestions");
  var params = restf.requireParams(req, res, "ontology", "cid");
  if(params === null) { return; }
  var store = stores.requireExists(res, params.ontology);
  if(store === null) { return; }
  var conceptId = restf.requireInt(res, "conceptId", params.cid);
  if(conceptId === null) { return; }
  var concept = stores.requireRecord(res, store, "concept", conceptId);
  if(concept === null) { return; }
  concept = restf.requireNotDeleted(res, concept, "concept");
  if(concept === null) { return; }
  var args  = restf.requireArgs(req, res, "fieldName");
  if(args === null) { return; }

  concepts.getConceptSuggestionsByClustering(req, res, concept, store);
});
Example #4
0
               function (req, res) {
  console.say("elycite API - Concept/suggeskeywords");
  var params = restf.requireParams(req, res, "ontology", "cid");
  if(params === null) { return; }
  var store = stores.requireExists(res, params.ontology);
  if(store === null) { return; }
  var conceptId = restf.requireInt(res, "conceptId", params.cid);
  if(conceptId === null) { return; }
  var concept = stores.requireRecord(res, store, "concept", conceptId);
  if(concept === null) { return; }
  concept = restf.requireNotDeleted(res, concept, "concept");
  if(concept === null) { return; }

  var args = restf.requireArgs(req, res, "fieldName");
  var fieldName = args.fieldName[0];
  concepts.getKeywordSuggestions(res, args, concept, fieldName);
});
Example #5
0
               function (req, res) {
  console.say("elycite API - Concept/Query");
  var params = restf.requireParams(req, res, "ontology", "cid");
  if(params === null) { return; }
  var store = stores.requireExists(res, params.ontology);
  if(store === null) { return; }
  var conceptId = restf.requireInt(res, "conceptId", params.cid);
  if(conceptId === null) { return; }
  var concept = stores.requireRecord(res, store, "concept", conceptId);
  if(concept === null) { return; }
  concept = restf.requireNotDeleted(res, concept, "concept");
  if(concept === null) { return; }
  var args = restf.requireArgs(req, res, "docIds");
  if(args === null) { return; }

  //concepts.getConceptDocsFromSearch(res, concept, store, args.docIds, params); 
  documents.getSpecificDocuments(res, store, params.ontology, args.docIds)
});