Package org.data2semantics.tools.rdf

Examples of org.data2semantics.tools.rdf.RDFFileDataSet$RDFFileFilter


  }



  private static void createTask2DataSet(double fraction, long seed) {
    RDFFileDataSet d = new RDFFileDataSet(dataFile, RDFFormat.TURTLE);

    dataset = d;

    Random rand = new Random(seed);
View Full Code Here


    long[] seeds = {11, 21, 31, 41, 51, 61, 71, 81, 91, 101};
    double[] cs = {0.001, 0.01, 0.1, 1, 10, 100, 1000}

    int[] depths = {1, 2, 3};
    int[] iterations = {0, 2, 4, 6};
    dataset = new RDFFileDataSet(dataDir, RDFFormat.NTRIPLES);

    ResultsTable resTable = new ResultsTable();
    resTable.setManWU(0.05);
    resTable.setDigits(3);
View Full Code Here

    System.out.println(resTable);
   
  }
 
  private static void createCommitteeMemberPredictionDataSet() {
    RDFFileDataSet testSetA = new RDFFileDataSet("datasets/iswc-2011-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/eswc-2011-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/eswc-2012-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/eswc-2008-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/eswc-2009-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/iswc-2012-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/iswc-2011-complete.rdf", RDFFormat.RDFXML);
    testSetA.addFile("datasets/iswc-2010-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/iswc-2009-complete.rdf", RDFFormat.RDFXML);
    //testSetA.addFile("datasets/iswc-2008-complete.rdf", RDFFormat.RDFXML);

    RDFFileDataSet testSetB = new RDFFileDataSet("datasets/iswc-2012-complete.rdf", RDFFormat.RDFXML);

    instances = new ArrayList<Resource>();
    List<Resource> instancesB = new ArrayList<Resource>();
    labels = new ArrayList<Value>();
    List<Statement> stmts = testSetA.getStatementsFromStrings(null, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "http://xmlns.com/foaf/0.1/Person");
    for (Statement stmt : stmts) {
      instancesB.add(stmt.getSubject());
   

    int pos = 0, neg = 0;
    for (Resource instance : instancesB) {
      if (!testSetB.getStatements(instance, null, null).isEmpty()) {
        instances.add(instance);
        if (testSetB.getStatementsFromStrings(instance.toString(), "http://data.semanticweb.org/ns/swc/ontology#holdsRole", "http://data.semanticweb.org/conference/iswc/2012/pc-member/research", false).size() > 0) {
          labels.add(testSetA.createLiteral("true"));
          pos++;
        } else {
          labels.add(testSetA.createLiteral("false"));
          neg++;
View Full Code Here

  }



  private static void createTask2DataSet(double fraction, long seed) {
    RDFFileDataSet d = new RDFFileDataSet(dataFile, RDFFormat.TURTLE);

    dataset = d;

    Random rand = new Random(seed);
View Full Code Here

    }

  }

  private static void createTask1DataSet() {
    RDFFileDataSet train = new RDFFileDataSet(dataDir + "LDMC_Task1_train.ttl", RDFFormat.TURTLE);
    RDFFileDataSet test = new RDFFileDataSet(dataDir + "LDMC_Task1_test.ttl", RDFFormat.TURTLE);
   
    RDFFileDataSet d = new RDFFileDataSet(dataDir + "LDMC_Task1_train.ttl", RDFFormat.TURTLE);
    d.addFile(dataDir + "LDMC_Task1_test.ttl", RDFFormat.TURTLE);
    dataset = d;

    List<Statement> stmts = train.getStatementsFromStrings(null, RDF.TYPE.toString(), "http://purl.org/procurement/public-contracts#Contract");
    instances = new ArrayList<Resource>();
    labels = new ArrayList<Value>();
View Full Code Here

    }

  }

  private static void createTask2DataSet() {
    RDFFileDataSet train = new RDFFileDataSet(dataDir + "LDMC_Task2_train.ttl", RDFFormat.TURTLE);
    RDFFileDataSet test = new RDFFileDataSet(dataDir + "LDMC_Task2_test.ttl", RDFFormat.TURTLE);
   
    RDFFileDataSet d = new RDFFileDataSet(dataDir + "LDMC_Task2_train.ttl", RDFFormat.TURTLE);
    d.addFile(dataDir + "LDMC_Task2_test.ttl", RDFFormat.TURTLE);
    dataset = d;

    List<Statement> stmts = train.getStatementsFromStrings(null, RDF.TYPE.toString(), "http://purl.org/procurement/public-contracts#Contract");
    instances = new ArrayList<Resource>();
    labels = new ArrayList<Value>();
View Full Code Here

  }


  @Main
  public RDFDataSet createDataSet() {   
    dataset = new RDFFileDataSet(filename, format)
    return dataset;
  }
View Full Code Here

  }



  private static void createTask2DataSet(double fraction, long seed) {
    RDFFileDataSet d = new RDFFileDataSet(dataDir + "LDMC_Task2_train.ttl", RDFFormat.TURTLE);

    dataset = d;

    Random rand = new Random(seed);
View Full Code Here

  private static void createAffiliationPredictionDataSet(double frac) {
    Random rand = new Random(1);

    // Read in data set
    dataset = new RDFFileDataSet(dataFile, RDFFormat.N3);

    // Extract all triples with the affiliation predicate
    List<Statement> stmts = dataset.getStatementsFromStrings(null, "http://swrc.ontoware.org/ontology#affiliation", null);

    // initialize the lists of instances and labels
View Full Code Here

        i++;
        dataDir = args[i];
      }
    }
   
    dataset = new RDFFileDataSet(dataDir, RDFFormat.NTRIPLES);
    long[] seeds = {11,21,31};
    long tic, toc;

    double[] fractions = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1};
 
View Full Code Here

TOP

Related Classes of org.data2semantics.tools.rdf.RDFFileDataSet$RDFFileFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.