Package fr.inria.jfresnel.sesame

Examples of fr.inria.jfresnel.sesame.FresnelSesameParser


public void setFresnelRepository(Repository fresnelRepo) {
  fresnelRepository = fresnelRepo;
}

public Document render(Repository fresnelRepo, String uri, Repository dataRepo) throws ParserConfigurationException {
  FresnelSesameParser parser = new FresnelSesameParser();
  FresnelDocument fd = parser.parse(fresnelRepo, uri);
  setFresnelRepository(fresnelRepo);
  return render(fd, dataRepo);
}
View Full Code Here


    //fje = new FSLSesameEvaluator();
   
    // instantiate a Fresnel parser that will create lenses and formats to be applied on a Sesame model
    //FresnelSesameParser fp = new FresnelSesameParser(nsr, fhs);
   
    FresnelSesameParser fp = new FresnelSesameParser();
    fd = new FresnelDocument();
    defaultLenses = new FresnelDocument();
   
    // actually parse a Fresnel document, written in Notation 3

 
    /*loading the RDF data from f file in the Sesame store*/
    /*System.out.println("here!!");
    Repository fresnelRepository = new SailRepository(new MemoryStore());
    System.out.println("here**!");
    try {
        fresnelRepository.initialize();
        System.out.println("here1*!!");
        RepositoryConnection connection = fresnelRepository.getConnection();
        System.out.println("here1**!!");
        connection.add(lensFile, lensFile.toURL().toString(), RDFFormat.N3);
        System.out.println("here1***!!");
        FSLNSResolver nsr = null;
      if (nsr == null) {
        RepositoryResult<Namespace> nsi = connection.getNamespaces();
        Namespace ns;
        nsr = new FSLNSResolver();
        while (nsi.hasNext()){
          ns = nsi.next();
          nsr.addPrefixBinding(ns.getPrefix(), ns.getName());
        }
      }
      System.out.println("here2!!");
    }
    catch (Exception ex){
        System.out.println("Fresnel: Error: Failed to load RDF data from " + lensFile.toString());
        ex.printStackTrace();
    }  */
   
    fd = fp.parse(lenaConfig.getLensFile(), Constants.N3_READER)

   
    //The lenses, formats and groups can then be obtained as follows:
    /*
    Lens[] lenses = fd.getLenses();
    System.out.println("LENSES found:");   
    for (Lens l:lenses){
      System.out.println(l);
    }
    fr.inria.jfresnel.Format[] formats = fd.getFormats();
    System.out.println("FORMATS found:\n");
    for (fr.inria.jfresnel.Format f:formats) {
      System.out.println(f);
    }
    */
   
    // init default lens fresnel document
    defaultLenses=fp.parse(lenaConfig.getDefaultLensFile(), Constants.N3_READER);
   
   
    //renderer=new SesameRenderer();
    //renderer=new LenaRenderer();
    rendererSetFresnelRepository(fp.getFresnelRepository());
    init();
   
    System.out.println("Initialization of JFresnelEngine successfully finished!");   
  }
View Full Code Here

    boolean remoteRepo = false;
    boolean lensGiven;
    boolean resourceGiven;
    boolean classGiven;
   
    FresnelSesameParser fp = new FresnelSesameParser();
    fd = fp.parse(lenaConfig.getLensFile(), Constants.N3_READER)
    defaultLenses=fp.parse(lenaConfig.getDefaultLensFile(), Constants.N3_READER);
   
   

   
    int offset = ((Integer.parseInt(pageNumber))* lenaConfig.getMaxResourcesPage()) - lenaConfig.getMaxResourcesPage();
View Full Code Here

      fresnelRepository = new SailRepository(new MemoryStore());
        fresnelRepository.initialize();
        RepositoryConnection fresnelConnection = fresnelRepository.getConnection();
       
       
        FresnelSesameParser fp = new FresnelSesameParser();
        File lensFile= new File(TEST_FRESNEL_PROGRAM_FILE_NAME);
      fd = fp.parse(lensFile, Constants.N3_READER);
     
        File fresnelFile = new File(TEST_FRESNEL_PROGRAM_FILE_NAME);
        fresnelConnection.add(fresnelFile, fresnelFile.toURL().toString(), RDFFormat.N3);
      /* Set up the repository that contains RDF data */
      dataRepository = new SailRepository(new MemoryStore());
View Full Code Here

      fresnelRepository = new SailRepository(new MemoryStore());
        fresnelRepository.initialize();
        RepositoryConnection fresnelConnection = fresnelRepository.getConnection();
       
       
        FresnelSesameParser fp = new FresnelSesameParser();
        File lensFile= new File(TEST_FRESNEL_PROGRAM_FILE_NAME);
      fd = fp.parse(lensFile, Constants.N3_READER);
     
        File fresnelFile = new File(TEST_FRESNEL_PROGRAM_FILE_NAME);
        fresnelConnection.add(fresnelFile, fresnelFile.toURL().toString(), RDFFormat.N3);
      /* Set up the repository that contains RDF data */
      dataRepository = new SailRepository(new MemoryStore());
View Full Code Here

TOP

Related Classes of fr.inria.jfresnel.sesame.FresnelSesameParser

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.