I use jena to insert data. What is the right syntax of data type? ... UpdateAction.execute(request, model); .... This SPARQL can insert to ontology:

PREFIX pre:<http://www.semanticweb.org/ontologies/bookShop.owl#>
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#">

INSERT DATA
{
  pre:TestBook rdf:type owl:NamedIndividual;  
               rdf:type pre:History; 
               pre:creator "TTT";
               pre:title "Test Book";
               pre:hasCurrency pre:US;
               pre:price "10".
}

I need to add the data type decimal by change line:

  pre:price "10"^^xsd:decimal.

It has Error:

cmd=[updatequery] sourceFile=[C:\tmp\customRule\bookShop.owl] ,reasoning=[none]
[2556-01-30 15:48:20.656]  ERROR java.lang.Class - com.hp.hpl.jena.query.QueryPa
rseException: Encountered " "<" "< "" at line 4, column 12.
Was expecting:
    <IRIref> ...
        at com.hp.hpl.jena.sparql.lang.ParserARQUpdate._parse(ParserARQUpdate.ja
va:70)
        at com.hp.hpl.jena.sparql.lang.ParserARQUpdate.parse$(ParserARQUpdate.ja
va:41)

asked 30 Jan '13, 04:03

Ton%20Rawat's gravatar image

Ton Rawat
263
accept rate: 50%

edited 30 Jan '13, 05:19

Rob%20Vesse's gravatar image

Rob Vesse ♦
13.8k1715


This has been solved. I had double quote in the prefix declaration for xsd

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#">

It should have been:

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
link

answered 30 Jan '13, 04:29

Ton%20Rawat's gravatar image

Ton Rawat
263
accept rate: 50%

edited 30 Jan '13, 05:21

Rob%20Vesse's gravatar image

Rob Vesse ♦
13.8k1715

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1,264
×589
×206

Asked: 30 Jan '13, 04:03

Seen: 1,640 times

Last updated: 30 Jan '13, 05:21