문제

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?

도움이 되었습니까?

해결책

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

다른 팁

Insert functionality is not yet supported in WSO2 DSS yet.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top