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

XSLT wrap nodes between specific element
svn can't revert or update with “The XML response contain invalid XML” error due invalid character in file name
Unknown Function Current-Datetime()
Creating XML with LINQ Expression Holes from SQL Server database, when db values are null
Large XML formatting in visual studio
How to replace character entities in XPath?
Add namespace and schemaLocation to specific nodes using XSLT
Unmarshal XML element name to different property
Addind values over loop in FOP with XSL and XML
Need xml markup on persisting xml data to file using XmlParser
convert HTML entities
trying to create an adaptor file for qt application via xml
Get Music Data in XML format
Joomla 3 module repeated fields
xsl Transformation for Grouping multi layer results
Checking for exception in XML

Categories

HOME
api
composite-primary-key
pclxl
appcelerator
tivoli
limit
discrete-mathematics
mautic
line
opengl-es-3.0
ipmitool
filechannel
3nf
dynamic-sql
sigma.js
user-experience
springfox
data.stackexchange.com
appirater
jasmine-node
cppreference
vex
autodesk-designautomation
aws-codecommit
rselenium
hard-drive
biztalk-rule-engine
contacts
jwplayer6
imx6
imagenet
dm-script
modernizr
password-protection
gdata
demo
attributeerror
clang++
vaadin-elements
automapper-5
vugen
insight
payara-micro
qtranslate
colorbar
filehandle
css-transforms
vibrate
android-instrumentation
reachability
stripe-connect
centrifuge
lrs
resourcemanager
deep
bizagi
cortex-m
nio2
highland.js
rpart
jdk1.7
pyobjc
bufferedinputstream
rrule
umlgraph
phpldapadmin
procedural-programming
punycode
trdion2011
mobility
lambda-architecture
rcaller
mutual-authentication
vsx
multiautocompletetextview
sbcl
mt4j
mysql-error-1044
scringo
workitem
virtual-pc
extreme-programming
cakephp-1.2
saleslogix
subproject
fusefabric
usertype
stress
promotion-code
filemerge
timthumb
twitterizer
folding
isapi-extension
request-headers
sun
alsb
sifr3

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile