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

Sencha touch XML parser for multiple CDATA
FOSRestBundle output wrong xml
Automatically reverse an xsl
JAXB - How to convert custom Date objects to java.util.Date for generated beans?
How to XSD-Validating single fields on setting them using moxy
How to hide some fields when transforming XML with XSLT
how to create phpcs.xml file in ant from command line
XML::LibXML extracting a value
How to categorize containers in Unity configuration file
XSLT newbie, replacing values
Oracle XMLSequence attribute name and value
xslt for adding prefixes to my property names in the xml
Imported schema & namespaces
Combining two XML files with XSLT
Regex for matching dates
xsd -xml regex validation not working for me using JAXB

Categories

HOME
apache-flink
object
datastore
numbers
error-handling
sublimetext
vscode-extensions
yandex
tivoli
google-cloud-datalab
trac
sendgrid-api-v3
spin
cmdb
selectize.js
parameter-passing
imessage
mapstruct
sigma.js
jquery-ias
libigl
draft-js-plugins
game-theory
fat
fable-f#
ms-access-web-app
fragment-backstack
progress-bar
sinch
tizen-tv
mql
autodesk-designautomation
anki
testbed
glib
autolisp
laravel-eloquent
joomla2.5
raft
tex
numberpicker
ogc
xv6
android-ibeacon
glm-math
congestion-control
snapchat
puredata
semantic-logging
java-6
colorbar
headless
skin
otp
er-diagram
monkey
shinobi
branch-prediction
cronexpression
async.js
burrows-wheeler-transform
nikeplus-api
jodd
avspeechsynthesizer
simevents
udpclient
clipboard.js
stream-processing
hadoop-partitioning
fink
libav
halcon
toran-proxy
iokit
django-urls
intel-c++
dock
uncompress
liquid-layout
ansi
j-security-check
xmltype
procedural-programming
execve
formview
wcm
mdichild
verold
paste
scriptaculous
oocss
kaleidoscope
time.h
diem
pagedown
lambdaj
apache-whirr
predicatebuilder
landscape-portrait
mysql-error-1205
pylucene
creole
xui
quotation-marks
inline-formset
appledoc
jqueryform
lxr
skype4java
fail-fast-fail-early
software-lifecycle
contentpresenter

Resources

Encrypt Message