Hi Barry (and Jeni, just read your answer too),

thank you for the answers, you're right. I know Sesame treats them
differently but I didn't notice the "update" method is missing in the
example application, so I thought there was another problem elsewhere.
So silly :-)

Thanks again,
Nicola

Il 16/09/2012 16:09, Barry Bishop ha scritto:
> Hi Nicola,
> 
> The getting started application is only designed only for executing
> queries (at the moment). The Sesame API treats queries and updates as
> two separate (but related) things, so pushing updates through the query
> api will fail.
> 
> It would be quite straightforward to add this functionality to
> GettingStarted, e.g. by adding a function something like this:
> 
> void executeUpdate(String updateString) {
>         Update update =
> repositoryConnection.prepareUpdate(QueryLanguage.SPARQL, updateString);
>         update.execute();
>         connection.commit();
> }
> 
> You might want to put the updates in a separate file similar to the
> query file, or put them in the same file (in which case you will need to
> catch query parse execptions and try the update function instead).
> 
> I hope this helps,
> barry
> 
> 
> Barry Bishop
> OWLIM Product Manager
> Ontotext AD
> Tel: +43 650 2000 237
> email: [email protected]
> skype: bazbishop
> www.ontotext.com
> 
> On 16/09/12 13:24, Nicola Vitucci wrote:
>> Hi Antonio,
>>
>> no, I just wrote the query in a text file as in the Getting Started
>> example application. So this syntax is not accepted? Do I have to do the
>> update via API?
>>
>> Nicola
>>
>> Il 16/09/2012 14:15, antonio nunziante ha scritto:
>>> Ho Nicola, are you using the openrdf workbench?if so, have you executed
>>> your query in the "sparql update" menu?
>>>
>>> -Antonio Nunziante
>>> Il giorno 16/set/2012 11:26, "Nicola Vitucci"
>>> <[email protected]> ha
>>> scritto:
>>>
>>>> Hi Barry,
>>>>
>>>> yes, I've tried with OWLIM-Lite (versions 5.1 and 5.2) as a query for
>>>> the Getting-Started application. Adding some exceptions it comes out
>>>> that the "INSERT" keyword is not recognized, so I get a
>>>> MalformedQueryException:
>>>>
>>>> ------
>>>> org.openrdf.query.MalformedQueryException: Encountered " "insert"
>>>> "INSERT "" at line 6, column 1.
>>>> Was expecting one of:
>>>>      "base" ...
>>>>      "prefix" ...
>>>>      "select" ...
>>>>      "construct" ...
>>>>      "describe" ...
>>>>      "ask" ...
>>>> ------
>>>>
>>>> It looks like SPARQL/Update queries are not parsed correctly. If you
>>>> need any more details just tell me.
>>>>
>>>> Thanks,
>>>> Nicola
>>>>
>>>> Il 16/09/2012 10:45, Barry Bishop ha scritto:
>>>>> Hello Nicola,
>>>>>
>>>>> Is this question related to OWLIM/Sesame? If so, which
>>>>> edition/version?
>>>>>
>>>>> What are the symptoms of your problem? Do you get an error message?
>>>>>
>>>>> Do you get a stack trace?
>>>>>
>>>>> I tried this query using OWLIM-SE and it parses and executes
>>>>> correctly.
>>>>>
>>>>> barry
>>>>>
>>>>>
>>>>> On 14/09/12 19:36, Nicola Vitucci wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I guess this question has already been answered, but I cannot find
>>>>>> any
>>>>>> reference. Basically, a SPARQL update query like this cannot be
>>>>>> parsed:
>>>>>>
>>>>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>>>>> PREFIX owl: <http://www.w3.org/2002/07/owl#>
>>>>>> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
>>>>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>>>>> PREFIX : <http://www.semanticweb.org/owlapi/ontologies/MyOnt#>
>>>>>>
>>>>>> INSERT {?p rdf:type :MyClass}
>>>>>> WHERE {?p :hasProp ?rl}
>>>>>>
>>>>>> What's wrong? And, if possible, how should I write it?
>>>>>>
>>>>>> Thanks,
>>>>>> Nicola
>>>>>> _______________________________________________
>>>>>> Owlim-discussion mailing list
>>>>>> [email protected]
>>>>>> http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion
>>>>>
>>>> _______________________________________________
>>>> Owlim-discussion mailing list
>>>> [email protected]
>>>> http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion
>>>>
>> _______________________________________________
>> Owlim-discussion mailing list
>> [email protected]
>> http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion
> 
> 
_______________________________________________
Owlim-discussion mailing list
[email protected]
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion

Reply via email to