xml


How can I parse RDF data into model? (java, jena)


I'm trying to parse RDF data and load it to a model instance. However, I don't want to read the data from a file, but rather get it through an URI via http get.
What I did untik now ist this:
Model model = ModelFactory.createDefaultModel();
model.read(rdfdata, null);
model.write(System.out);
rdfdata is the data that I received (String). But I get the following Exception:
Exception in thread "main" org.apache.jena.riot.RiotNotFoundException: Not found: <?xml version="1.0" encoding="UTF-8" ?> [...]
Where is the problem and how can I solve it?
Is it right to just read the data into the model or do I have to do something before?
Sorry for my bad english. :)
Your error message says:
Not found: <?xml version="1.0" encoding="UTF-8" ?> [...]
Staring at that, it appears that it's reporting that the file or URI named <?xml version="1.0" encoding="UTF-8" ?>... can't be opened. Which makes sense, since that's unlikely to be a correct file name.
Check the documentation of model.read(), and in particular check what its first argument is. Also check what rdfdata is: is it the path to a file or a URI? (it looks like it's the contents of an RDF/XML file).
(If this guess is right, then) Moral of the story: recall that when writing an error message, a programmer is typically at least trying to be helpful, thus ‘what is this gibberish^Werror message trying to tell me?’

Related Links

VB6 MSXML2 DOMDocument .xml Property appends NewLine character
RDF valid characters
xml parsing geodata and place on map
Send Multiple SOAP XML requests
Select single value from xml with xpath
Check if xml file exists in memory WP7
XML order of duplicate element matters
Autocompletion (content assist) for XSD files in Eclipse
how can i parse this xml using TBXML in objective c?
How to include TWO XML Tags within Cdata section of XML?
Are blank child nodes of any use to XML parsers?
email daily commit report for svn
XSLT taking 2 XML files as input and generating output XML file
Biztalk - SOAP response contains multiref so it can't be processed
How can I import a XML file in a XSLT and parse it
How to retrieve an xml nodes root / top level parent

Categories

HOME
localization
hyperlink
character-encoding
yahoo-finance
battery
composite-primary-key
sitecore
graphics
knitr
echo
x264
missing-data
boto3
barcode
syntaxnet
project
augeas
dkim
ibeacon-android
startup
datastage
favicon
flatpak
heat
glyphicons
null-pointer
xmonad
digital-signature
gulp-watch
named-entity-recognition
visual-studio-extensions
dapper-extensions
custom-post-type
nstimer
progress-bar
handler
rpgle
sinch
uitapgesturerecognizer
sqlpackage
google-cast
twos-complement
apiary.io
mcustomscrollbar
stringtokenizer
android-ibeacon
vaadin-charts
ntvs
tinymce-3
amq
spring-data-couchbase
avx
er-diagram
chromium-os
qtplugin
freepbx
project-organization
upx
findfirst
highland.js
sapi
sciruby
google-books
android-launcher
cgi-bin
mod-proxy
aspectj-maven-plugin
broadband
iiop
metatrader5
sql-scripts
jqmodal
live555
mutual-authentication
radiant
notorm
artemis
mongohq
mvc-editor-templates
nebula
wp7test
asplinkbutton
qi4j
jquery-blockui
listitem
fusefabric
jquery-address
appledoc
twitterizer
mtu
metaweblog
qtabbar
cuda.net
escrow
int64
contentpresenter

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App