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

understanding position() function in XSLT
get element names from unmarshalled object class
convert graph represented by xml to visual representation
VB.NET XmlTextReader bytes read
VB.Net XML Parsing Issue
XSL: Generate a global integer id that increments itself
Failed to read schema document [XSD] because
String to date in XSLT 2.0: error using xs:date
How do I produce the required XML output grouping and sorting by like source nodes?
error in calling web service through Internet Explorer
SelectSingleNode Return Value
xmlstarlet with space between results
bash read git log and print it to .xml format (RSS)
Using choice with 2 fields of the same name in XSD
Treat same tag, different namespace as the same
VB.net ConnectionStrings object reference

Categories

HOME
gridview
cobalt
hyperlink
webdriver
gpu
graphics
rendering
simulink
scripting
onclick
dkim
github-enterprise
project-intu
cmdb
jsonpath
mvc-mini-profiler
foreign-keys
gmm
apache2.4
ag
gulp-watch
underscore.js
custom-controls
panoramas
event-flow
python-2.6
deltaspike
mailkit
nested-lists
lubridate
engine.io
searchkit
wurfl
openalpr
android-augmented-reality
diacritics
typesafe-config
resolution
datacachefactory
preloader
oim
jide
clarifai
facebook-pixel
rserve
posixct
reindex
custom-font
truezip
py2neo
ampps
rmongo
stripe-connect
autosar
ziparchive
mta
mapinfo
android-dateutils
swizzling
dbamp
findfirst
blitline
concurrentmodification
intel-c++
coda
sapscript
visual-sourcesafe-2005
baasbox
sql-server-data-tools
linked-tables
snoop
nsurlsessiondatatask
administration
ray
mutual-authentication
light
away3d
time.h
argouml
extreme-programming
pstack
pyunit
paginator
lambdaj
window-decoration
failing-tests
cgimage
expression-blend-4
cuteeditor
qglwidget
pos-for-.net
interop-domino
fault-tolerance
firefox-3
entitykey
flvplayback
unmanagedresources
image-capture

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile