Skip to content

Programmatically set LIMIT in SPARQL query #5116

Answered by fkleedorfer
gdeak-monguz asked this question in Q&A
Discussion options

You must be logged in to vote

This should work. It's not pretty, though. We may want to add a way to add anonymous blank nodes in a triple pattern.

    public static void main(String[] args) {
        Variable subject = SparqlBuilder.var("subject");
        Variable type = SparqlBuilder.var("type");
        Variable label = SparqlBuilder.var("label");
        Variable highlightedLabel = SparqlBuilder.var("highlightedLabel");
        Variable searchTerm = SparqlBuilder.var("searchTerm");
        Prefix search = SparqlBuilder.prefix("search", Rdf.iri("http://www.openrdf.org/contrib/lucenesail#"));
        int limit = 20;
        RdfBlankNode searchSpec = Rdf.bNode("searchSpec");
        SelectQuery query = Queries
     …

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hmottestad
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #5111 on August 26, 2024 15:15.