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 validate XML file using an XSD locally?
XML Schema Definition Problem
How to select all elements with a specific attribute? with TinyXPath
Unraveling the dependency tree for a set of XML files using XIncludes
Combining elements from 2 lists in XSLT
Error in xslt or xml while running XSL code for factorial
flash xml slideshow
Merge similar data xml nodes using an attribute as key ( xsl )
XSLT: How to convert XML into text file with Muenchian Grouping
Remove elements from XML
Is it “bad” to store XML in a database?
XML Schema for parent-child relation and reference elements
Building an XML Schema from a Perl Hash?
Problem with My First DTD
What command should be used to get text from a line of an XML file on linux?
extending XML with unknown elements

Categories

HOME
beautifulsoup
azure-stream-analytics
character-encoding
carousel
gembox-spreadsheet
hpc
trac
nfs
endeca
plist
jxl
onedrive-api
mongodb-csharp
package.json
intershop
android-7.0-nougat
pyramid
joptionpane
mount
windows-server-2003
tiki-wiki
pic32
gpio
quantlib
carrierwave
angularjs-material
playstation-portable
login-script
gnat-gps
sharding
sql-delete
swagger-php
verifiable-c
dcmtk
wmp
rfc3339
httrack
builder
openrasta
tinymce-3
manova
custom-font
subnet
backbone-collections
trigger.io
visual-studio-2008-sp1
tooleap
bizagi
aurora
turbo-prolog
rewrite
google-books
ember-cli-rails
canvg
diff3
mass-assignment
android-vibration
filesplitting
ray
file-not-found
koala
amslidemenu
printdialog
epiceditor
mantle
cardreader
garbage
extconf.rb
koken
user-tracking
catransform3d
u2netdk
xcelsius
update-statement
google-floodlight
mbeans
dataform
delimited-text
drupal-fivestar
rowlex
eclipse-marketplace
isapi-extension
duplex
escrow
xpsdocument
sqlobject

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