简体   繁体   中英

How can I get all triples contained in a SPARUL INSERT Data statement without writing my own parser?

I'm searching for a method to extract all triples that are contained in a SPARQL Update INSERT DATA string. Of course it would be possible to write an own parser for INSERT DATA statements but if possible, I want to avoid that.

For example, there could be an update that looks similar to this:

Insert Data {
<http://test.com/example/book1> <http://test.com/example/hasTitle> <http://test.com/TestTitle1> . 
<http://test.com/example/book2> <http://test.com/example/hasTitle> <http://test.com/example/TestTitle2> .
}

Is there a library that delivers subject, predicate, and object for those two triples? My overall goal is to have an ArrayList that contains the triples. In the best case, the method should also work with prefixes.

Thank you in advance.

Let the code do the work. Execute the request on an empty dataset and then inspect the result.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM