Package org.apache.jena.query.text

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


            Collection<Node> c = mapDefs.get(defaultField) ;
            if ( c == null )
                throw new TextIndexException("No definition of primary field '"+defaultField+"'") ;
        }
       
        EntityDefinition docDef = new EntityDefinition(entityField, defaultField, graphField) ;
        for ( String f : mapDefs.keys() ) {
            for ( Node p : mapDefs.get(f))
                docDef.set(f, p) ;
        }
        for (String f : analyzerDefs.keySet()) {
          docDef.setAnalyzer(f, analyzerDefs.get(f));
        }
        return docDef ;
    }
View Full Code Here

            if ( c == null )
                throw new TextIndexException("No definition of primary field '"+defaultField+"'") ;
        }
       
       
        EntityDefinition docDef = new EntityDefinition(entityField, defaultField) ;
        for ( String f : mapDefs.keys() ) {
            for ( Node p : mapDefs.get(f))
                docDef.set(f, p) ;
        }
        return docDef ;
    }
View Full Code Here

            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

  public DumpQueryExecutor(Model m, String propertyUri, boolean ngramIndex,int minGram, int maxGram){
    loaded = true;
    this.propertyUri = propertyUri;
   
    Dataset ds1 = DatasetFactory.createMem();
    EntityDefinition entDef = new EntityDefinition("uri", "text",m.getResource(propertyUri)) ;

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

    // -- Read and index all literal strings.
    Model model = ModelFactory.createDefaultModel();
    model.read(in, null,"TTL");
   
    Dataset ds1 = DatasetFactory.createMem();
    EntityDefinition entDef = new EntityDefinition("uri", "text",model.getResource(propertyUri)) ;

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

        // 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

            if ( c == null )
                throw new TextIndexException("No definition of primary field '"+defaultField+"'") ;
        }
       
       
        EntityDefinition docDef = new EntityDefinition(entityField, defaultField, graphField) ;
        for ( String f : mapDefs.keys() ) {
            for ( Node p : mapDefs.get(f))
                docDef.set(f, p) ;
        }
        return docDef ;
    }
View Full Code Here

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

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

TOP

Related Classes of org.apache.jena.query.text.EntityDefinition

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.