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

XSL - What is the namespace for? and what does it?
Groovy XmlSlurper with special characters in node names
Excel Custom Function to Retrieve XML Data
OpenUI5 / SAPUI5: Get Data from REST and display it in List
XSL transformation doesn't write namespace before elements
How to receive raw data in xsl
Using OmniXML implementation in Delphi 10 Seattle
Converting random xml file to tree diagram
opc da and write values to a xml file and read it from a webpage
Why does this XML code not create objects?
XSL: Apply a template after a math operation on element
Selecting specific entries in a for-each loop?
How to update compute fields which have store=True in Odoo8?
Odoo - How to find menu “action” name
How to use the ID of one XML file in another XML in Odoo
XSLT-go into first child then loop thru its children and output attribute names

Categories

HOME
grok
fabricjs
prism
rsa
fftw
saml-2.0
simulink
interpolation
spring-session
accessibility
openstreetmap
ycsb
libc
fileserver
google-content-api
imessage
google-container-registry
jquery-ias
pchart
progress-bar
spotipy
tpm
vex
sqsh
zend-debugger
dumpbin
autolisp
gojs
swagger-php
apic
reason
release
projects-and-solutions
verifiable-c
jvmti
apache-stanbol
resolution
visa
stringtokenizer
attributeerror
http-request
memory-mapping
httr
opencmis
getchar
ovf
opennms
hammer.js
rserve
datamaps
manova
carrot2
qtranslate
truezip
opengl-4
headless
payload
monkey
materialized-path-pattern
seek
adafruit
nikeplus-api
embedding
android-wake-lock
omniauth-facebook
hadoop-partitioning
turbo-prolog
upx
findfirst
nio2
cycle2
libvlc
grgit
terracotta
ess
google-books
canalyzer
jdk1.7
skspritenode
cwrsync
ansi
ms-access-2000
snackbar
uvc
rapidsvn
webfinger
raygun
jqmodal
cancellation
alternate
vsx
qscrollarea
code-duplication
modular
swfobject
tree-balancing
vfs
subgraph
virtualpathprovider
svk
non-clustered-index
pagemethods
skype4java
mathematical-notation
sifr3

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