org.molgenis.data.Query.pageSize()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.molgenis.data.Query.pageSize方法的一些代码示例,展示了Query.pageSize的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.pageSize方法的具体详情如下:
包路径:org.molgenis.data.Query
类名称:Query
方法名:pageSize

Query.pageSize介绍

暂无

代码示例

代码示例来源:origin: org.molgenis/molgenis-ontology-core

public List<OntologyTerm> findOntologyTerms(String term, int pageSize) {
 Iterable<Entity> ontologyTermEntities;
 // #1 find exact match
 Query<Entity> termNameQuery =
   new QueryImpl<>().eq(OntologyTermMetaData.ONTOLOGY_TERM_NAME, term).pageSize(pageSize);
 ontologyTermEntities = () -> dataService.findAll(ONTOLOGY_TERM, termNameQuery).iterator();
 if (!ontologyTermEntities.iterator().hasNext()) {
  Query<Entity> termsQuery = new QueryImpl<>().search(term).pageSize(pageSize);
  ontologyTermEntities = () -> dataService.findAll(ONTOLOGY_TERM, termsQuery).iterator();
 }
 return Lists.newArrayList(
   Iterables.transform(ontologyTermEntities, OntologyTermRepository::toOntologyTerm));
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

private SearchResult searchDisMaxQuery(String protocolId, Query q)
{
  SearchResult result = null;
  try
  {
    q.pageSize(DEFAULT_RETRIEVAL_DOCUMENTS_SIZE);
    MultiSearchRequest request = new MultiSearchRequest(Arrays.asList(CATALOGUE_PREFIX + protocolId,
        FEATURE_CATEGORY + protocolId), q, null);
    result = searchService.multiSearch(request);
  }
  catch (Exception e)
  {
    result = new SearchResult(e.getMessage());
    logger.error("Exception failed to search the request " + result, e);
  }
  return result;
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

@Override
public long count(Query q)
{
  return searchService.count(AsyncOntologyIndexer.createOntologyTermDocumentType(ontologyIri),
      q.pageSize(Integer.MAX_VALUE).offset(Integer.MIN_VALUE));
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

public List<Hit> getChildren(String ontologyIri, String parentOntologyTermIri, String parentNodePath)
{
  Query q = new QueryImpl().eq(OntologyTermIndexRepository.PARENT_NODE_PATH, parentNodePath).and()
      .eq(OntologyTermIndexRepository.PARENT_ONTOLOGY_TERM_IRI, parentOntologyTermIri).pageSize(5000);
  String documentType = AsyncOntologyIndexer.createOntologyTermDocumentType(ontologyIri);
  List<Hit> listOfHits = new ArrayList<Hit>();
  Set<String> processedOntologyTerms = new HashSet<String>();
  for (Hit hit : searchService.search(new SearchRequest(documentType, q, null)).getSearchHits())
  {
    String ontologyTermIri = hit.getColumnValueMap().get(OntologyTermIndexRepository.ONTOLOGY_TERM_IRI)
        .toString();
    if (!processedOntologyTerms.contains(ontologyTermIri))
    {
      listOfHits.add(hit);
      processedOntologyTerms.add(ontologyTermIri);
    }
  }
  return listOfHits;
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

Query q = new QueryImpl().eq(OntologyTermIndexRepository.PARENT_NODE_PATH, currentNodePath).and()
    .eq(OntologyTermIndexRepository.PARENT_ONTOLOGY_TERM_IRI, currentOntologyTermIri)
    .pageSize(Integer.MAX_VALUE);
String documentType = AsyncOntologyIndexer.createOntologyTermDocumentType(ontologyIri);
SearchRequest searchRequest = new SearchRequest(documentType, q, null);

代码示例来源:origin: org.molgenis/molgenis-ontology-core

public List<OntologyTerm> getAllOntologyTerms(String ontologyId) {
 Entity ontologyEntity =
   dataService.findOne(
     OntologyMetaData.ONTOLOGY,
     new QueryImpl<>().eq(OntologyMetaData.ONTOLOGY_IRI, ontologyId));
 if (ontologyEntity != null) {
  Iterable<Entity> ontologyTermEntities =
    () ->
      dataService
        .findAll(
          OntologyTermMetaData.ONTOLOGY_TERM,
          new QueryImpl<>()
            .eq(OntologyTermMetaData.ONTOLOGY, ontologyEntity)
            .pageSize(Integer.MAX_VALUE))
        .iterator();
  return Lists.newArrayList(
    Iterables.transform(ontologyTermEntities, OntologyTermRepository::toOntologyTerm));
 }
 return Collections.emptyList();
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

@Override
public long count(Query q)
{
  if (q.getRules().size() > 0)
  {
    q.and();
  }
  q.eq(OntologyIndexRepository.ENTITY_TYPE, OntologyIndexRepository.TYPE_ONTOLOGY);
  return searchService.count(null, q.pageSize(Integer.MAX_VALUE).offset(Integer.MIN_VALUE));
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

public Hit findOntologyTerm(String ontologyIri, String ontologyTermIri, String nodePath)
{
  Query q = new QueryImpl().eq(OntologyTermIndexRepository.NODE_PATH, nodePath).and()
      .eq(OntologyTermIndexRepository.ONTOLOGY_TERM_IRI, ontologyTermIri).pageSize(5000);
  String documentType = AsyncOntologyIndexer.createOntologyTermDocumentType(ontologyIri);
  SearchResult result = searchService.search(new SearchRequest(documentType, q, null));
  for (Hit hit : result.getSearchHits())
  {
    if (hit.getColumnValueMap().get(OntologyTermIndexRepository.NODE_PATH).toString().equals(nodePath)) return hit;
  }
  return new Hit(null, documentType, Collections.<String, Object> emptyMap());
}

代码示例来源:origin: org.molgenis/molgenis-data-rest

q.pageSize(EntityCollectionRequest.DEFAULT_ROW_COUNT);

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

Query query = new QueryImpl().eq(NODE_PATH, entry.getKey()).pageSize(Integer.MAX_VALUE);
SearchResult result = searchService.search(new SearchRequest(AsyncOntologyIndexer
    .createOntologyTermDocumentType(ontologyTermContainer.getOntologyIRI()), query, null));

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

STORE_MAPPING_FEATURE, desiredDataElement.getId()).pageSize(Integer.MAX_VALUE), null));

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

private void dynamicEntityMetaData()
{
  EntityMetaData entityMetaData = getEntityMetaData();
  if (entityMetaData instanceof DefaultEntityMetaData)
  {
    DefaultEntityMetaData defaultEntityMetaData = (DefaultEntityMetaData) entityMetaData;
    Set<String> availableAttributes = new HashSet<String>();
    for (AttributeMetaData attributeMetaData : entityMetaData.getAttributes())
    {
      availableAttributes.add(attributeMetaData.getName().toLowerCase());
    }
    SearchResult resultResult = searchService.search(new SearchRequest(AsyncOntologyIndexer
        .createOntologyTermDocumentType(ontologyIri),
        new QueryImpl().eq(OntologyTermQueryRepository.ENTITY_TYPE,
            OntologyTermQueryRepository.TYPE_ONTOLOGYTERM).pageSize(1), null));
    if (resultResult.getTotalHitCount() > 0)
    {
      Hit hit = resultResult.getSearchHits().get(0);
      for (String attributeName : hit.getColumnValueMap().keySet())
      {
        if (!availableAttributes.contains(attributeName.toLowerCase())
            && !reservedAttributeName.contains(attributeName))
        {
          defaultEntityMetaData.addAttributeMetaData(new DefaultAttributeMetaData(attributeName));
        }
      }
    }
  }
}

代码示例来源:origin: org.molgenis/molgenis-omx-biobankconnect

ObservableFeature.class.getSimpleName().toLowerCase()).pageSize(Integer.MAX_VALUE), null);
for (Hit hit : searchService.search(searchRequest).getSearchHits())

代码示例来源:origin: org.molgenis/molgenis-data-mapper

Long num = mappingServiceRequest.getNum();
Query<Entity> query = new QueryImpl<>().offset(offset.intValue()).pageSize(num.intValue());
String sourceEntityName = mappingServiceRequest.getSourceEntityName();
Iterable<Entity> sourceEntities = () -> dataService.findAll(sourceEntityName, query).iterator();

代码示例来源:origin: org.molgenis/molgenis-semantic-mapper

int depth = mappingServiceRequest.getDepth();
Query<Entity> query = new QueryImpl<>().offset(offset.intValue()).pageSize(num.intValue());
String sourceEntityName = mappingServiceRequest.getSourceEntityName();
Iterable<Entity> sourceEntities = () -> dataService.findAll(sourceEntityName, query).iterator();

代码示例来源:origin: org.molgenis/molgenis-ontology

dataService.findAll(
    sortaJobExecution.getResultEntityName(),
    query.offset(start).pageSize(num).sort(new Sort().on(VALIDATED, DESC).on(SCORE, DESC)));
findAll.forEach(
  mappingEntity -> {

代码示例来源:origin: org.molgenis/molgenis-data-rest

q.pageSize(request.getNum()).offset(request.getStart()).sort(request.getSort());
Fetch fetch =
  AttributeFilterToFetchConverter.convert(

代码示例来源:origin: org.molgenis/molgenis-das

protected Stream<Entity> queryDataSet(String segmentId, int browserStart, int browserStop, String dataSet,
    int maxbins)
{
  String chromosomeAttribute = config.getAttributeNameForAttributeNameArray(GenomicDataSettings.Meta.ATTRS_CHROM,
      dataService.getEntityType(dataSet));
  String posAttr = config.getAttributeNameForAttributeNameArray(GenomicDataSettings.Meta.ATTRS_POS,
      dataService.getEntityType(dataSet));
  String stopAttr = config.getAttributeNameForAttributeNameArray(GenomicDataSettings.Meta.ATTRS_STOP,
      dataService.getEntityType(dataSet));
  //Query for chromosome
  Query<Entity> q = new QueryImpl<>().eq(chromosomeAttribute, segmentId);
  //Add postion queryparts, those should be nested
  q.and().nest();
  //Add start position to queryparts
  q.le(posAttr, browserStop);
  //If stop is configured: add stop querypart, else the position should also be greater than browserstart
  if (stopAttr != "")
  {
    q.and().ge(stopAttr, browserStart);
  }
  else
  {
    q.and().ge(posAttr, browserStart);
  }
  q.unnest();
  //add pagesize based on maxbins of das query
  q.pageSize(maxbins);
  return dataService.findAll(dataSet, q);
}

相关文章