Examples of EntityDefinition


Examples of org.apache.jena.query.text.EntityDefinition

        // Base data
        Dataset ds1 = DatasetFactory.createMem() ;

        // Define the index mapping
        EntityDefinition entDef = new EntityDefinition("uri", "text", RDFS.label.asNode()) ;

        // Lucene, in memory.
        Directory dir =  new RAMDirectory();
       
        // Join together into a dataset
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

  private static final Resource specNoMapProperty;
  private static final Resource specNoPrimaryFieldDef;
 
  @Test public void EntityHasPrimaryField() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(null, spec1, null);
    assertEquals(SPEC1_DEFAULT_FIELD, entityDef.getPrimaryField());
  }
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

    assertEquals(SPEC1_DEFAULT_FIELD, entityDef.getPrimaryField());
  }
 
  @Test public void EntityHasEntityField() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(null, spec1, null);
    assertEquals(SPEC1_ENTITY_FIELD, entityDef.getEntityField());   
  }
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

    assertEquals(SPEC1_ENTITY_FIELD, entityDef.getEntityField());   
  }
 
  @Test public void EntityHasMapEntries() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(null, spec1, null);
    assertEquals(SPEC1_PREDICATE.asNode(), getOne(entityDef,SPEC1_DEFAULT_FIELD));
  }
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

        return x.iterator().next() ;
    }

    @Test public void EntityHasMultipleMapEntries() {
    EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
    EntityDefinition entityDef = entDefAssem.open(null, spec2, null);
    assertEquals(SPEC2_PREDICATE1.asNode(), getOne(entityDef,SPEC2_DEFAULT_FIELD));
    assertEquals(SPEC2_PREDICATE2.asNode(), getOne(entityDef, SPEC2_FIELD2));
  }
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

    assertEquals(SPEC2_PREDICATE2.asNode(), getOne(entityDef, SPEC2_FIELD2));
  }
   
    @Test public void EntityHasMapEntryWithSimpleAnalyzer() {
      EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
      EntityDefinition entityDef = entDefAssem.open(Assembler.general, spec3,  null);
      assertEquals(SimpleAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
    }
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

      assertEquals(SimpleAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
    }
   
    @Test public void EntityHasMapEntryWithStandardAnalyzerAndStopWords() {
      EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
      EntityDefinition entityDef = entDefAssem.open(Assembler.general, spec4,  null);
      assertEquals(StandardAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
    }
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

      assertEquals(StandardAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
    }
   
    @Test public void EntityHasMapEntryWithKeywordAnalyzer() {
      EntityDefinitionAssembler entDefAssem = new EntityDefinitionAssembler();
      EntityDefinition entityDef = entDefAssem.open(Assembler.general, spec5,  null);
      assertEquals(KeywordAnalyzer.class, entityDef.getAnalyzer(SPEC1_DEFAULT_FIELD).getClass());
    }   
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

                File dir = new File(path) ;
                directory = FSDirectory.open(dir) ;
            }

            Resource r = GraphUtils.getResourceValue(root, pEntityMap) ;
            EntityDefinition docDef = (EntityDefinition)a.open(r) ;

            return TextDatasetFactory.createLuceneIndex(directory, docDef) ;
        } catch (IOException e) {
            IO.exception(e) ;
            return null ;
View Full Code Here

Examples of org.apache.jena.query.text.EntityDefinition

            server = new HttpSolrServer( uri );
        else
            throw new TextIndexException("URI for the server must begin 'http://'") ;
       
        Resource r = GraphUtils.getResourceValue(root, pEntityMap) ;
        EntityDefinition docDef = (EntityDefinition)a.open(r) ;
        return TextDatasetFactory.createSolrIndex(server, docDef) ;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.