How to build SPARQL queries in java?

后端 未结 8 1585
囚心锁ツ
囚心锁ツ 2021-02-01 10:19

Is there a library, which is able to build SPARQL queries programmatically like the CriteriaBuilder in JPA or to build the queries like with a PreparedStateme

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 10:59

    I have just released a beta project to do just this, called Spanqit.

    I strove for readability and an intuitive interface, for example, here is some example Spanqit syntax for creating a query:

    query.prefix(foaf).select(name)
        .where(x.has(foaf.iri("name"), name))
        .orderBy(name)
        .limit(5)
        .offset(10);
    

    Check it out, and feel free to comment and suggest improvements!

提交回复
热议问题