Tabnine Logo
GDataConf
Code IndexAdd Tabnine 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)

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 CSV.");
  logger.info("-------------------------------------");
  this.g = g;
  loadConf(conf);
  loadCSV(conf.getLoc());
  logger.info("CSV 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

  • Finding current android device location
  • setScale (BigDecimal)
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JOptionPane (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now