Class PatternQueryHandler

  • All Implemented Interfaces:
    QueryHandler

    @Shorthand("PatternQueryHandler")
    public class PatternQueryHandler
    extends InstancesQueryHandler
    This QueryHandler uses query patterns and converts them into query instances.
    A query pattern is a SPARQL 1.1 Query which can have additional variables %%var[0/9]+%% in the Basic Graph Pattern.

    For example: SELECT * {?s %%var1%% ?o . ?o <http://exa.com> %%var100%%}
    This QueryHandler will then convert this query to:
    SELECT ?var1 ?var100 {?s ?var1 ?o . ?o <http://exa.com> ?var100}
    and will request query solutions from a user given sparql endpoint (e.g DBpedia)
    The solution will then be instantiated into the query pattern. The result can look like follows:

    SELECT * {?s <http://prop/1> ?o . ?o <http://exa.com> "123"}
    SELECT * {?s <http://prop/1> ?o . ?o <http://exa.com> "12"}
    SELECT * {?s <http://prop/2> ?o . ?o <http://exa.com> "1234"}
    Author:
    f.conrads
    • Constructor Summary

      Constructors 
      Constructor Description
      PatternQueryHandler​(java.util.LinkedList<Worker> workers, java.lang.String service, java.lang.Long limit)
      The constructor for the pattern based QueryHandler.
      PatternQueryHandler​(java.util.LinkedList<Worker> workers, java.lang.String service, java.lang.String limit)
      The constructor for the pattern based QueryHandler.
      PatternQueryHandler​(java.util.List<Worker> workers, java.lang.String endpoint)
      The constructor for the pattern based QueryHandler.
    • Constructor Detail

      • PatternQueryHandler

        public PatternQueryHandler​(java.util.List<Worker> workers,
                                   java.lang.String endpoint)
        The constructor for the pattern based QueryHandler.
        Query Instances will be restricted to 2000 per QueryPattern

        This will check all Workers if they are of type SPARQL or UPDATEWorker and gets their querysFile/updatePath to generate queries out of it.
        Parameters:
        workers -
        endpoint - the sparql endpoint to derive the variable instances
      • PatternQueryHandler

        public PatternQueryHandler​(java.util.LinkedList<Worker> workers,
                                   java.lang.String service,
                                   java.lang.String limit)
        The constructor for the pattern based QueryHandler.

        This will check all Workers if they are of type SPARQL or UPDATEWorker and gets their querysFile/updatePath to generate queries out of it.
        Parameters:
        workers -
        service - the sparql endpoint to derive the variable instances
        limit - the resitriction of query instances per query pattern as String
      • PatternQueryHandler

        public PatternQueryHandler​(java.util.LinkedList<Worker> workers,
                                   java.lang.String service,
                                   java.lang.Long limit)
        The constructor for the pattern based QueryHandler.

        This will check all Workers if they are of type SPARQL or UPDATEWorker and gets their querysFile/updatePath to generate queries out of it.
        Parameters:
        workers -
        service - the sparql endpoint to derive the variable instances
        limit - the resitriction of query instances per query pattern