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

Validation error of an xsd
XML validation against XSD: Element must have no character or element information item
Markers and polyline loaded from .xml
updating attribute value in a xml file(.config file)
Need to get a modeless form to show while saving to XML file
Formating XML data for testing
MSXML getElementsByTagName() does not work with any TagName
Multiple objects creation Tastypie POST XML
What is counterpart of XSLT (transforming XML to HTML) for JSON data files?
How can get the data of duplicate tags as comma separated value of xml in sql server using sp_xml_preparedocument?
Application not workig when adding value to <context-param> in web.xml in Spring MVC Web Application Using Maven
Batch to copy strings between two tags in XML
CRM Fetch Statement Filter Condition where 2 lookups equel 2 linked entities
fetching tags along with their values in a xdocument
Issue in applying the xml fonts and structure to .abc files in Ecllipse
Selenium IDE File error: Unrecognized path File XML

Categories

HOME
shell
google-app-engine
hyperlink
delphi-7
flex
cublas
rds
nested-if
limit
special-characters
qpython
spring-social
radgridview
dynatrace
entitymanager
red5
google-container-registry
enterprise-miner
sar
jquery-ias
cgbitmapcontext
href
named-entity-recognition
roslyn
php-mysqlidb
mongoid6
roundup
mount
google-cloud-print
bulletphysics
jasmine-node
mat
entity-relationship-model
datastax-enterprise-graph
xbox
anki
kudu
complex-numbers
left-join
simplecv
clickjacking
android-sugarorm
sammy.js
sim-toolkit
apic
jpad
protein-database
recurrent-neural-network
diacritics
urlsession
microsoft-metro
plr
clang++
opencmis
openresty
ntvs
clarifai
jquery-ui-draggable
mschart
tinymce-3
ngmaterial
pdf-conversion
gameplay-kit
bootstrap-tags-input
meteor-packages
burrows-wheeler-transform
watch-os-2
android-dateutils
halcon
jparsec
httpruntime.cache
toast
ascii-art
atan2
vhosts
dynatree
jdi
forwarding
opserver
dnssec
matlab-deployment
procedural-programming
grouping-sets
dbaccess
crowd
paw
linkedin-jsapi
named-parameters
alternate
ray
spring-remoting
renderer
twitter-bootstrap-rails
eclipse-kepler
kendo-dataviz
unit-of-work
beaker-testing
nevron
kaleidoscope
joomla3.1
onmousemove
midlet
pstack
boost-msm
os.system
httponly
box2d-iphone
luabind
node-redis
pinch
webdev.webserver
clrstoredprocedure
socketserver
svk
aspmenu
hbm2java
isapi-extension
sifr
alsb
software-lifecycle
wysiwym
application-planning
wcf-proxy

Resources

Encrypt Message