Package de.fuberlin.wiwiss.d2rq.parser

Examples of de.fuberlin.wiwiss.d2rq.parser.MapParser


   * @param mapModel a Jena model containing the D2RQ map
   * @param baseURIForData Base URI for turning relative URI patterns into
   *     absolute URIs; if <tt>null</tt>, then D2RQ will pick a base URI
   */
  public ModelD2RQ(Model mapModel, String baseURIForData) {
    super(new GraphD2RQ(new MapParser(mapModel,
        (baseURIForData == null) ? "http://localhost/resource/" : baseURIForData).parse()), BuiltinPersonalities.model); // BuiltinPersonalities.model really required?
  }
View Full Code Here


    return mapModel;
  }

  public Mapping getMapping() {
    if (mapping == null) {
      mapping = new MapParser(getMappingModel(), getResourceBaseURI()).parse();
      mapping.configuration().setUseAllOptimizations(fastMode);
      if (connectedDB != null) {
        // Hack! We don't want the Database to open another ConnectedDB,
        // so we check if it's connected to the same DB, and in that case
        // make it use the existing ConnectedDB that we already have opened.
View Full Code Here

  private String complexQuery;

  protected void setUp() throws Exception {
    mapModel = ModelFactory.createDefaultModel();
    mapModel.read(D2RQTestSuite.ISWC_MAP, "http://test/", "TURTLE");
    MapParser parser = new MapParser(mapModel, null);
    databases = parser.parse().databases();
    firstDatabase = (Database)databases.iterator().next();
    simplestQuery = "SELECT 1;";
    // mediumQuery = "SELECT PaperID from papers";
    mediumQuery = "SELECT DISTINCT papers.PaperID FROM rel_paper_topic, papers, topics WHERE papers.PaperID=rel_paper_topic.PaperID AND rel_paper_topic.TopicID=topics.TopicID AND topics.TopicID=3 AND rel_paper_topic.RelationType = 1 AND papers.Publish = 1;";
    complexQuery = "SELECT T0_Papers.PaperID, T0_Persons.URI, T1_Persons.Email, T1_Persons.URI FROM persons AS T1_Persons, papers AS T0_Papers, rel_person_paper AS T0_Rel_Person_Paper, persons AS T0_Persons WHERE T0_Persons.PerID=T0_Rel_Person_Paper.PersonID AND T0_Papers.PaperID=T0_Rel_Person_Paper.PaperID AND T0_Papers.Publish = 1 AND T0_Persons.URI=T1_Persons.URI AND (NOT (CONCAT('http://www.conference.org/conf02004/paper#Paper' , CAST(T0_Papers.PaperID AS char) , '') = T0_Persons.URI));";
View Full Code Here

    MappingGenerator generator = new MappingGenerator(cdb);
    return generator.mappingModel(EX);
  }
 
  private Mapping generateDefaultMapping() {
    return new MapParser(generateDefaultMappingModel(), EX).parse();
  }
View Full Code Here

   * @param testFileName Filename, relative to {@link D2RQTestSuite}'s location
   * @return A mapping
   * @throws D2RQException On error during parse
   */
  public static Mapping readFromTestFile(String testFileName) {
    return new MapParser(
        D2RQTestSuite.loadTurtle(testFileName),
        "http://example.org/").parse();
  }
View Full Code Here

  public static void main(String[] args) {
    // Load mapping file
    Model mapModel = FileManager.get().loadModel("doc/example/mapping-iswc.ttl");
   
    // Parse mapping file
    MapParser parser = new MapParser(mapModel, "http://localhost:2020/");
    Mapping mapping = parser.parse();
   
    // Set up the GraphD2RQ
    GraphD2RQ g = new GraphD2RQ(mapping);

    // Create a find(spo) pattern
View Full Code Here

  public static Collection<TripleRelation> loadPropertyBridges(String mappingFileName) {
    Model m = ModelFactory.createDefaultModel();
    Resource dummyDB = m.getResource(Test.DummyDatabase.getURI());
    dummyDB.addProperty(RDF.type, D2RQ.Database);
    m.read(D2RQTestSuite.class.getResourceAsStream(mappingFileName), null, "TURTLE");
    Mapping mapping = new MapParser(m, null).parse();
    return mapping.compiledPropertyBridges();
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.parser.MapParser

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.