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

Escape not used values using XSLT
How to implement XMLDSIG's XPath transform using LibXML2?
Xslt recursion with dynamic xml
Getting data from XML in SSIS
xml schema complextype
Return “latest” node in repeating node set
Differences between HTML element and XML element? [closed]
Parsing XML Comments in Oracle [duplicate]
XML ArrayCollection applicationStorageDirectory
XSL defining complex (non standard) XML attributes for transformation
XMLStarlet - For each <name> element
FireFox doesn't show my XML properly
Adobe Air Flex appending and saving to XML file
the uri specification in xml namespaces
AS3 XML Looping, grabbing attributes and children
How to read data from XML into a structure using vb.net

Categories

HOME
beautifulsoup
google-cloud-platform
gridview
dns
github-for-windows
amp-html
jmx
youtube-data-api-v3
themes
battery
jsf-2.2
spring-data-mongodb
categorical-data
distribution
text-mining
azure-iot-hub
vuejs
simpleitk
poedit
ksh
parcelable
windows-server-2003
pic32
opentk
fable-f#
bulletphysics
jaws
failover
python-2.6
database-comparison
dsx-desktop
nested-lists
html-encode
reverse
numpy-broadcasting
alphabetical
imagenet
dcmtk
congestion-control
cnc
reportservice2010
netbeans6.8
remedy
modelsim
er-diagram
py2neo
universal-analytics
google-photos
bootstrap-tags-input
custom-lists
winusb
microstation
mta
ng-grid
cifilter
embedding
createprocess
fink
assertion
wiredep
oracle-spatial
lazybones
microsoft-reporting
canalyzer
jdk1.7
uncompress
matlab-deployment
entity-framework-4.3
addressing-mode
post-commit-hook
contrast
insight.database
jqmodal
live555
gtm-oauth2
away3d
ebay-lms
oocss
cmmi
font-awesome-4.0.0
cardreader
qi4j
dajaxice
floating-point-exceptions
promotion-code
fsevents
tmx
codebase
nhprof
addchild
zend-rest
opml
spread
build-environment
silverlight-oob
unmanagedresources
blind
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