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

JAVA+ Spring Edit SOAP request Message
Muenchian Grouping without xsl:for-each
VBA : Open XML file with XSL in Excel
update value in xml field conditional upon values in a data frame
VBA XML V6.0 How to make it wait for page to load?
How comment lines in XML file using Batch file? [duplicate]
Get the time duration of a film and add it to a Google spreadsheet through IMPORTXML
How to append a value in the header of xml using oracle
Adding XML element with Scala's XML Support
Change switch behavoir with foreach
xslt select element only by attribute
XPath: Select node based on depth of descendant node type
Rearange XML nodes XSL-T / variable?
IntelliJ XML navigation shortcut
How to apply XSL templates to start and finish XML element from different parts of the document
Xml feed prestashop - image url doesnt working

Categories

HOME
go
deep-learning
dns
appcelerator
google-cloud-functions
vxml
python-multithreading
extjs4.2
opengl-es-3.0
qsqlquery
gruntfile
modbus-tcp
dreamweaver
oledb
ag
rubymotion
easeljs
mongoid6
dynamically-generated
expressionengine3
moses
flooding
handler
iis-express
erb
slacktextviewcontroller
baidu-map
mnist
android-augmented-reality
numberpicker
visa
smoothstate.js
drupal-theming
proget
linter
hammer.js
manova
bluez
qtranslate
modelsim
filehandle
libjpeg
taocp
pytables
beamer
aspen
phpgrid
phonertc
airbrake
canvg
jquery-forms-plugin
paw
mdichild
mutual-authentication
koala
mt4j
gtm-oauth2
modular
web-notifications
midlet
cakephp-1.2
database-create
ilasm
floating-point-exceptions
winmain
google-floodlight
w3c-geolocation
commerceserver2007
metaweblog
ie-compatibility-mode
office-2007
burndowncharts
murmurhash
silverlight-oob
soappy

Resources

Encrypt Message