Parameterized SPARQL query with JENA

前端 未结 2 1814
梦谈多话
梦谈多话 2021-01-18 04:30

I\'m trying to build a small semantic web application using Jena framework, JSP and JAVA. I have a remote SPARQL endpoint and I\'ve already written a simple query which work

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-18 04:49

    You could try looking into Twinkql. It is a SPARQL-to-Java mapping framework. It uses Jena in the back end, but tries to simplify SPARQL queries and Java binding of the results.

    It allows you to define SPARQL queries in xml:

    
    

    Note the #{novelName} placeholder -- this is where parameters can be passed in at query time.

    Also, results can be bound to Java Beans:

    
        novel
        
        
    
    

    There is an API to call these queries, to pass in parameters, etc. It is much like MyBatis, but for SPARQL instead of SQL.

提交回复
热议问题