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#">

  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
        at com.hp.hpl.jena.sparql.lang.ParserARQUpdate.parse$(ParserARQUpdate.ja

asked 30 Jan '13, 04:03

Ton%20Rawat's gravatar image

Ton Rawat
accept rate: 50%

edited 30 Jan '13, 05:19

Rob%20Vesse's gravatar image

Rob Vesse ♦

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#>
permanent link

answered 30 Jan '13, 04:29

Ton%20Rawat's gravatar image

Ton Rawat
accept rate: 50%

edited 30 Jan '13, 05:21

Rob%20Vesse's gravatar image

Rob Vesse ♦

Your answer
toggle preview

Follow this question

By Email:

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



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

Question tags:


question asked: 30 Jan '13, 04:03

question was seen: 2,708 times

last updated: 30 Jan '13, 05:21