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

using Substring in Xpath expression in apache camel: error
xslt summing the totals in an invoice [closed]
Depth First Reading of large XML Files
Always return element value from current node with XPath
Import xml product list into Magento
What is the best way to Optimize XSLT transformations?
How do we modify and access the value of a parameter?
xslt subgroups of groups without duplicates
referencing custom xsd causes intellisense to only work above schema
Perl XML Parser and Expat
Transforming Many E2ETraceEvent Via XSLT 1.0
awk one liner: replace xml tags
antlr parse xml lost token match or duplicated match
xml file drill down
Sending information Main swf to loaded in swf
Powershell select XML nodes where attribute contained in array

Categories

HOME
uml
solver
vscode-extensions
grafana
r-googlesheets
xbee
entity-framework-core
switch-statement
parameters
settings
nstableheaderview
title
java.util.logging
line
x-cart
speech-synthesis
radgridview
intercom
job-scheduling
jquery-ias
named-entity-recognition
ios10.2
parcelable
exploit
perlbrew
custom-post-type
pylons
underscore.js
failover
realm-mobile-platform
gitlab-api
event-flow
dumpbin
keras-layer
openwhisk
protege4
google-knowledge-graph
google-earth-engine
node-mssql
odroid
gdata
kill
movilizer
bindingnavigator
outputcache
http-request
oim
textsum
configurationmanager
manova
google-cse
tinkerpop
static-cast
rackspace-cloud
android-instrumentation
signalr.client
mta
i386
hclust
scaffolding
dbamp
boost-serialization
libav
nio2
httpruntime.cache
grgit
qt5.2
file-move
jdi
fuelcms
page.js
batik
eoferror
jsvc
cwrsync
canvg
git-ftp
xmltype
infosphere-spl
ejb-2.x
delayed-execution
variadic-templates
angular-gettext
big-ip
structuremap3
machine-instruction
wcm
universal-image-loader
raygun
angular-carousel
android-audiorecord
openargs
light
ie8-compatibility-mode
breakout
jeromq
cnf
redis-py
patricia-trie
sentestingkit
fusefabric
apache-whirr
agility.js
luabind
pinch
procedures
update-statement
instantiationexception
lxr

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