Search in sources :

Example 1 with CBlock

use of com.bakdata.conquery.models.events.CBlock in project conquery by bakdata.

the class DateRestrictingNode method isOfInterest.

@Override
public boolean isOfInterest(Bucket bucket) {
    CBlock cBlock = Objects.requireNonNull(preCurrentRow.get(bucket));
    if (validityDateColumn == null) {
        // If there is no validity date set for a concept there is nothing to restrict
        return super.isOfInterest(bucket);
    }
    CDateRange range = cBlock.getEntityDateRange(entity.getId());
    return restriction.intersects(range) && super.isOfInterest(bucket);
}
Also used : CBlock(com.bakdata.conquery.models.events.CBlock) CDateRange(com.bakdata.conquery.models.common.daterange.CDateRange)

Example 2 with CBlock

use of com.bakdata.conquery.models.events.CBlock in project conquery by bakdata.

the class CBlockDeserializer method deserialize.

@Override
public CBlock deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
    CBlock block = beanDeserializer.deserialize(p, ctxt);
    TreeConcept concept = block.getConnector().getConcept();
    if (block.getMostSpecificChildren() != null) {
        // deduplicate concrete paths after loading from disk.
        for (int event = 0; event < block.getMostSpecificChildren().length; event++) {
            int[] mostSpecificChildren = block.getMostSpecificChildren()[event];
            if (mostSpecificChildren == null || Connector.isNotContained(mostSpecificChildren)) {
                block.getMostSpecificChildren()[event] = Connector.NOT_CONTAINED;
                continue;
            }
            log.trace("Getting Elements for local ids: {}", mostSpecificChildren);
            block.getMostSpecificChildren()[event] = concept.getElementByLocalId(mostSpecificChildren).getPrefix();
        }
    }
    return block;
}
Also used : CBlock(com.bakdata.conquery.models.events.CBlock) TreeConcept(com.bakdata.conquery.models.datasets.concepts.tree.TreeConcept)

Aggregations

CBlock (com.bakdata.conquery.models.events.CBlock)2 CDateRange (com.bakdata.conquery.models.common.daterange.CDateRange)1 TreeConcept (com.bakdata.conquery.models.datasets.concepts.tree.TreeConcept)1