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

How to write WSDL if I have huge amount of data read from database?
transform a parse tree of a parsed output in NLTK into a XML format
not sure why all text is being printed when specific template exists
Adding an element to an XML-document with a previously newly created string from an attribute node
XML data parsing in angular 2
XSLT Code for multiple line data into single line
Is it possible to trim tag value before validation in XSD?
How to add prefix to all root attributes xml in x++ ax 2012
Sitecore string field as literal in XSL? Trying to use sc:field as img source
how to filter the paragraph in xml?
SAXPARSER Exception : getting accurate logs
Reading tags from xml visual basic
How to unmarshall CDATA field in XML using Rest Template
Import XML into Access database (transform multi-attributed child nodes)
Add a new tag with value to an xml file node when its value matches an entry in the text file using shell script
User changes not saved on SSI XML Source editor

Categories

HOME
beautifulsoup
jpa
codenvy
merge
character-encoding
zend-framework
serialization
jelastic
apiblueprint
solver
alarm
web-hosting
elasticsearch-5
appcelerator-studio
startup
renjin
selectize.js
chargify
fileserver
easyphp
windows-xp
undertow
rubymotion
angular-routing
exploit
interpreter
xunit
soot
realm-mobile-platform
scrollview
utorrent
cognos-bi
salesforce-communities
railstutorial.org
metawidget
spring-mvc-test
hackintosh
azure-arm
laravel-elixir
softmax
naming
vaadin-charts
puredata
jboss-4.2.x
linter
automapper-5
sonarlint-eclipse
lightning
py2neo
lrs
burrows-wheeler-transform
refinerycms
android-wake-lock
nservicebus5
jnlua
dynamics-nav-2016
qt5.2
microsoft-reporting
include-guards
video-player
haskell-warp
graphics2d
rrule
webmatrix-3
punycode
webfinger
ios8-extension
buffering
koala
conditionaltagsupport
gwt-openlayers
isqlquery
mbunit
octal
actiondispatch
alice
tree-balancing
pstack
listitem
josql
kqueue
relative
webdev.webserver
drawtobitmap
multiplatform
cuteeditor
dataform
mathematical-notation
alsb
soappy
pnrp

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