Package org.apache.stanbol.entityhub.servicesapi.query

Examples of org.apache.stanbol.entityhub.servicesapi.query.FieldQueryFactory


     * In case {@link CacheStrategy#all} this Method returns the query factory of the Cache. Otherwise it
     * returns {@link DefaultQueryFactory#getInstance()}.
     */
    @Override
    public FieldQueryFactory getQueryFactory() {
        FieldQueryFactory factory = null;
        if (siteConfiguration.getCacheStrategy() == CacheStrategy.all) {
            Cache cache = getCache();
            if (cache != null) {
                factory = cache.getQueryFactory();
            }
View Full Code Here


            return Response.noContent().build();
        }
        pattern = pattern.trim();
        pattern += "*";

        FieldQueryFactory qf = DefaultQueryFactory.getInstance();
        FieldQuery fieldQuery = qf.createFieldQuery();
        Collection<String> selectedFields = new ArrayList<String>();
        selectedFields.add(DEFAULT_AUTOCOMPLETE_SEARCH_FIELD);
        fieldQuery.addSelectedFields(selectedFields);
        fieldQuery.setConstraint(DEFAULT_AUTOCOMPLETE_SEARCH_FIELD, new TextConstraint(pattern,
                PatternType.wildcard, false, "en"));
View Full Code Here

    public Map<String,List<RelatedKeyword>> search(String keyword, String ontologyURI) throws SearchException {
        return search(keyword);
    }

    private FieldQuery getFieldQuery(String keyword) {
        FieldQueryFactory qf = DefaultQueryFactory.getInstance();
        FieldQuery fieldQuery = qf.createFieldQuery();
        Collection<String> selectedFields = new ArrayList<String>();
        selectedFields.add(RDFS.label.getUnicodeString());
        fieldQuery.addSelectedFields(selectedFields);
        fieldQuery.setConstraint(RDFS.label.getUnicodeString(), new TextConstraint(keyword,
                PatternType.wildcard, false, "en"));
View Full Code Here

     * @param textWithDoubleQuote
     * @param patternType
     */
    private String generateSparqlQueryString(String textWithDoubleQuote, PatternType patternType) {
      int limit = 10;
      FieldQueryFactory qf = DefaultQueryFactory.getInstance();
      FieldQuery query = qf.createFieldQuery();
     
      String DEFAULT_AUTOCOMPLETE_SEARCH_FIELD = NamespaceEnum.rdfs+"label";
     
      Collection<String> selectedFields = new ArrayList<String>();
      selectedFields.add(DEFAULT_AUTOCOMPLETE_SEARCH_FIELD);
View Full Code Here

        // ... and check the values

        log.debug("Process {}", namedEntity);
        // if site is NULL use
        // the Entityhub
        FieldQueryFactory queryFactory = site == null ? entityhub.getQueryFactory() : site.getQueryFactory();

        log.trace("Will use a query-factory of type [{}].", queryFactory.getClass().toString());

        FieldQuery query = queryFactory.createFieldQuery();

        // replace spaces with plus to create an AND search for all words in the
        // name!
        Constraint labelConstraint;
        // TODO: make case sensitivity configurable
View Full Code Here

     * In case {@link CacheStrategy#all} this Method returns the query factory of the Cache. Otherwise it
     * returns {@link DefaultQueryFactory#getInstance()}.
     */
    @Override
    public FieldQueryFactory getQueryFactory() {
        FieldQueryFactory factory = null;
        if (siteConfiguration.getCacheStrategy() == CacheStrategy.all) {
            if (cache != null) {
                factory = cache.getQueryFactory();
            }
        }
View Full Code Here

     * query factory of the Cache.
     * Otherwise it returns {@link DefaultQueryFactory#getInstance()}.
     */
    @Override
    public FieldQueryFactory getQueryFactory() {
        FieldQueryFactory factory = null;
        if(siteConfiguration.getCacheStrategy() == CacheStrategy.all){
            Cache cache = getCache();
            if(cache != null){
                factory = cache.getQueryFactory();
            }
View Full Code Here

        // ... and check the values

        log.debug("Process {}", namedEntity);
        // if site is NULL use
        // the Entityhub
        FieldQueryFactory queryFactory = site == null ? entityhub.getQueryFactory() : site.getQueryFactory();

        log.trace("Will use a query-factory of type [{}].", queryFactory.getClass().toString());

        FieldQuery query = queryFactory.createFieldQuery();

        // replace spaces with plus to create an AND search for all words in the
        // name!
        Constraint labelConstraint;
        // TODO: make case sensitivity configurable
View Full Code Here

    public Map<String,List<RelatedKeyword>> search(String keyword, String ontologyURI) throws SearchException {
        return search(keyword);
    }

    private FieldQuery getFieldQuery(String keyword) {
        FieldQueryFactory qf = DefaultQueryFactory.getInstance();
        FieldQuery fieldQuery = qf.createFieldQuery();
        Collection<String> selectedFields = new ArrayList<String>();
        selectedFields.add(RDFS.label.getUnicodeString());
        fieldQuery.addSelectedFields(selectedFields);
        fieldQuery.setConstraint(RDFS.label.getUnicodeString(), new TextConstraint(keyword,
                PatternType.wildcard, false, "en"));
View Full Code Here

            return Response.noContent().build();
        }
        pattern = pattern.trim();
        pattern += "*";

        FieldQueryFactory qf = DefaultQueryFactory.getInstance();
        FieldQuery fieldQuery = qf.createFieldQuery();
        Collection<String> selectedFields = new ArrayList<String>();
        selectedFields.add(DEFAULT_AUTOCOMPLETE_SEARCH_FIELD);
        fieldQuery.addSelectedFields(selectedFields);
        fieldQuery.setConstraint(DEFAULT_AUTOCOMPLETE_SEARCH_FIELD, new TextConstraint(pattern,
                PatternType.wildcard, false, "en"));
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.query.FieldQueryFactory

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.