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

First section title font size needs to be increase by using xslt
Remove attribute value before #
xslt transferring xml into csv [duplicate]
Customized Advanced Search not working on Alfresco Community
Problems processing duplicate xml tags
Reorganizing XML to another XML using XSLT
How to forward next step after schema validation
Creating a bulleted list in InDesign with XML
HOW TO SIGN XML FILE IN .NET COMPACT EDITION
XSLT to CSV with a key / value pair
VBA select XML element val by attribute name
how to use “current() [name()='merge:change']” type of statement in XSL
XSLT 1.0: How to avoid ascii conversion?
Scala: how to write nodeBuffer to a single xml file
XSLT set default value of '0' if node does not exsist
How to stub MQ response ?

Categories

HOME
batch-file
notepad++
asp.net-web-api
cygwin
kentico
turing-machines
string
wakanda
formal-languages
static
sh
alarm
web-hosting
azure-container-service
gluon-mobile
banner
p2p
naivebayes
screen-readers
azure-powershell
null-pointer
dreamweaver
wolframalpha
shortest-path
nim
enterprise-miner
spring-async
short-url
onload
underscore.js
datastax-enterprise-graph
exchangewebservices
quantlib
comparable
mockjax
contacts
arduino-ide
slacktextviewcontroller
sql-delete
xajax
apiary.io
wurfl
sim-card
password-protection
oracle-service-bus
oim
proget
tinkerpop
sundials
monkey
d3-force-directed
trigger.io
cd-burning
testrail
usart
angular2-testing
qtplugin
uicolor
xdoclet
angular-ui-typeahead
nss
php-socket
query-by-example
np-spring
cycle2
qbxml
directdraw
boomerang
omnifaces
nutiteq
bufferedinputstream
fits
rrule
phpldapadmin
bcache
grouping-sets
android-cookiemanager
psr-4
unix-socket
multiautocompletetextview
drupal-nodes
notorm
sphinxql
inappsettingskit
scringo
gpars
swfobject
patricia-trie
listitem
subproject
httponly
window-decoration
koken
flex-mobile
promotion-code
jqote
qglwidget
undefined-index
resharper-6.0
binomial-heap
eclipse-marketplace
lalr
purepdf
tui
windows-identity
wysiwym
perl5.12

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