Question

I can query data using Sparql query as explained here, however, when I try to write insert statement in Sparql like below:

PREFIX space: <http://purl.org/net/schemas/space/> 
PREFIX relevance: <http://a9.com/-/opensearch/extensions/relevance/1.0/> 
PREFIX foaf: <http://xmlns.com/foaf/0.1/>       
PREFIX dc: <http://purl.org/dc/elements/1.1/>    

INSERT DATA
    {
    http://nasa.dataincubator.org/spacecraft/1968-009B space:internationalDesignator 1968-009B
    } 

DSS throws this exception:

Nested Exception:-
com.hp.hpl.jena.query.QueryParseException: Lexical error at line 10, column 101.  Encountered: " " (32), after : "INSERT"

Because I can write insert SQL with RDBMS data source, so I think RDF also supports insert functionality.

Could you help me to solve it?

Was it helpful?

Solution

By the looks of it, I feel that the problem is with the SPARQL query itself. Although, I'm aware that the query is syntactically correct and conforms to the SPARQL specifications, I wonder whether the Apache Jena version used in DSS allows you to follow the syntax "INSERT DATA" (just a wild guess analyzing the reported error log). Can you try "INSERT (INTO)" clause and check if it works? Ideally, DSS doesn't do any modifications to the query except input/output mapping processing so if your query format is right it should work out of the box.

Cheers, Prabath

OTHER TIPS

Insert functionality is not yet supported in WSO2 DSS yet.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top