Codota Logo
GDataConf
Code IndexAdd Codota to your IDE (free)

How to use
GDataConf
in
slib.graph.io.conf

Best Java code snippets using slib.graph.io.conf.GDataConf (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: com.github.sharispe/slib-graph-io

if (data.getFormat() == GFormat.OBO) {
  return new GraphLoader_OBO_1_2();
} else if (data.getFormat() == GFormat.GAF2) {
  return new GraphLoader_GAF_2();
} else if (data.getFormat() == GFormat.RDF_XML) {
  return new RDFLoader(RDFFormat.RDFXML);
} else if (data.getFormat() == GFormat.NTRIPLES) {
  return new RDFLoader(RDFFormat.NTRIPLES);
} else if (data.getFormat() == GFormat.TURTLE) {
  return new RDFLoader(RDFFormat.TURTLE);
} else if (data.getFormat() == GFormat.CSV) {
  return new GraphLoader_CSV();
} else if (data.getFormat() == GFormat.SNOMED_CT_RF2) {
  return new GraphLoaderSnomedCT_RF2();
} else if (data.getFormat() == GFormat.SLIB) {
  return new GraphLoader_SLIB();
} else if (data.getFormat() == GFormat.MESH_XML) {
  return new GraphLoader_MESH_XML();
} else if (data.getFormat() == GFormat.TSV_ANNOT) {
  return new GraphLoader_TSVannot();
} else if (data.getFormat() == GFormat.WORDNET_DATA) {
  return new GraphLoader_Wordnet();
} else {
  throw new SLIB_Ex_Critic("Unknown Graph format " + data.getFormat());
origin: com.github.sharispe/slib-graph-io

private void loadConf(GDataConf conf) throws SLIB_Ex_Critic {
  String header = (String) conf.getParameter(PARAM_HEADER);
  String prefixSubjectParam = (String) conf.getParameter(PARAM_PREFIX_SUBJECT);
  String prefixObjectParam = (String) conf.getParameter(PARAM_PREFIX_OBJECT);
  String predicateParam = (String) conf.getParameter(PARAM_PREDICATE);
  logger.info("file            " + conf.getLoc());
  logger.info("Skipping header " + skipHeader);
  logger.info("predicate       '" + predicate + "'");
origin: sharispe/slib

@Override
public boolean isValid() {
  if (uri == null) {
    return false;
  }
  for (GDataConf dataFile : data) {
    if (!dataFile.isValid()) {
      return false;
    }
  }
  for (GAction action : actions) {
    if (!action.isValid()) {
      return false;
    }
  }
  return true;
}
origin: sharispe/slib

logger.info("Loading from Wordnet data");
if (conf.getFormat() != GFormat.WORDNET_DATA) {
  throw new SLIB_Ex_Critic("Cannot use " + this.getClass() + " to load file format " + conf.getFormat() + ", required format is " + GFormat.WORDNET_DATA);
String filepath = conf.getLoc();
if (conf.getParameter("prefix") != null) {
  uriPrefix = (String) conf.getParameter("prefix");
origin: sharispe/slib

  public static void main(String[] args) throws SLIB_Exception {
    String dataloc = "/data/WordNet/WordNet-3.1/dict/";

    // We create the graph
    URIFactory factory = URIFactoryMemory.getSingleton();
    URI guri = factory.getURI("http://graph/wordnet/");
    G wordnet = new GraphMemory(guri);

    // We load the data into the graph
    GraphLoader_Wordnet_Full loader = new GraphLoader_Wordnet_Full();

    GDataConf dataNoun = new GDataConf(GFormat.WORDNET_DATA, dataloc + "data.noun");
    GDataConf dataVerb = new GDataConf(GFormat.WORDNET_DATA, dataloc + "data.verb");
    GDataConf dataAdj = new GDataConf(GFormat.WORDNET_DATA, dataloc + "data.adj");
    GDataConf dataAdv = new GDataConf(GFormat.WORDNET_DATA, dataloc + "data.adv");

    loader.populate(dataNoun, wordnet);
    loader.populate(dataVerb, wordnet);
    loader.populate(dataAdj, wordnet);
    loader.populate(dataAdv, wordnet);
  }
}
origin: sharispe/slib

@Override
public void populate(GDataConf conf, G g) throws SLIB_Exception {
  logger.info("-------------------------------------");
  logger.info("Loading Annotations using TSV loader.");
  logger.info("-------------------------------------");
  this.g = g;
  loadConf(conf);
  loadTSV(conf.getLoc());
  logger.info("TSV specification loaded.");
  logger.info("-------------------------------------");
}
origin: sharispe/slib

String concept_file = (String) conf.getParameter(ARG_CONCEPT_FILE);
String relationship_file = (String) conf.getParameter(ARG_RELATIONSHIP_FILE);
String prefix = (String) conf.getParameter(ARG_PREFIX);
if (conf.existsParam(ARG_LOAD_INACTIVE_CONCEPTS)) {
  String load_inactive_concepts = conf.getParameter(ARG_LOAD_INACTIVE_CONCEPTS).toString();
if (conf.existsParam(ARG_LOAD_INACTIVE_RELATIONSHIPS)) {
  String load_inactive_relationships = conf.getParameter(ARG_LOAD_INACTIVE_RELATIONSHIPS).toString();
origin: com.github.sharispe/slib-graph-io

private void loadConf(GDataConf conf) throws SLIB_Ex_Critic {
  String header = (String) conf.getParameter("header");
  if (header == null || Util.stringToBoolean(header) == true) {
    skipHeader = true;
  }
  logger.info("Skipping header " + skipHeader);
  String separator = (String) conf.getParameter("separator");
  if (separator == null) {
    pattern = Pattern.compile("\\t");
  } else {
    pattern = Pattern.compile(separator);
  }
  HashMap<Integer, CSV_Mapping> mappingsLocal = (HashMap<Integer, CSV_Mapping>) conf.getParameter("mappings");
  HashMap<Integer, CSV_StatementTemplate> statementTemplatesLocal = (HashMap<Integer, CSV_StatementTemplate>) conf.getParameter("statementTemplates");
  if (mappingsLocal != null) {
    this.mappings.putAll(mappingsLocal);
  }
  if (statementTemplatesLocal != null) {
    this.statementTemplates.putAll(statementTemplatesLocal);
  }
  if (this.mappings.isEmpty()) {
    throw new SLIB_Ex_Critic("Please specify a mapping for CSV loader");
  }
  if (this.statementTemplates.isEmpty()) {
    throw new SLIB_Ex_Critic("Please specify a statement template for CSV loader");
  }
}
origin: com.github.sharispe/slib-tools-module

gDataConf.addParameter("mappings", mappings);
gDataConf.addParameter("statementTemplates", stmtemplates);
origin: com.github.sharispe/slib-graph-io

logger.info("Loading from Wordnet data");
if (conf.getFormat() != GFormat.WORDNET_DATA) {
  throw new SLIB_Ex_Critic("Cannot use " + this.getClass() + " to load file format " + conf.getFormat() + ", required format is " + GFormat.WORDNET_DATA);
String filepath = conf.getLoc();
if (conf.getParameter("prefix") != null) {
  uriPrefix = (String) conf.getParameter("prefix");
origin: com.github.sharispe/slib-graph-io

  public static void main(String[] args) throws Exception {

    URIFactoryMemory factory = URIFactoryMemory.getSingleton();
    G graph = new GraphMemory(factory.getURI("http://mesh"));
    GraphLoader_MESH_XML loader = new GraphLoader_MESH_XML();
    loader.populate(new GDataConf(GFormat.MESH_XML, "/data/mesh/desc2013.xml"), graph);
    URI dna_barcoding = factory.getURI("http://D058893");
    System.out.println(graph);

    System.out.println(graph.containsVertex(dna_barcoding));

  }
}
origin: com.github.sharispe/slib-graph-io

@Override
public void populate(GDataConf conf, G g) throws SLIB_Exception {
  loadConf(conf);
  logger.info("-------------------------------------");
  logger.info(" RDF Loader");
  logger.info("-------------------------------------");
  logger.info("Populate graph " + g.getURI() + " from " + conf.getLoc());
  load(g, conf.getLoc());
  logger.info("Graph " + g.getURI() + " populated by RDF data ");
  logger.info("-------------------------------------");
}
origin: com.github.sharispe/slib-graph-io

String concept_file = (String) conf.getParameter(ARG_CONCEPT_FILE);
String relationship_file = (String) conf.getParameter(ARG_RELATIONSHIP_FILE);
String prefix = (String) conf.getParameter(ARG_PREFIX);
if (conf.existsParam(ARG_LOAD_INACTIVE_CONCEPTS)) {
  String load_inactive_concepts = conf.getParameter(ARG_LOAD_INACTIVE_CONCEPTS).toString();
if (conf.existsParam(ARG_LOAD_INACTIVE_RELATIONSHIPS)) {
  String load_inactive_relationships = conf.getParameter(ARG_LOAD_INACTIVE_RELATIONSHIPS).toString();
origin: sharispe/slib

private void loadConf(GDataConf conf) throws SLIB_Ex_Critic {
  String header = (String) conf.getParameter("header");
  if (header == null || Util.stringToBoolean(header) == true) {
    skipHeader = true;
  }
  logger.info("Skipping header " + skipHeader);
  String separator = (String) conf.getParameter("separator");
  if (separator == null) {
    pattern = Pattern.compile("\\t");
  } else {
    pattern = Pattern.compile(separator);
  }
  HashMap<Integer, CSV_Mapping> mappingsLocal = (HashMap<Integer, CSV_Mapping>) conf.getParameter("mappings");
  HashMap<Integer, CSV_StatementTemplate> statementTemplatesLocal = (HashMap<Integer, CSV_StatementTemplate>) conf.getParameter("statementTemplates");
  if (mappingsLocal != null) {
    this.mappings.putAll(mappingsLocal);
  }
  if (statementTemplatesLocal != null) {
    this.statementTemplates.putAll(statementTemplatesLocal);
  }
  if (this.mappings.isEmpty()) {
    throw new SLIB_Ex_Critic("Please specify a mapping for CSV loader");
  }
  if (this.statementTemplates.isEmpty()) {
    throw new SLIB_Ex_Critic("Please specify a statement template for CSV loader");
  }
}
origin: sharispe/slib

gDataConf.addParameter("mappings", mappings);
gDataConf.addParameter("statementTemplates", stmtemplates);
origin: sharispe/slib

private void loadConf(GDataConf conf) throws SLIB_Ex_Critic {
  String header = (String) conf.getParameter(PARAM_HEADER);
  String prefixSubjectParam = (String) conf.getParameter(PARAM_PREFIX_SUBJECT);
  String prefixObjectParam = (String) conf.getParameter(PARAM_PREFIX_OBJECT);
  String predicateParam = (String) conf.getParameter(PARAM_PREDICATE);
  logger.info("file            " + conf.getLoc());
  logger.info("Skipping header " + skipHeader);
  logger.info("predicate       '" + predicate + "'");
origin: sharispe/slib

logger.info("Loading from Wordnet data");
if (conf.getFormat() != GFormat.WORDNET_DATA) {
  throw new SLIB_Ex_Critic("Cannot use " + this.getClass() + " to load file format " + conf.getFormat() + ", required format is " + GFormat.WORDNET_DATA);
String filepath = conf.getLoc();
if (conf.getParameter("prefix") != null) {
  uriPrefix = (String) conf.getParameter("prefix");
origin: sharispe/slib

  public static void main(String[] args) throws Exception {

    URIFactoryMemory factory = URIFactoryMemory.getSingleton();
    G graph = new GraphMemory(factory.getURI("http://mesh"));
    GraphLoader_MESH_XML loader = new GraphLoader_MESH_XML();
    loader.populate(new GDataConf(GFormat.MESH_XML, "/data/mesh/desc2013.xml"), graph);
    URI dna_barcoding = factory.getURI("http://D058893");
    System.out.println(graph);

    System.out.println(graph.containsVertex(dna_barcoding));

  }
}
origin: com.github.sharispe/slib-graph-io

@Override
public void populate(GDataConf conf, G g) throws SLIB_Exception {
  logger.info("-------------------------------------");
  logger.info("Loading Annotations using TSV loader.");
  logger.info("-------------------------------------");
  this.g = g;
  loadConf(conf);
  loadTSV(conf.getLoc());
  logger.info("TSV specification loaded.");
  logger.info("-------------------------------------");
}
origin: sharispe/slib

if (data.getFormat() == GFormat.OBO) {
  return new GraphLoader_OBO_1_2();
} else if (data.getFormat() == GFormat.GAF2) {
  return new GraphLoader_GAF_2();
} else if (data.getFormat() == GFormat.RDF_XML) {
  return new RDFLoader(RDFFormat.RDFXML);
} else if (data.getFormat() == GFormat.NTRIPLES) {
  return new RDFLoader(RDFFormat.NTRIPLES);
} else if (data.getFormat() == GFormat.TURTLE) {
  return new RDFLoader(RDFFormat.TURTLE);
} else if (data.getFormat() == GFormat.CSV) {
  return new GraphLoader_CSV();
} else if (data.getFormat() == GFormat.SNOMED_CT_RF2) {
  return new GraphLoaderSnomedCT_RF2();
} else if (data.getFormat() == GFormat.SLIB) {
  return new GraphLoader_SLIB();
} else if (data.getFormat() == GFormat.MESH_XML) {
  return new GraphLoader_MESH_XML();
} else if (data.getFormat() == GFormat.TSV_ANNOT) {
  return new GraphLoader_TSVannot();
} else if (data.getFormat() == GFormat.WORDNET_DATA) {
  return new GraphLoader_Wordnet();
} else {
  throw new SLIB_Ex_Critic("Unknown Graph format " + data.getFormat());
slib.graph.io.confGDataConf

Most used methods

  • <init>
  • addParameter
  • existsParam
  • getFormat
  • getLoc
  • getParameter
  • isValid

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Path (java.nio.file)
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now