Search in sources :

Example 1 with NonSimplePropertyPathVisitor

use of query.statistics.NonSimplePropertyPathVisitor in project QueryAnalysis by Wikidata.

the class OpenRDFQueryHandler method computeNonSimplePropertyPaths.

@Override
protected final void computeNonSimplePropertyPaths() {
    if (getValidityStatus() != QueryHandler.Validity.VALID) {
        this.nonSimplePropertyPaths = getValidityStatus().toString();
        return;
    }
    try {
        ASTQueryContainer qc = new StandardizingSPARQLParser().getASTQueryContainerPrefixesProcessed(getQueryString(), BASE_URI);
        Set<String> nonSimplePropertyPaths = new NonSimplePropertyPathVisitor().getNonSimplePropertyPaths(qc);
        this.nonSimplePropertyPaths = this.computeAnyIDString(nonSimplePropertyPaths);
        if (this.nonSimplePropertyPaths.equals("")) {
            this.nonSimplePropertyPaths = "NONE";
        }
    } catch (VisitorException | MalformedQueryException e) {
        this.nonSimplePropertyPaths = "INTERNAL_ERROR";
        logger.error("Unexpected error while calculating non-simple property paths.", e);
    }
}
Also used : NonSimplePropertyPathVisitor(query.statistics.NonSimplePropertyPathVisitor) StandardizingSPARQLParser(openrdffork.StandardizingSPARQLParser) MalformedQueryException(org.openrdf.query.MalformedQueryException)

Aggregations

StandardizingSPARQLParser (openrdffork.StandardizingSPARQLParser)1 MalformedQueryException (org.openrdf.query.MalformedQueryException)1 NonSimplePropertyPathVisitor (query.statistics.NonSimplePropertyPathVisitor)1