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

Python: UnicodeEncodeError: 'charmap' codec can't encode character '\u0142'
how to disable cron job easily?
XSLT translation from XML
XML Validation fails when validated against schema
Where are distinguished fields are stored in BizTalk?
Order xsl for loop as well as limting the loop to only five
How to compile/package Spark 2.0 project with external jars and Maven
Count Preceding Siblings Table
How to play media in kodi using upnp
XML cannot resolve symbole when Java SDK is set in Intellij IDEA
The prefix “ldaptive” for element is not bound
Finding element in XML database with certain attribute value in xQuery
Retrieve XML content of a variable
How to delete a specific piece of data from an XML file using VBA with access
Allow XML element in any order with any number of appearance via XSD?
How to insert a space before and after a specific character in xslt?

Categories

HOME
django
go
xml
httparty
developer-tools
telegram
fpga
redux-form
alexa-skills-kit
battery
google-cloud-functions
static-site
tivoli
carousel
soa
nuget-package
crystal-reports-2013
frontend
odoo-8
title
modal-dialog
drop-down-menu
text-mining
mautic
pybossa
cumulocity
null-pointer
xmonad
shortest-path
visual-glitch
rubymotion
roslyn
google-api-client
surveymonkey
syntax-highlighting
asymptotic-complexity
android-maps
progress-bar
linked-data
quantlib
tizen-tv
complex-numbers
mockjax
catch-unit-test
gnat-gps
pdw-file-browser
browser-extension
swagger-php
alphabetical
apns-php
apriori
claims
oracle-service-bus
stylecop
plan-9
getchar
fwrite
dynamic-linq
ntvs
linter
geotiff
reindex
tinkerpop
branch-prediction
rmongo
change-tracking
swizzling
hadoop-partitioning
ikiwiki
crouton-os
spring-retry
directdraw
xenomai
sha512
dnssec
osc
java-security
beatsmusic
angular-gettext
boost-program-options
genymotion-call
rmysql
mdichild
extjs2
high-resolution
ie8-compatibility-mode
dtmf
tlf
kaleidoscope
jquery-1.9
android-sdk-2.3
dopostback
mkv
qi4j
jdb
stress
jquery-tools
socketserver
silent
maven-1
easyb
nstokenfield
sifr
purepdf
wcf-instancing
google-wave
windows-identity
mathematical-typesetting
wspbuilder

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App