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

Joomla custom xml options
XML formatting conventions: Why leave a space before />?
System.Security.SecurityException: Requested registry access is not allowed. pointing to a line in an XML File
XSLT — generate unique id for root element and append that value to the id of child elements
Sorting XML Elements and sorting data for a set of elements with XSLT
How to run specific groups in tesng.xml using ant?
Multiple xsl choose conditions
What is the best algorithm to turn an XML file into a key-value structure?
How to add a Permalink to a Jekyll RSS Feed?
Unable to get node using xpath in soapUI
Qt4: debugging with popups, trying to convert integer to string, getting letters
What is use of XML in messaging protocols [closed]
apply a list of replacements on multiple xml files
Two XML documents xpath xslt mapping
phpunit stops at 100 assertions
Access Part of an XML Document in Delphi

Categories

HOME
design-patterns
amp-html
powerpoint
numbers
replace
rds
onclick
x264
bing-maps
spin
pcl-crypto
drop-down-menu
selenium-ide
frequency-distribution
3nf
alpacajs
feathersjs
charles
visual-glitch
squashfs
dpdk
ckfinder
interbase
jquery-multiselect
has-and-belongs-to-many
outliers
soot
bioinformatics
jaws
testcomplete
corenlp-server
autodesk-designautomation
sql-server-2000
turfjs
code-snippets
hreflang
login-script
biztalk-rule-engine
activexobject
imx6
numpy-broadcasting
python-pptx
z-notation
jboss-4.2.x
opennms
convex-optimization
podscms
remedy
context-switch
video-conferencing
qtranslate
git-flow
seq
gpg-signature
template-toolkit
py2neo
django-1.10
javafx-css
meteor-packages
ziparchive
preprocessor
dotnetnuke-7
uicolor
gogs
android-wake-lock
cfchart
angular-ui-typeahead
nss
redis-cluster
vhosts
vigenere
phonertc
slash
liquid-layout
botan
mraid
cakephp-2.7
memset
twitter-bootstrap-rails
gae-quotas
multitasking
rfc5322
breakout
ui-select2
nebula
epiceditor
video-codecs
onmousemove
mkv
fusefabric
fitbounds
cross-database
promotion-code
unattended-processing
tmx
dot-emacs
cldc
alsb
scrubyt
online-storage
netbeans6.1

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