Package org.dbpedia2sql.stream

Examples of org.dbpedia2sql.stream.TriplesReader


public class Main {
  public static void main(String[] args) throws Exception {
    TypeResolver types = new TypeResolver();
   
    TriplesReader typesReader = new TriplesReader("/home/clement/osm/dbpedia-to-sql/data/types/types_fr.nt.gz");
    int i = 0;
    while (true) {
      Triple t = typesReader.nextTriple();
      if (t == null) break;
      LinkTriple lt = (LinkTriple)t;
      lt.setSubject(URISimplifier.simplify(lt.getSubject()));
      types.addTypeDeclaration((LinkTriple)t);
      if (++i % 10000 == 0) {
        System.out.println("Read " + i + " types");
      }
    }
   
    TriplesReader props1 = new TriplesReader("/home/clement/osm/dbpedia-to-sql/data/data/props_fr.snt.gz");
    TriplesReader props2 = new TriplesReader("/home/clement/osm/dbpedia-to-sql/data/data/infobox_fr.snt.gz");
    MergedInputStream mis = new MergedInputStream();
    mis.addInput(props1);
    mis.addInput(props2);

    mis.start();
View Full Code Here

TOP

Related Classes of org.dbpedia2sql.stream.TriplesReader

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.